forked from fixin.me/fixin.me
9c51887024
Stretch inputs to column width in place of fixed sizing. Set minimum column widths for columns with form inputs. Simplify table operations by removing `thead` and adding sentinel. Manage empty table display with CSS only.
33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
<tr id="<%= dom_target(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) %>"
|
|
data-drop-id="<%= dom_target(unit.base || unit) %>"
|
|
data-drop-id-param="<%= field_name(:unit, :base_id) %>">
|
|
|
|
<td style="--depth:<%= unit.base_id? ? 1 : 0 %>">
|
|
<%= link_to unit, edit_unit_path(unit), class: 'link', onclick: 'this.blur();',
|
|
data: {turbo_stream: true} %>
|
|
<%# Closing <td> tag required to avoid whitespace inclusion for testing. %>
|
|
<td class="ralign"><%= unit.multiplier.to_html if unit.base_id? %></td>
|
|
<td><%= unit.description %>
|
|
|
|
<% if current_user.at_least(:active) %>
|
|
<td class="flex">
|
|
<% unless unit.base_id? %>
|
|
<%= image_link_to t('.new_subunit'), 'plus-outline', new_unit_path(unit),
|
|
id: dom_target(:new, unit, :link), onclick: 'this.blur();',
|
|
data: {turbo_stream: true} %>
|
|
<% end %>
|
|
|
|
<%= image_button_to_if unit.movable?, t('.destroy'), 'delete-outline',
|
|
unit_path(unit), method: :delete %>
|
|
|
|
<% if unit.movable? %>
|
|
<td class="handle" draggable="true">⠿
|
|
<% else %>
|
|
<td>
|
|
<% end %>
|
|
<% end %>
|