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