add ammo type round totals and total rounds shot

This commit is contained in:
2022-02-19 00:18:24 -05:00
parent dba53106fb
commit a19ec682e6
4 changed files with 77 additions and 0 deletions

View File

@ -28,6 +28,9 @@
<%= field_name %>
</th>
<% end %>
<th class="p-2">
<%= gettext("Total # of rounds") %>
</th>
<th class="p-2"></th>
</tr>
@ -46,6 +49,10 @@
</td>
<% end %>
<td class="p-2">
<%= ammo_type |> Ammo.get_round_count_for_ammo_type(@current_user) %>
</td>
<td class="p-2">
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<%= live_redirect to: Routes.ammo_type_show_path(Endpoint, :show, ammo_type),

View File

@ -73,6 +73,22 @@
<% end %>
<% end %>
<h3 class="title text-lg">
<%= gettext("Current # of rounds:") %>
</h3>
<span class="text-primary-600">
<%= @ammo_type |> Ammo.get_round_count_for_ammo_type(@current_user) %>
</span>
<h3 class="title text-lg">
<%= gettext("Total rounds shot:") %>
</h3>
<span class="text-primary-600">
<%= @ammo_type |> Ammo.get_used_count_for_ammo_type(@current_user) %>
</span>
<%= if @avg_cost_per_round do %>
<h3 class="title text-lg">
<%= gettext("Average Price paid") %>: