forked from fixin.me/fixin.me
29 lines
1.0 KiB
Plaintext
29 lines
1.0 KiB
Plaintext
<%= tag.tr id: dom_id(unit), ondragover: "dragOver(event)", ondrop: "drop(event)",
|
|
data: {drag_path: unit_path(unit), drop_id: unit.base_id || unit.id} do %>
|
|
|
|
<td class="<%= class_names('link', {subunit: unit.base}) %>">
|
|
<%= link_to unit.symbol, edit_unit_path(unit), id: dom_id(unit, :edit),
|
|
onclick: 'this.blur();', data: {turbo_stream: true} %>
|
|
</td>
|
|
<td><%= unit.name %></td>
|
|
<td class="number"><%= scientifize(unit.multiplier) %></td>
|
|
|
|
<% if current_user.at_least(:active) %>
|
|
<td class="actions">
|
|
<% if unit.base.nil? %>
|
|
<%= image_link_to t(".add_subunit"), "plus-outline", new_unit_path(unit),
|
|
id: dom_id(unit, :add), onclick: 'this.blur();',
|
|
data: {turbo_stream: true} %>
|
|
<% end %>
|
|
|
|
<%= image_button_to t(".delete_unit"), "delete-outline", unit_path(unit),
|
|
method: :delete %>
|
|
</td>
|
|
<% if unit.movable? %>
|
|
<td class="handle" draggable="true" ondragstart="dragStart(event)">⠿</td>
|
|
<% else %>
|
|
<td></td>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|