2019-09-03 10:31:20 -04:00
|
|
|
<table class="table mt-3">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">
|
|
|
|
<%= Contact.human_attribute_name :contact_network %>
|
|
|
|
</th>
|
|
|
|
<th scope="col">
|
|
|
|
<%= Contact.human_attribute_name :value %>
|
|
|
|
</th>
|
2019-09-04 14:14:17 -04:00
|
|
|
<th scope="col">
|
|
|
|
<%= Contact.human_attribute_name :send_security_notifications %>
|
|
|
|
</th>
|
2020-04-10 00:37:23 -04:00
|
|
|
<th scope="col">
|
|
|
|
<%= Contact.human_attribute_name :show_in_public %>
|
|
|
|
</th>
|
2019-09-03 10:31:20 -04:00
|
|
|
<th scope="col"></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<% contacts.each do |contact| %>
|
|
|
|
<tr>
|
|
|
|
<td><%= contact.contact_network.name %></td>
|
2020-04-10 01:13:07 -04:00
|
|
|
|
2020-04-09 22:15:48 -04:00
|
|
|
<td>
|
|
|
|
<% if contact.link.nil? %>
|
|
|
|
<%= truncate contact.value %>
|
|
|
|
<% else %>
|
2020-05-29 04:20:53 -04:00
|
|
|
<%= link_to truncate(contact.value),
|
|
|
|
contact.link,
|
|
|
|
target: :_blank,
|
|
|
|
rel: 'noopener noreferrer' %>
|
2020-04-09 22:15:48 -04:00
|
|
|
<i class="fas fa-external-link-alt fa-xs text-muted"></i>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
2020-04-10 01:13:07 -04:00
|
|
|
|
2019-09-04 14:51:23 -04:00
|
|
|
<td>
|
|
|
|
<% if policy([
|
|
|
|
:settings,
|
|
|
|
ContactSecurityNotificationSwitch.new(contact),
|
|
|
|
]).create? %>
|
|
|
|
<%= link_to(
|
|
|
|
settings_contact_security_notification_switch_path(contact),
|
|
|
|
method: :post,
|
|
|
|
) do %>
|
|
|
|
<%= bool_badge contact.send_security_notifications %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
2020-04-10 01:13:07 -04:00
|
|
|
|
2020-04-10 00:37:23 -04:00
|
|
|
<td>
|
|
|
|
<% if policy([
|
|
|
|
:settings,
|
|
|
|
ContactPublicSwitch.new(contact),
|
|
|
|
]).create? %>
|
|
|
|
<%= link_to(
|
|
|
|
settings_contact_public_switch_path(contact),
|
|
|
|
method: :post,
|
2020-04-10 01:13:07 -04:00
|
|
|
data: { confirm: contact_public_switch_confirmation(contact) },
|
2020-04-10 00:37:23 -04:00
|
|
|
) do %>
|
|
|
|
<%= bool_badge contact.show_in_public %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
2020-04-10 01:13:07 -04:00
|
|
|
|
2019-09-03 10:31:20 -04:00
|
|
|
<td>
|
|
|
|
<% if policy([:settings, contact]).destroy? %>
|
|
|
|
<%= link_to(
|
|
|
|
[:settings, contact],
|
|
|
|
method: :delete,
|
|
|
|
class: 'btn btn-danger btn-sm',
|
|
|
|
data: { confirm: contact_destroy_confirmation(contact) },
|
|
|
|
) do %>
|
|
|
|
<i class="fas fa-trash"></i>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|