58 lines
2.1 KiB
Plaintext
58 lines
2.1 KiB
Plaintext
<h2 class="inline-block"><%= t("tracking.progress_bars.index.title") %></h2>
|
|
|
|
<%= link_to t("tracking.progress_bars.index.new_progress_bar"),
|
|
polymorphic_path(
|
|
[:tracking, *resource_hierarchy_for(ProgressBar.new(progressable: progressable))],
|
|
action: :new
|
|
),
|
|
class: "button float-right" %>
|
|
|
|
<% if progressable.progress_bars.any? %>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th><%= t("tracking.progress_bars.index.table_id") %></th>
|
|
<th><%= t("tracking.progress_bars.index.table_kind") %></th>
|
|
<th><%= t("tracking.progress_bars.index.table_title") %></th>
|
|
<th class="text-center"><%= t("tracking.progress_bars.index.table_percentage") %></th>
|
|
<th><%= t("admin.actions.actions") %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% progressable.progress_bars.each do |progress_bar| %>
|
|
<tr id="<%= dom_id(progress_bar) %>" class="progress-bar">
|
|
<td>
|
|
<%= progress_bar.id %>
|
|
</td>
|
|
<td><%= ProgressBar.human_attribute_name("kind.#{progress_bar.kind}") %></td>
|
|
<td>
|
|
<% if progress_bar.title.present? %>
|
|
<%= progress_bar.title %>
|
|
<% else %>
|
|
<strong><%= t("tracking.progress_bars.index.primary") %></strong>
|
|
<% end %>
|
|
</td>
|
|
<td class="text-center">
|
|
<%= number_to_percentage(progress_bar.percentage, strip_insignificant_zeros: true) %>
|
|
</td>
|
|
<td>
|
|
<%= link_to t("admin.actions.edit"),
|
|
polymorphic_path([:tracking, *resource_hierarchy_for(progress_bar)],
|
|
action: :edit),
|
|
class: "button hollow" %>
|
|
|
|
<%= link_to t("admin.actions.delete"),
|
|
polymorphic_path([:tracking, *resource_hierarchy_for(progress_bar)]),
|
|
method: :delete,
|
|
class: "button hollow alert" %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% else %>
|
|
<div class="callout primary">
|
|
<%= t("tracking.progress_bars.index.no_progress_bars") %>
|
|
</div>
|
|
<% end %>
|