Skip to content

Commit 363731c

Browse files
zalepaclaude
andcommitted
Add collapsible sections to public meeting view
Sections on the public meeting page can now be collapsed/expanded with a click, matching the admin view behavior. State persists via localStorage using the existing collapsible Stimulus controller. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7a386ad commit 363731c

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

app/views/meetings/show.html.erb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@
4444

4545
<div class="space-y-6">
4646
<% @agenda_sections.each do |section| %>
47-
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
48-
<div class="px-6 py-4 bg-gray-50 border-b border-gray-200">
49-
<h2 class="font-semibold text-gray-900"><%= section.number %>. <%= section.title %></h2>
50-
<span class="text-xs text-gray-500"><%= section.agenda_items.size %> items</span>
51-
</div>
47+
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden" data-controller="collapsible" data-collapsible-key-value="meeting-<%= @meeting.id %>-section-<%= section.id %>">
48+
<button type="button" data-action="click->collapsible#toggle" class="w-full px-6 py-4 bg-gray-50 border-b border-gray-200 flex items-center justify-between cursor-pointer hover:bg-gray-100 transition-colors text-left">
49+
<div>
50+
<h2 class="font-semibold text-gray-900"><%= section.number %>. <%= section.title %></h2>
51+
<span class="text-xs text-gray-500"><%= section.agenda_items.size %> items</span>
52+
</div>
53+
<svg data-collapsible-target="icon" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400 transition-transform duration-200 flex-shrink-0 ml-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5">
54+
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" />
55+
</svg>
56+
</button>
5257

58+
<div data-collapsible-target="content">
5359
<% if section.agenda_items.any? %>
5460
<ul class="divide-y divide-gray-100">
5561
<% section.agenda_items.each do |item| %>
@@ -98,6 +104,7 @@
98104
<% end %>
99105
</ul>
100106
<% end %>
107+
</div>
101108
</div>
102109
<% end %>
103110
</div>

0 commit comments

Comments
 (0)