Files
fizzy/app/views/bubbles/index.html.erb
T
2024-11-05 13:04:05 -06:00

46 lines
1.9 KiB
Plaintext

<% @page_title = @filter.plain_summary %>
<% content_for :header do %>
<nav>
<%= link_to root_path, class: "btn btn--plain flex-item-justify-start" do %>
<%= image_tag "bubbles.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">All Projects</span>
<% end %>
<header class="txt-align-center">
<%= render "bubbles/filters", filter: @filter %>
</header>
<% if @filter.buckets.any? %>
<%= button_to bucket_bubbles_path(@filter.buckets.first), method: :post, class: "btn btn--plain", form_class: "flex-item-justify-end" do %>
<%= image_tag "bubble-add.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Create a new bubble</span>
<% end %>
<% else %>
<span class="flex-item-justify-end" style="height: var(--btn-size); width: var(--btn-size);">
<%# FIXME: This is a placeholder to keep the same layout without a "new bubble" button %>
</span>
<% end %>
</nav>
<% end %>
<section class="windshield flex-inline flex-wrap gap justify-center align-end" style="view-transition-name: windshield_<%= params[:filter_id] %>">
<% if @bubbles.any? %>
<%= render partial: "bubbles/bubble", collection: @bubbles.limit(10), cached: true %>
<% else %>
<p><strong>Nothing here.</strong></p>
<% end %>
</section>
<section class="bubbles-list unpad-inline center margin-block-start">
<header class="flex-inline align-center gap txt-small margin-block-end-half center">
<%= form_tag bubbles_path(@filter.to_params), method: :get do %>
<%= search_field_tag :term, params[:term], class: "input center flex-inline", placeholder: "Type to filter…" %>
<% end %>
</header>
<ul class="unpad margin-none flex flex-column txt-align-start center">
<%= render partial: "bubbles/list/bubble", collection: @bubbles, cached: true %>
</ul>
</section>