Added closable/un-/shrinkable css classes for table column styling
This commit is contained in:
parent
ea8c70e1c0
commit
751da2f0df
@ -7,7 +7,7 @@
|
|||||||
<% total_width = 3 + @quantities.length %>
|
<% total_width = 3 + @quantities.length %>
|
||||||
<th style="width:<%= 2 * 100/total_width%>%"><%= l(:field_taken_at_date) %></th>
|
<th style="width:<%= 2 * 100/total_width%>%"><%= l(:field_taken_at_date) %></th>
|
||||||
<% @quantities.each do |q| %>
|
<% @quantities.each do |q| %>
|
||||||
<th style="width:<%= 100/total_width %>%">
|
<th style="width:<%= 100/total_width %>%" class="closable shrinkable">
|
||||||
<div style="float:right;position:relative;">
|
<div style="float:right;position:relative;">
|
||||||
<%= link_to '', toggle_column_measurement_path(@measurement, quantity_id: q.id),
|
<%= link_to '', toggle_column_measurement_path(@measurement, quantity_id: q.id),
|
||||||
{class: "icon icon-close", method: :post, remote: true} %>
|
{class: "icon icon-close", method: :post, remote: true} %>
|
||||||
@ -22,13 +22,14 @@
|
|||||||
<% @measurements.each_with_index do |m, index| %>
|
<% @measurements.each_with_index do |m, index| %>
|
||||||
<% row_class = "measurement #{cycle('odd', 'even')}" %>
|
<% row_class = "measurement #{cycle('odd', 'even')}" %>
|
||||||
<tr id="measurement-<%= m.id %>" class="primary <%= row_class %>">
|
<tr id="measurement-<%= m.id %>" class="primary <%= row_class %>">
|
||||||
<td class="date" style="cursor: pointer;" onclick="$(this).closest('tr').toggle(); $(this).closest('tr').nextUntil('tr.primary', '.measurement').toggle(); return false;">
|
<td class="date unshrinkable" style="cursor: pointer;"
|
||||||
|
onclick="$(this).closest('tr').toggle(); $(this).closest('tr').nextUntil('tr.primary', '.measurement').toggle(); return false;">
|
||||||
<span class="icon icon-bullet-closed"><%= format_datetime(m) %></span>
|
<span class="icon icon-bullet-closed"><%= format_datetime(m) %></span>
|
||||||
</td>
|
</td>
|
||||||
<% @requested_r[index].each do |*, value| %>
|
<% @requested_r[index].each do |*, value| %>
|
||||||
<td class="primary value"><%= format_value(value) %></td>
|
<td class="primary value shrinkable"><%= format_value(value) %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td class="action"><%= action_links(m) %></td>
|
<td class="action unshrinkable"><%= action_links(m) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="<%= row_class %>" style="display:none">
|
<tr class="<%= row_class %>" style="display:none">
|
||||||
@ -37,23 +38,24 @@
|
|||||||
else
|
else
|
||||||
rows = 1
|
rows = 1
|
||||||
end %>
|
end %>
|
||||||
<td rowspan="<%= rows %>" class="date" style="cursor: pointer;" onclick="$(this).closest('tr').prev('tr.primary').toggle(); $(this).closest('tr').prev('tr.primary').nextUntil('tr.primary', '.measurement').toggle(); return false;">
|
<td rowspan="<%= rows %>" class="date unshrinkable" style="cursor: pointer;"
|
||||||
|
onclick="$(this).closest('tr').prev('tr.primary').toggle(); $(this).closest('tr').prev('tr.primary').nextUntil('tr.primary', '.measurement').toggle(); return false;">
|
||||||
<span class="icon icon-bullet-open"><%= format_datetime(m) %></span>
|
<span class="icon icon-bullet-open"><%= format_datetime(m) %></span>
|
||||||
</td>
|
</td>
|
||||||
<% @requested_r[index].each do |q_name, value| %>
|
<% @requested_r[index].each do |q_name, value| %>
|
||||||
<td class="primary quantity">
|
<td class="primary quantity shrinkable">
|
||||||
<%= q_name %>
|
<%= q_name %>
|
||||||
<p class="value"><%= format_value(value) %></p>
|
<p class="value"><%= format_value(value) %></p>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td rowspan="<%= rows %>" class="action"><%= action_links(m) %></td>
|
<td rowspan="<%= rows %>" class="action unshrinkable"><%= action_links(m) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% next unless @quantities.length > 0 %>
|
<% next unless @quantities.length > 0 %>
|
||||||
<% @extra_r[index].each_slice(@quantities.length).with_index do |values| %>
|
<% @extra_r[index].each_slice(@quantities.length).with_index do |values| %>
|
||||||
<tr class="extra <%= row_class %>" style="display:none">
|
<tr class="extra <%= row_class %>" style="display:none">
|
||||||
<% values.each do |q_name, value| %>
|
<% values.each do |q_name, value| %>
|
||||||
<td class="extra quantity">
|
<td class="extra quantity shrinkable">
|
||||||
<%= q_name %>
|
<%= q_name %>
|
||||||
<p class="value"><%= format_value(value) %></p>
|
<p class="value"><%= format_value(value) %></p>
|
||||||
</td>
|
</td>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
quantity_class += " project idnt idnt-#{level+1}"
|
quantity_class += " project idnt idnt-#{level+1}"
|
||||||
%>
|
%>
|
||||||
<tr id="quantity-<%= q.id %>" class="<%= quantity_class %>">
|
<tr id="quantity-<%= q.id %>" class="<%= quantity_class %>">
|
||||||
<td class="name"><%= q.name %></td>
|
<td class="name unshrinkable"><%= q.name %></td>
|
||||||
<td class="order">
|
<td class="order">
|
||||||
<% [:up, :down, :left, :right].each do |direction| %>
|
<% [:up, :down, :left, :right].each do |direction| %>
|
||||||
<%=
|
<%=
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<td class="domain"><%= q.domain %></td>
|
<td class="domain"><%= q.domain %></td>
|
||||||
<td class="description"><%= q.description %></td>
|
<td class="description"><%= q.description %></td>
|
||||||
<td class="formula"><%= checked_image q.formula.present? %></td>
|
<td class="formula"><%= checked_image q.formula.present? %></td>
|
||||||
<td class="action">
|
<td class="action unshrinkable">
|
||||||
<%= link_to l(:button_edit), edit_quantity_path(q), {
|
<%= link_to l(:button_edit), edit_quantity_path(q), {
|
||||||
remote: true,
|
remote: true,
|
||||||
class: "icon icon-edit"
|
class: "icon icon-edit"
|
||||||
|
@ -9,15 +9,9 @@ table.list .quantity {text-align: left;}
|
|||||||
table.list .action,
|
table.list .action,
|
||||||
table.list .value {text-align: right;}
|
table.list .value {text-align: right;}
|
||||||
|
|
||||||
table.list td.action,
|
table.list th.closable {padding-right: 0;}
|
||||||
table.list td.date {white-space: nowrap;}
|
table.list .unshrinkable {white-space: nowrap;}
|
||||||
|
table.list .shrinkable {
|
||||||
table.list th {padding-right: 0;}
|
|
||||||
|
|
||||||
table.list th,
|
|
||||||
table.list td.name,
|
|
||||||
table.list td.quantity,
|
|
||||||
table.list td.value {
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
Reference in New Issue
Block a user