1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
2019-10-27 20:05:57 +01:00

89 lines
2.8 KiB
Plaintext

<% if @quantities.many? %>
<table class="list">
<thead>
<tr>
<th><%= l(:field_name) %></th>
<th><%= l(:field_order) %></th>
<th><%= l(:field_domain) %></th>
<th><%= l(:field_description) %></th>
<th><%= l(:field_action) %></th>
</tr>
</thead>
<tbody>
<% Quantity.each_with_level(@quantities) do |q, level| %>
<%
next if q.new_record?
quantity_class = "quantity"
quantity_class += " project idnt idnt-#{level+1}"
quantity_class += " primary" if q.primary
quantity_class += " anchor" if @anchor == q.id
%>
<tr id="quantity-<%= q.id %>" class="<%= quantity_class %>">
<td class="name">
<%= link_to '', toggle_quantity_path(q), {
remote: true,
method: :post,
class: "icon #{q.primary ? "icon-fav" : "icon-fav-off"}"
}
%>
<%= q.name %>
</td>
<td class="order">
<%=
if q.left_sibling.present?
link_to '', up_quantity_path(q), {
remote: true,
method: :post,
class: "icon icon-move-up"
}
else
link_to '', '', {class: "icon"}
end
%>
<%=
if q.right_sibling.present?
link_to '', down_quantity_path(q), {
remote: true,
method: :post,
class: "icon icon-move-down"
}
else
link_to '', '', {class: "icon"}
end
%>
<%=
if q.parent.present?
link_to '', left_quantity_path(q), {
remote: true,
method: :post,
class: "icon icon-move-left"
}
else
link_to '', '', {class: "icon"}
end
%>
<%=
if q.left_sibling.present?
link_to '', right_quantity_path(q), {
remote: true,
method: :post,
class: "icon icon-move-right"
}
else
link_to '', '', {class: "icon"}
end
%>
</td>
<td class="domain"><%= q.domain %></td>
<td class="description"><%= q.description %></td>
<td class="action">
<%= delete_link quantity_path(q), {remote: true, data: {}} %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>