Layout updates
This commit is contained in:
parent
e1daade54f
commit
03d3e1e262
@ -47,7 +47,9 @@ class MeasurementsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def retake
|
def retake
|
||||||
|
@measurement = @measurement.dup
|
||||||
prepare_measurements
|
prepare_measurements
|
||||||
|
redirect_to project_measurements_path(@project)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -14,8 +14,10 @@
|
|||||||
<tr id="measurement-<%= m.id %>" class="measurement <%= 'hidden' if m.hidden %>">
|
<tr id="measurement-<%= m.id %>" class="measurement <%= 'hidden' if m.hidden %>">
|
||||||
<td class="date"><%= m.taken_at.strftime("%F %R") %></td>
|
<td class="date"><%= m.taken_at.strftime("%F %R") %></td>
|
||||||
<td class="name">
|
<td class="name">
|
||||||
<%= m.name %>
|
<div style="float:left;"><%= m.name %></div>
|
||||||
<small><%= " (#{m.readouts.size} readouts)" %></small>
|
<div style="float:right;">
|
||||||
|
<small><%= " (#{pluralize(m.readouts.size, 'readout')})" %></small>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="source"><%= m.source.name if m.source.present? %></td>
|
<td class="source"><%= m.source.name if m.source.present? %></td>
|
||||||
<td class="action">
|
<td class="action">
|
||||||
|
@ -5,11 +5,13 @@
|
|||||||
<div class="contextual">
|
<div class="contextual">
|
||||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||||
<%= link_to t(".link_new_measurement"), '#', class: 'icon icon-add',
|
<%= link_to t(".link_new_measurement"), '#', class: 'icon icon-add',
|
||||||
onclick: '$("#add-measurement").show(); $("#measurement_name").focus(); return false;' %>
|
onclick: '$("#add-measurement").toggle(); $("#measurement_name").focus(); return false;'
|
||||||
|
%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="add-measurement" <%= 'style=display:none;' if @measurement.errors.empty? %>>
|
<% hide_add_form = @measurement.errors.empty? && (action_name != "retake") %>
|
||||||
|
<div id="add-measurement" <%= 'style=display:none;' if hide_add_form %>>
|
||||||
<h2><%= t ".heading_new_measurement" %></h2>
|
<h2><%= t ".heading_new_measurement" %></h2>
|
||||||
|
|
||||||
<%= labelled_form_for @measurement,
|
<%= labelled_form_for @measurement,
|
||||||
|
@ -59,12 +59,12 @@ en:
|
|||||||
confirm_defaults: 'This will load default quantities and units. Continue?'
|
confirm_defaults: 'This will load default quantities and units. Continue?'
|
||||||
measurements:
|
measurements:
|
||||||
form:
|
form:
|
||||||
heading_new_measurement: 'New measurement'
|
|
||||||
button_add_readout: 'Add readout'
|
button_add_readout: 'Add readout'
|
||||||
button_delete_readout: 'Delete'
|
button_delete_readout: 'Delete'
|
||||||
null_source: '- unspecified -'
|
null_source: '- unspecified -'
|
||||||
index:
|
index:
|
||||||
heading: 'Measurements'
|
heading: 'Measurements'
|
||||||
|
heading_new_measurement: 'New measurement'
|
||||||
link_new_measurement: 'New measurement'
|
link_new_measurement: 'New measurement'
|
||||||
ingredients:
|
ingredients:
|
||||||
contextual:
|
contextual:
|
||||||
|
Reference in New Issue
Block a user