forked from fixin.me/fixin.me
Default Units index
This commit is contained in:
19
app/views/default/units/_unit.html.erb
Normal file
19
app/views/default/units/_unit.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<%= tag.tr do %>
|
||||
<td class="<%= class_names({subunit: unit.base}) %>">
|
||||
<%= unit.symbol %>
|
||||
</td>
|
||||
|
||||
<td class="actions">
|
||||
<% if current_user.at_least(:active) && unit.default? %>
|
||||
<%= image_button_to t(".import"), "download-outline", import_default_unit_path(unit) %>
|
||||
<% end %>
|
||||
<% if current_user.at_least(:admin) %>
|
||||
<% if !unit.default? %>
|
||||
<%= image_button_to t(".export"), "upload-outline", export_default_unit_path(unit) %>
|
||||
<% else %>
|
||||
<%= image_button_to t(".delete"), "delete-outline", unit_path(unit),
|
||||
method: :delete %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
@@ -1,5 +1,9 @@
|
||||
<div class="rightside buttongrid">
|
||||
<%= image_link_to t('.back'), 'arrow-left-bold-outline', units_path %>
|
||||
<% if current_user.at_least(:active) %>
|
||||
<%= image_link_to t('.import_all'), 'download-multiple-outline',
|
||||
import_all_default_units_path, data: {turbo_stream: true} %>
|
||||
<% end %>
|
||||
<%= image_link_to t('.back'), 'arrow-left-bold-outline', units_path, class: 'tools' %>
|
||||
</div>
|
||||
|
||||
<table class="main items">
|
||||
@@ -12,6 +16,6 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="units">
|
||||
<%= render(@units, partial: 'default') || render_no_items %>
|
||||
<%= render(@units) || render_no_items %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user