Display Contact#send_security_notifications
This commit is contained in:
parent
4fe39ce8a2
commit
ac78717d6b
4 changed files with 18 additions and 0 deletions
|
@ -46,6 +46,18 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
def bool_badge(value)
|
||||
if value
|
||||
tag.span class: 'badge badge-pill badge-success' do
|
||||
translate :yes
|
||||
end
|
||||
else
|
||||
tag.span class: 'badge badge-pill badge-secondary' do
|
||||
translate :no
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def translate_enum(type, value)
|
||||
translate value, scope: [:enums, type]
|
||||
end
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
<th scope="col">
|
||||
<%= Contact.human_attribute_name :value %>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<%= Contact.human_attribute_name :send_security_notifications %>
|
||||
</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -16,6 +19,7 @@
|
|||
<tr>
|
||||
<td><%= contact.contact_network.name %></td>
|
||||
<td><%= truncate contact.value %></td>
|
||||
<td><%= bool_badge contact.send_security_notifications %></td>
|
||||
<td>
|
||||
<% if policy([:settings, contact]).destroy? %>
|
||||
<%= link_to(
|
||||
|
|
|
@ -49,6 +49,7 @@ en:
|
|||
id: ID
|
||||
contact_network: Contact network
|
||||
value: Value
|
||||
send_security_notifications: Security notifications
|
||||
contact_network:
|
||||
id: ID
|
||||
codename: Codename
|
||||
|
|
|
@ -49,6 +49,7 @@ ru:
|
|||
id: ID
|
||||
contact_network: Сеть контактов
|
||||
value: Значение
|
||||
send_security_notifications: Уведомления безопасности
|
||||
contact_network:
|
||||
id: ID
|
||||
codename: Кодовое имя
|
||||
|
|
Reference in a new issue