1
0

Add Targets #show

Change css classes from subject-oriented to property-oriented
This commit is contained in:
cryptogopher
2021-05-05 12:42:30 +02:00
parent 8cac724694
commit e301665b6a
22 changed files with 132 additions and 130 deletions

View File

@@ -15,23 +15,19 @@
</thead>
<tbody>
<% Quantity.each_with_level(@quantities) do |q, level| %>
<%
next if q.new_record?
quantity_class = "quantity"
quantity_class += " primary" unless q.exposures.empty?
quantity_class += " project idnt idnt-#{level+1}"
%>
<tr id="quantity-<%= q.id %>" class="<%= quantity_class %>">
<td class="name unwrappable">
<div class="icon <%= q.exposures.empty? ? 'icon-fav-off' : 'icon-fav' %>">
<% next if q.new_record? %>
<tr id="quantity-<%= q.id %>" class="quantity project idnt idnt-<%= level+1 -%>">
<%# NOTE: 'name' class only for proper indentation by 'idnt-N' %>
<td class="name topleft unwrappable<%= ' bolded' unless q.exposures.empty? -%>">
<div class="icon <%= q.exposures.empty? ? 'icon-fav-off' : 'icon-fav' -%>">
<%= q.name %>
</div>
</td>
<td class="order"><%= order_links(q) %></td>
<td class="domain"><%= q.domain %></td>
<td class="description"><%= q.description %></td>
<td class="description symmetric"><%= q.description %></td>
<td class="formula"><%= checked_image q.formula %></td>
<td class="action unwrappable"><%= action_links(q) %></td>
<td class="right shrunk unwrappable"><%= action_links(q) %></td>
</tr>
<% end %>
</tbody>

View File

@@ -1,7 +1,7 @@
$('tr[id=quantity-<%= @quantity.id %>]').nextUntil('tr.quantity').remove();
var columns = $('table > thead > tr > th').length;
$('tr[id=quantity-<%= @quantity.id %>]').nextUntil('tr.quantity').addBack().last().after(
'<tr><td class="form" colspan="'+columns+'">' +
'<div id="edit-quantity"><%= j render partial: "quantities/edit_form" %></div>' +
'<tr><td class="topleft symmetric" colspan="'+columns+'">' +
'<div id="edit-quantity"><%= j render partial: "quantities/edit_form" %></div>' +
'</td></tr>'
);