Add ApplicationHelper#open_action
This commit is contained in:
parent
294a32da67
commit
0cb957d3b5
|
@ -13,6 +13,14 @@ module ApplicationHelper
|
||||||
translate value, scope: [:enums, type]
|
translate value, scope: [:enums, type]
|
||||||
end
|
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)
|
def bootstrap_class_for_flash(flash_type)
|
||||||
case flash_type
|
case flash_type
|
||||||
when 'success'
|
when 'success'
|
||||||
|
|
|
@ -39,11 +39,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<% if policy(federal_subject).show? %>
|
<% if policy(federal_subject).show? %>
|
||||||
<%= link_to federal_subject,
|
<%= open_action federal_subject %>
|
||||||
role: :button,
|
|
||||||
class: 'btn btn-light btn-sm' do %>
|
|
||||||
<i class="far fa-eye"></i>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -36,10 +36,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<% if policy([:staff, account]).show? %>
|
<% if policy([:staff, account]).show? %>
|
||||||
<%= link_to [:staff, account],
|
<%= open_action [:staff, account] %>
|
||||||
role: :button, class: 'btn btn-light btn-sm' do %>
|
|
||||||
<i class="far fa-eye"></i>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -46,10 +46,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<% if policy([:staff, person]).show? %>
|
<% if policy([:staff, person]).show? %>
|
||||||
<%= link_to [:staff, person],
|
<%= open_action [:staff, person] %>
|
||||||
role: :button, class: 'btn btn-light btn-sm' do %>
|
|
||||||
<i class="far fa-eye"></i>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -6,3 +6,4 @@ en:
|
||||||
:yes: Yes
|
:yes: Yes
|
||||||
:no: No
|
:no: No
|
||||||
superuser: Administrator
|
superuser: Administrator
|
||||||
|
open_action: Open
|
||||||
|
|
|
@ -6,3 +6,4 @@ ru:
|
||||||
:yes: Да
|
:yes: Да
|
||||||
:no: Нет
|
:no: Нет
|
||||||
superuser: Администратор
|
superuser: Администратор
|
||||||
|
open_action: Открыть
|
||||||
|
|
Reference in New Issue