Added readout count to index
This commit is contained in:
parent
f769fff930
commit
e1daade54f
@ -77,6 +77,6 @@ class MeasurementsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def prepare_measurements
|
def prepare_measurements
|
||||||
@measurements = @project.measurements.includes(:source)
|
@measurements = @project.measurements.includes(:source, :readouts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -13,7 +13,10 @@
|
|||||||
<% next if m.new_record? %>
|
<% next if m.new_record? %>
|
||||||
<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"><%= m.name %></td>
|
<td class="name">
|
||||||
|
<%= m.name %>
|
||||||
|
<small><%= " (#{m.readouts.size} readouts)" %></small>
|
||||||
|
</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">
|
||||||
<%= link_to l(:button_retake), retake_measurement_path(m), {
|
<%= link_to l(:button_retake), retake_measurement_path(m), {
|
||||||
@ -31,7 +34,7 @@
|
|||||||
((action_name == "edit") ||
|
((action_name == "edit") ||
|
||||||
(action_name == "update" && @measurement.errors.present?)) %>
|
(action_name == "update" && @measurement.errors.present?)) %>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="form" colspan="4">
|
<td class="form" colspan="5">
|
||||||
<div id="edit-measurement">
|
<div id="edit-measurement">
|
||||||
<%= labelled_form_for @measurement,
|
<%= labelled_form_for @measurement,
|
||||||
url: measurement_path(@measurement),
|
url: measurement_path(@measurement),
|
||||||
|
Reference in New Issue
Block a user