43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
<% if @measurements.any? { |m| m.persisted? } %>
|
|
<table class="list">
|
|
<thead>
|
|
<tr>
|
|
<th style="width:5%"><%= l(:field_taken_at_date) %></th>
|
|
<th><%= l(:field_name) %></th>
|
|
<th><%= l(:field_source) %></th>
|
|
<th style="width:10%"><%= l(:field_action) %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @measurements.each do |m| %>
|
|
<% next if m.new_record? %>
|
|
<tr id="measurement-<%= m.id %>" class="measurement <%= 'hidden' if m.hidden %>">
|
|
<td class="date"><%= format_datetime(m) %></td>
|
|
<td class="name">
|
|
<div style="float:left;">
|
|
<%= link_to m.name, readouts_measurement_path(m) %>
|
|
</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">
|
|
<%= 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: {}} %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% else %>
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
<% end %>
|