From a6e99e0912f328d9071bfcb7c6d7b183af8900dd Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 31 Mar 2025 14:58:06 -0500 Subject: [PATCH] Blank slates, page title, and clearer collections --- app/views/bubbles/index.html.erb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/views/bubbles/index.html.erb b/app/views/bubbles/index.html.erb index 8330554e3..f14cd107e 100644 --- a/app/views/bubbles/index.html.erb +++ b/app/views/bubbles/index.html.erb @@ -19,7 +19,7 @@ <% elsif @filter.buckets.one? %> <%= @filter.buckets.first.name %> <% else %> - <%= pluralize(@filter.buckets.size, "project") %> + <%= @filter.buckets.map(&:name).to_sentence %> <% end %> <%= render "bubbles/filters", filter: @filter %> @@ -47,16 +47,20 @@

Considering

- <%= render partial: "bubbles/card_mini", collection: @bubbles.where(stage: [@filter.buckets.first&.workflow&.stages&.first, nil]), as: :bubble, cached: true %> + <% if (unstaged_bubbles = @bubbles.where(stage: nil)).any? %> + <%= render partial: "bubbles/card_mini", collection: unstaged_bubbles, as: :bubble, cached: true %> + <% else %> +

Nothing here

+ <% end %>

Doing

- <% if @bubbles.any? %> - <%= render partial: "bubbles/card", collection: @bubbles.where.not(stage: @filter.buckets.first&.workflow&.stages&.first), as: :bubble, cached: true %> + <% if (staged_bubbles = @bubbles.where.not(stage: nil)).any? %> + <%= render partial: "bubbles/card", collection: staged_bubbles, as: :bubble, cached: true %> <% else %> -

Nothing here.

+

Nothing here

<% end %>
@@ -69,7 +73,7 @@ <% if (popped_bubbles = Filter.from_params(@filter.as_params.merge(indexed_by: "popped")).tap { |f| f.creator = Current.user }.bubbles).any? %> <%= render partial: "bubbles/card", collection: popped_bubbles, as: :bubble, cached: true %> <% else %> -

Nothing here.

+

Nothing here

<% end %>