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
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) def translate_enum(type, value)
translate value, scope: [:enums, type] translate value, scope: [:enums, type]
end end

View file

@ -7,6 +7,9 @@
<th scope="col"> <th scope="col">
<%= Contact.human_attribute_name :value %> <%= Contact.human_attribute_name :value %>
</th> </th>
<th scope="col">
<%= Contact.human_attribute_name :send_security_notifications %>
</th>
<th scope="col"></th> <th scope="col"></th>
</tr> </tr>
</thead> </thead>
@ -16,6 +19,7 @@
<tr> <tr>
<td><%= contact.contact_network.name %></td> <td><%= contact.contact_network.name %></td>
<td><%= truncate contact.value %></td> <td><%= truncate contact.value %></td>
<td><%= bool_badge contact.send_security_notifications %></td>
<td> <td>
<% if policy([:settings, contact]).destroy? %> <% if policy([:settings, contact]).destroy? %>
<%= link_to( <%= link_to(

View file

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

View file

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