From 4705ef970469a852c7bdb4c097ba748e972c8f63 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Mon, 29 Jun 2026 16:26:31 +0200 Subject: Add chapter_detail template with events and external URL rendering New public page template for erfa and chaostreff nodes. Renders the node's external_url and lists associated events below the page content. Seed script updated to set template_name: 'chapter_detail' on all chapter drafts so the template is applied on publish. --- .../page_templates/public/chapter_detail.html.erb | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/views/custom/page_templates/public/chapter_detail.html.erb (limited to 'app/views/custom/page_templates') diff --git a/app/views/custom/page_templates/public/chapter_detail.html.erb b/app/views/custom/page_templates/public/chapter_detail.html.erb new file mode 100644 index 00000000..71352d33 --- /dev/null +++ b/app/views/custom/page_templates/public/chapter_detail.html.erb @@ -0,0 +1,23 @@ +
+

<%= @page.title %>

+ <% if @page.node.external_url.present? %> +
<%= link_to @page.node.external_url, @page.node.external_url, target: '_blank', rel: 'noopener' %>
+ <% end %> +

<%= sanitize(@page.abstract) %>

+ <%= aggregate?(@page.body) %> + <% if @page.node.events.any? %> +
+

Events

+
    + <% @page.node.events.order(:start_time).each do |event| %> +
  • + <%= event.display_title %> + <% if event.rrule.present? %> + <%= event.rrule %> + <% end %> +
  • + <% end %> +
+
+ <% end %> +
-- cgit v1.3 From f7c3bf9e6869331be0c33c0cd24246c592bf0dff Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 2 Jul 2026 00:12:30 +0200 Subject: Rewrite chapter_detail template with humanized event schedule - Split events into open-day tagged events (prominent, via tagged_with) and other events (secondary listing) - Use event_schedule_text helper for humanized recurrence + start time rather than raw rrule string - Section headings via i18n open_days / upcoming_events keys --- .../page_templates/public/chapter_detail.html.erb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'app/views/custom/page_templates') diff --git a/app/views/custom/page_templates/public/chapter_detail.html.erb b/app/views/custom/page_templates/public/chapter_detail.html.erb index 71352d33..f47353c4 100644 --- a/app/views/custom/page_templates/public/chapter_detail.html.erb +++ b/app/views/custom/page_templates/public/chapter_detail.html.erb @@ -5,16 +5,26 @@ <% end %>

<%= sanitize(@page.abstract) %>

<%= aggregate?(@page.body) %> - <% if @page.node.events.any? %> + <% open_days = @page.node.events.tagged_with('open-day').order(:start_time) %> + <% other_events = @page.node.events.where.not(id: open_days.map(&:id)).order(:start_time) %> + <% if open_days.any? %> +
+

<%= t(:open_days) %>

+
    + <% open_days.each do |event| %> +
  • <%= event_schedule_text(event) %>
  • + <% end %> +
+
+ <% end %> + <% if other_events.any? %>
-

Events

+

<%= t(:upcoming_events) %>

    - <% @page.node.events.order(:start_time).each do |event| %> + <% other_events.each do |event| %>
  • <%= event.display_title %> - <% if event.rrule.present? %> - <%= event.rrule %> - <% end %> + <%= event_schedule_text(event) %>
  • <% end %>
-- cgit v1.3