1
0
Fork 0

Add ApplicationHelper#open_action

This commit is contained in:
Alex Kotov 2019-08-15 13:34:48 +05:00
parent 294a32da67
commit 0cb957d3b5
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
6 changed files with 13 additions and 13 deletions

View File

@ -13,6 +13,14 @@ module ApplicationHelper
translate value, scope: [:enums, type]
end
def open_action(url)
link_to url, role: :button, class: 'btn btn-light btn-sm' do
concat tag.i class: 'far fa-eye'
concat ' '.html_safe
concat translate :open_action
end
end
def bootstrap_class_for_flash(flash_type)
case flash_type
when 'success'

View File

@ -39,11 +39,7 @@
</td>
<td>
<% if policy(federal_subject).show? %>
<%= link_to federal_subject,
role: :button,
class: 'btn btn-light btn-sm' do %>
<i class="far fa-eye"></i>
<% end %>
<%= open_action federal_subject %>
<% end %>
</td>
</tr>

View File

@ -36,10 +36,7 @@
</td>
<td>
<% if policy([:staff, account]).show? %>
<%= link_to [:staff, account],
role: :button, class: 'btn btn-light btn-sm' do %>
<i class="far fa-eye"></i>
<% end %>
<%= open_action [:staff, account] %>
<% end %>
</td>
</tr>

View File

@ -46,10 +46,7 @@
</td>
<td>
<% if policy([:staff, person]).show? %>
<%= link_to [:staff, person],
role: :button, class: 'btn btn-light btn-sm' do %>
<i class="far fa-eye"></i>
<% end %>
<%= open_action [:staff, person] %>
<% end %>
</td>
</tr>

View File

@ -6,3 +6,4 @@ en:
:yes: Yes
:no: No
superuser: Administrator
open_action: Open

View File

@ -6,3 +6,4 @@ ru:
:yes: Да
:no: Нет
superuser: Администратор
open_action: Открыть