summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/views/custom/page_templates/public/chapter_detail.html.erb23
-rw-r--r--db/seeds/chapters.rb1
2 files changed, 24 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>
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:,
34 34
35 # Set up draft with German translation 35 # Set up draft with German translation
36 draft = node.draft 36 draft = node.draft
37 draft.template_name = 'chapter_detail'
37 I18n.with_locale(:de) do 38 I18n.with_locale(:de) do
38 draft.title = title_de 39 draft.title = title_de
39 draft.abstract = location || "" 40 draft.abstract = location || ""