diff options
Diffstat (limited to 'app/views/custom')
| -rw-r--r-- | app/views/custom/page_templates/public/chapter_detail.html.erb | 33 | ||||
| -rw-r--r-- | app/views/custom/partials/_chapter.html.erb | 19 |
2 files changed, 52 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..f47353c --- /dev/null +++ b/app/views/custom/page_templates/public/chapter_detail.html.erb | |||
| @@ -0,0 +1,33 @@ | |||
| 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 | <% open_days = @page.node.events.tagged_with('open-day').order(:start_time) %> | ||
| 9 | <% other_events = @page.node.events.where.not(id: open_days.map(&:id)).order(:start_time) %> | ||
| 10 | <% if open_days.any? %> | ||
| 11 | <div class="chapter_events open_days"> | ||
| 12 | <h3><%= t(:open_days) %></h3> | ||
| 13 | <ul> | ||
| 14 | <% open_days.each do |event| %> | ||
| 15 | <li><%= event_schedule_text(event) %></li> | ||
| 16 | <% end %> | ||
| 17 | </ul> | ||
| 18 | </div> | ||
| 19 | <% end %> | ||
| 20 | <% if other_events.any? %> | ||
| 21 | <div class="chapter_events"> | ||
| 22 | <h3><%= t(:upcoming_events) %></h3> | ||
| 23 | <ul> | ||
| 24 | <% other_events.each do |event| %> | ||
| 25 | <li> | ||
| 26 | <span class="event_title"><%= event.display_title %></span> | ||
| 27 | <span class="event_schedule"><%= event_schedule_text(event) %></span> | ||
| 28 | </li> | ||
| 29 | <% end %> | ||
| 30 | </ul> | ||
| 31 | </div> | ||
| 32 | <% end %> | ||
| 33 | </div> | ||
diff --git a/app/views/custom/partials/_chapter.html.erb b/app/views/custom/partials/_chapter.html.erb new file mode 100644 index 0000000..805559b --- /dev/null +++ b/app/views/custom/partials/_chapter.html.erb | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | <div class="article_partial chapter_partial" lang="<%= page.effective_lang %>"> | ||
| 2 | <h2 class="headline"><%= link_to_path page.title, page.node.unique_name %></h2> | ||
| 3 | <% if page.abstract.present? %> | ||
| 4 | <div class="chapter_location"><%= page.abstract %></div> | ||
| 5 | <% end %> | ||
| 6 | <% if page.node.external_url.present? %> | ||
| 7 | <div class="chapter_url"><%= link_to page.node.external_url, page.node.external_url, target: '_blank', rel: 'noopener' %></div> | ||
| 8 | <% end %> | ||
| 9 | <% open_days = page.node.events.tagged_with('open-day').order(:start_time) %> | ||
| 10 | <% if open_days.any? %> | ||
| 11 | <div class="chapter_open_days"> | ||
| 12 | <span class="open_days_label"><%= t(:open_days_label) %>: </span> | ||
| 13 | <% open_days.each do |event| %> | ||
| 14 | <span class="event_schedule"><%= event_schedule_text(event) %></span> | ||
| 15 | <% end %> | ||
| 16 | </div> | ||
| 17 | <% end %> | ||
| 18 | <p class="excerpt"><%= sanitize page.body %></p> | ||
| 19 | </div> | ||
