diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-29 16:26:31 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-30 19:22:24 +0200 |
| commit | 4705ef970469a852c7bdb4c097ba748e972c8f63 (patch) | |
| tree | 2ff4d47196291b1a5ed1e721a302e89a821d67be /app/views/custom | |
| parent | 4dd49b1eebb0a99d3aee66b7eca539c87a9c6332 (diff) | |
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.
Diffstat (limited to 'app/views/custom')
| -rw-r--r-- | app/views/custom/page_templates/public/chapter_detail.html.erb | 23 |
1 files changed, 23 insertions, 0 deletions
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 @@ | |||
| 1 | <div class="article" lang="<%= @page.effective_lang %>"> | ||
| 2 | <h2 class="headline"><%= @page.title %></h2> | ||
| 3 | <% if @page.node.external_url.present? %> | ||
| 4 | <div class="chapter_url"><%= link_to @page.node.external_url, @page.node.external_url, target: '_blank', rel: 'noopener' %></div> | ||
| 5 | <% end %> | ||
| 6 | <p><%= sanitize(@page.abstract) %></p> | ||
| 7 | <%= aggregate?(@page.body) %> | ||
| 8 | <% if @page.node.events.any? %> | ||
| 9 | <div class="chapter_events"> | ||
| 10 | <h3>Events</h3> | ||
| 11 | <ul> | ||
| 12 | <% @page.node.events.order(:start_time).each do |event| %> | ||
| 13 | <li> | ||
| 14 | <span class="event_title"><%= event.display_title %></span> | ||
| 15 | <% if event.rrule.present? %> | ||
| 16 | <span class="event_rrule"><%= event.rrule %></span> | ||
| 17 | <% end %> | ||
| 18 | </li> | ||
| 19 | <% end %> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | <% end %> | ||
| 23 | </div> | ||
