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 ++++++++++++++++++++++ db/seeds/chapters.rb | 1 + 2 files changed, 24 insertions(+) create mode 100644 app/views/custom/page_templates/public/chapter_detail.html.erb 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 0000000..71352d3 --- /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 %> +
diff --git a/db/seeds/chapters.rb b/db/seeds/chapters.rb index cb48894..8584acd 100644 --- a/db/seeds/chapters.rb +++ b/db/seeds/chapters.rb @@ -34,6 +34,7 @@ def seed_chapter(parent_id:, slug:, tag:, title_de:, description_de:, # Set up draft with German translation draft = node.draft + draft.template_name = 'chapter_detail' I18n.with_locale(:de) do draft.title = title_de draft.abstract = location || "" -- cgit v1.3