diff --git a/app/views/letter/batches/_batches_collection.html.erb b/app/views/letter/batches/_batches_collection.html.erb index 2ec5733..c9dd840 100644 --- a/app/views/letter/batches/_batches_collection.html.erb +++ b/app/views/letter/batches/_batches_collection.html.erb @@ -15,6 +15,17 @@
Tags: <%= render 'shared/tags', tags: batch.tags %>
+ <% state_counts = batch.letters.group(:aasm_state).count %> + <% if state_counts.any? %> +
+ <% %w[pending printed mailed received].each do |state| %> + <% count = state_counts[state] || 0 %> + <% if count > 0 %> + <%= count %> <%= state %> + <% end %> + <% end %> +
+ <% end %>
<%= link_to letter_batch_path(batch), class: "btn btn-sm btn-icon", title: "View batch details" do %>