Default registrants to active; show counts and event date#1590
Conversation
| scope = scope.keyword(params[:keyword]) if params[:keyword].present? | ||
| scope = scope.attendance_status(params[:attendance_status]) if params[:attendance_status].present? | ||
|
|
||
| @active_count = scope.active.count |
There was a problem hiding this comment.
Counts are computed from the keyword-filtered scope before the active/inactive grouping is applied, so both tab counts always reflect the current search rather than only the visible tab.
| scope = scope.attendance_status(params[:attendance_status]) | ||
| else | ||
| @status_filter = params[:status_filter].presence || "active" | ||
| scope = scope.inactive if @status_filter == "inactive" |
There was a problem hiding this comment.
An explicit attendance_status takes precedence over the active/inactive default, preserving the existing dropdown drill-down. Absent that param, we default to the active filter.
| <nav class="inline-flex rounded-lg bg-gray-100 p-0.5 text-sm font-medium" aria-label="Attendance filter"> | ||
| <%= link_to manage_event_path(@event, status_filter: "active", keyword: params[:keyword].presence), | ||
| data: { turbo_frame: "_top" }, | ||
| class: "px-3 py-1 rounded-md transition-colors #{current_filter == "active" ? "bg-white text-gray-800 shadow-sm" : "text-gray-500 hover:text-gray-700"}" do %> |
There was a problem hiding this comment.
Tabs use turbo_frame: "_top" (full-page nav) intentionally: the search form lives outside the manage_results frame, so a frame-only swap would leave the form's hidden status_filter stale and out of sync with the visible tab.
| autocomplete: "off", | ||
| class: "flex flex-col md:flex-row md:flex-wrap md:items-end gap-4 mb-6" do %> | ||
|
|
||
| <%= hidden_field_tag :status_filter, params[:status_filter].presence || "active" %> |
There was a problem hiding this comment.
Hidden field keeps the selected tab when the keyword/status search form is submitted (which updates only the results frame).
Admins managing an event need to focus on people who are actually coming. Showing cancelled/no-show registrants by default buries the active roster, so the list now defaults to the active filter and surfaces both counts as tabs to switch between them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Admins land on the registrants page to gauge turnout, so the heading now carries the active count (matching the active tab default) and the event's date range sits beside the title, sparing a trip back to the dashboard to confirm which event and when. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5f8018f to
af580c5
Compare
The registrants table was cramped: long column headers ate horizontal space and organization names were truncated to 10 chars with no way to reach the org. Shorten the headers, give the org column room and link each org to its page, and keep payment badges on one line. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
"Reason you're making a note" reads awkwardly; "Reason for this note" is tighter and matches the surrounding microcopy tone. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What is the goal of this PR and why is this important?
How did you approach the change?
Active/inactive filtering
inactivescope toEventRegistration(mirrors the existingactivescope; reusesINACTIVE_STATUSES=cancelled,no_show).EventsController#registrantsnow computes@active_count/@inactive_countfrom the filtered base scope (so counts reflect the current search/filters) and defaults to the active filter when nostatus_filterparam is given.attendance_statusselection still takes precedence over the active/inactive grouping, preserving the dashboard drill-down behavior.status_filterfield stays in sync.Page context
Registrants (N)— and the event'sdate_range(the same decorator method the dashboard uses) appears beside the title.Table layout & copy polish
w-full) and raised its truncation so org names are readable; trimmed the oversized Name column to compensate.organization_path).whitespace-nowrap) so "$N due" doesn't wrap.UI Testing Checklist
Registrants (N)with the active count, plus event title + date rangeAnything else to add?
main, which renamed themanageaction/route/partials toregistrantsand split the dev seeds intodb/seeds/dev/*; conflicts resolved to keep both main's new filters and this branch's active/inactive logic.attendance_statusprecedence, the heading count, and the event date.date_rangeis weekday-prefixed (e.g. "Tue, Jun 2, 2026") to match the dashboard; flagging in case a bare date is preferred.🤖 Generated with Claude Code