Added Measurement readouts action
This commit is contained in:
4
app/views/measurements/_contextual.html.erb
Normal file
4
app/views/measurements/_contextual.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<%= link_to t(".link_new_measurement"), new_project_measurement_path(@project),
|
||||
{remote: true, class: 'icon icon-add'} %>
|
||||
<% end %>
|
||||
@@ -16,7 +16,9 @@
|
||||
<%= m.taken_at.getlocal.strftime("%F <small>%R</small>").html_safe %>
|
||||
</td>
|
||||
<td class="name">
|
||||
<div style="float:left;"><%= m.name %></div>
|
||||
<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>
|
||||
|
||||
@@ -3,12 +3,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="contextual">
|
||||
<% if User.current.allowed_to?(:manage_common, @project) %>
|
||||
<%= link_to t(".link_new_measurement"), new_project_measurement_path(@project), {
|
||||
remote: true,
|
||||
class: 'icon icon-add'
|
||||
} %>
|
||||
<% end %>
|
||||
<%= render partial: 'measurements/contextual' %>
|
||||
</div>
|
||||
|
||||
<div id="new-measurement">
|
||||
|
||||
19
app/views/measurements/readouts.html.erb
Normal file
19
app/views/measurements/readouts.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<% content_for :sidebar do %>
|
||||
<%= render partial: 'body_trackers/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<div class="contextual">
|
||||
<%= render partial: 'measurements/contextual' %>
|
||||
</div>
|
||||
|
||||
<div id="new-measurement">
|
||||
</div>
|
||||
|
||||
<h2>
|
||||
<%= link_to t("measurements.index.heading"), project_measurements_path(@project) %>
|
||||
>
|
||||
<%= @measurements.first.name %>
|
||||
</h2>
|
||||
<div id='measurements'>
|
||||
<%= render partial: 'measurements/index' %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user