1
0
Fork 0

Display Contact#send_security_notifications

This commit is contained in:
Alex Kotov 2019-09-04 23:14:17 +05:00
parent 4fe39ce8a2
commit ac78717d6b
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
4 changed files with 18 additions and 0 deletions

View file

@ -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

View file

@ -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(

View file

@ -49,6 +49,7 @@ en:
id: ID
contact_network: Contact network
value: Value
send_security_notifications: Security notifications
contact_network:
id: ID
codename: Codename

View file

@ -49,6 +49,7 @@ ru:
id: ID
contact_network: Сеть контактов
value: Значение
send_security_notifications: Уведомления безопасности
contact_network:
id: ID
codename: Кодовое имя