1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/app/views/targets/_index.html.erb
2021-05-08 15:38:41 +02:00

30 lines
1.0 KiB
Plaintext

<% if @targets_by_date.any? %>
<%= render partial: 'targets/options' %>
<% formulas = @quantities.collect(&:formula) %>
<%= error_messages_for *formulas %>
<table id="targets" class="list odd-even">
<%= quantities_table_header @quantities, :field_effective_from do |quantity_id|
goal_toggle_exposure_path(@goal, quantity_id: quantity_id)
end %>
<tbody>
<% @targets_by_date.each do |date, targets| %>
<tr id="date-<%= date %>" class="date <%= cycle('odd', 'even') %>">
<td class="topleft unwrappable">
<%= link_to(format_date(date), goal_target_path(@goal, date),
{remote: true, class: 'icon icon-arrow-right'}) %>
</td>
<% @quantities.each do |q| %>
<td class="right unwrappable"><%= raw targets[q].to_s %></td>
<% end %>
<td class="right shrunk unwrappable"><%= action_links(date) %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>