forked from fixin.me/fixin.me
32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
<%= tag.tr id: dom_id(unit),
|
|
ondragstart: "dragStart(event)", ondragend: "dragEnd(event)",
|
|
ondragover: "dragOver(event)", ondrop: "drop(event)",
|
|
ondragenter: "dragEnter(event)", ondragleave: "dragLeave(event)",
|
|
data: {drag_path: rebase_unit_path(unit),
|
|
drop_id: dom_id(unit.base || unit),
|
|
drop_id_param: "unit[base_id]"} do %>
|
|
|
|
<td class="link" style="--depth:<%= unit.base_id? ? 1 : 0 %>">
|
|
<%= link_to unit, edit_unit_path(unit), onclick: 'this.blur();', data: {turbo_stream: true} %>
|
|
</td>
|
|
<td><%= unit.description %></td>
|
|
<td class="number"><%= unit.multiplier.to_html %></td>
|
|
|
|
<% if current_user.at_least(:active) %>
|
|
<td class="actions">
|
|
<% unless unit.base_id? %>
|
|
<%= image_link_to t('.new_subunit'), 'plus-outline', new_unit_path(unit),
|
|
id: dom_id(unit, :new, :link), onclick: 'this.blur();', data: {turbo_stream: true} %>
|
|
<% end %>
|
|
|
|
<%= image_button_to_if unit.movable?, t('.destroy'), 'delete-outline', unit_path(unit),
|
|
method: :delete %>
|
|
</td>
|
|
<% if unit.movable? %>
|
|
<td class="handle" draggable="true">⠿</td>
|
|
<% else %>
|
|
<td></td>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|