Updated ItemsWithQuantities to work with MeasurementRoutine Replaced ColumnViews HABTM with polymorphic HMT Added Measurement notes Added destroy restrictions on Quantity Replaced BodyTrackingPluginController with Finders concern Removed 'body_trackers' prefix from paths Unified styling for textarea
66 lines
2.2 KiB
Plaintext
66 lines
2.2 KiB
Plaintext
<%= render partial: 'quantities/filters',
|
|
locals: {url: filter_project_quantities_path(@project)} %>
|
|
|
|
<% if @quantities.any? { |q| q.persisted? } %>
|
|
<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_formula) %></th>
|
|
<th style="width:5%"><%= 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 += " primary" unless q.columns.empty?
|
|
quantity_class += " project idnt idnt-#{level+1}"
|
|
%>
|
|
<tr id="quantity-<%= q.id %>" class="<%= quantity_class %>">
|
|
<td class="name unwrappable">
|
|
<div class="icon <%= q.columns.empty? ? 'icon-fav-off' : 'icon-fav' %>">
|
|
<%= q.name %>
|
|
</div>
|
|
</td>
|
|
<td class="order">
|
|
<% [:up, :down, :left, :right].each do |direction| %>
|
|
<%=
|
|
if q.movable?(direction)
|
|
link_to '', move_quantity_path(q, direction), {
|
|
remote: true,
|
|
method: :post,
|
|
class: "icon icon-move icon-move-#{direction}"
|
|
}
|
|
else
|
|
link_to '', '', {class: "icon", style: "visibility: hidden;"}
|
|
end
|
|
%>
|
|
<% end %>
|
|
</td>
|
|
<td class="domain"><%= q.domain %></td>
|
|
<td class="description"><%= q.description %></td>
|
|
<td class="formula"><%= checked_image q.formula %></td>
|
|
<td class="action unwrappable">
|
|
<%= link_to l(:button_child), new_child_quantity_path(q), {
|
|
remote: true,
|
|
class: "icon icon-add"
|
|
} %>
|
|
<%= link_to l(:button_edit), edit_quantity_path(q), {
|
|
remote: true,
|
|
class: "icon icon-edit"
|
|
} %>
|
|
<%= delete_link quantity_path(q), {remote: true, data: {}} %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% else %>
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
<% end %>
|