% if @measurements.any? { |m| m.persisted? } %>
<%= l(:field_taken_at_date) %> | <%= l(:field_name) %> | <%= l(:field_source) %> | <%= l(:field_action) %> | |
---|---|---|---|---|
<%= m.taken_at.strftime("%F %R") %> |
<%= m.name %>
<%= " (#{pluralize(m.readouts.size, 'readout')})" %>
|
<%= m.source.name if m.source.present? %> | <%= link_to l(:button_retake), retake_measurement_path(m), { remote: true, class: "icon icon-reload" } %> <%= link_to l(:button_edit), edit_measurement_path(m), { remote: true, class: "icon icon-edit" } %> <%= delete_link measurement_path(m), {remote: true, data: {}} %> | |
<%= labelled_form_for @measurement,
url: measurement_path(@measurement),
method: :patch, remote: true,
html: {id: 'measurement-edit-form', name: 'measurement-edit-form'} do |f| %>
<%= render partial: 'measurements/form', locals: {f: f} %>
<%= submit_tag l(:button_save) %> <%= link_to l(:button_cancel), "#", onclick: '$(this).closest("tr").remove(); return false;' %> |
<%= l(:label_no_data) %>
<% end %>