Skip to content

Add a CE hours detail section to the registration ticket#1710

Merged
maebeale merged 3 commits into
mainfrom
maebeale/ce-hours-detail-section
Jun 17, 2026
Merged

Add a CE hours detail section to the registration ticket#1710
maebeale merged 3 commits into
mainfrom
maebeale/ce-hours-detail-section

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

What is the goal of this PR and why is this important?

  • Continuing-education requirements (CAMFT approval, license-number and payment rules, sign-in instructions, post-training evaluation) used to be re-sent in a long confirmation email for every CE-eligible event.
  • This surfaces that info per event so admins keep the embedded links in one place instead of re-emailing.

How did you approach the change?

  • Mirrored the existing "Before you attend" feature: two new events columns (ce_hours_details HTML + ce_hours_details_label, default "CE hours"), an admin collapsible editor, a GET /events/:id/ce_hours sanitized-HTML details page, and a ticket call-out (indigo + graduation-cap, distinct from the amber "Before you attend" call-out).
  • The call-out and page only render when content is present; blank details redirect to the event. Added request specs covering the page and the admin form fields.

UI Testing Checklist

  • Edit an event → open the CE hours section, set a label and HTML content (with links), and save.
  • View a registration ticket for that event → the indigo CE hours call-out appears and links to the details page; embedded links work.
  • Clear the content → call-out and page disappear (visiting the URL redirects to the event).

Anything else to add?

  • Content is admin-entered per event (deadline/cost vary), sanitized to the same allowed tags as "Before you attend". No content is seeded.

Comment thread app/models/event.rb
@@ -156,6 +156,13 @@ def event_details_label
super.presence || "Before you attend"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Mirrors event_details_label — falls back to the default even when an admin clears the field, so the section never renders unlabelled.

<!-- CE hours (continuing education requirements, payment, sign-in rules) -->
<% if event_registration.event.ce_hours_details.present? %>
<%= link_to ce_hours_event_path(event_registration.event, reg: event_registration.slug),
class: "flex items-center gap-3 rounded-xl border-2 border-indigo-300 bg-indigo-50 px-4 py-3 hover:bg-indigo-100 transition-colors" do %>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Intentionally indigo + graduation-cap to distinguish this call-out from the amber "Before you attend" one directly above, so two stacked call-outs on a ticket read as different things.

maebeale and others added 2 commits June 17, 2026 14:32
CE requirements (CAMFT approval, license-number and payment rules,
sign-in, post-training evaluation) used to live in a long confirmation
email. Surface them per event the same way "Before you attend" works: a
ticket call-out linking to a sanitized-HTML details page, so admins can
keep the embedded links instead of re-sending an email each time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
So the CE hours feature has demoable data: mark Amy plus four other
registrants as CE-credit requested, and give both facilitator trainings
CE hours details so the ticket call-out actually surfaces. Make the
named-registration seed idempotent (find_or_initialize) so the CE flag
applies on re-seed instead of being skipped by the create-only guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maebeale maebeale force-pushed the maebeale/ce-hours-detail-section branch from 63715fe to 4fbfe94 Compare June 17, 2026 18:34
The new CE hours page sets content_for(:page_bg_class, "public") but
wasn't listed in EXPECTED_MAPPINGS, so the "every view is accounted for"
guard failed. ce_hours? aliases to show?, matching its sibling details
page, which is also "public".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maebeale maebeale merged commit 8d9e7d8 into main Jun 17, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/ce-hours-detail-section branch June 17, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant