diff options
| -rw-r--r-- | app/views/custom/page_templates/public/chapter_detail.html.erb | 22 |
1 files changed, 16 insertions, 6 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 index 71352d3..f47353c 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 @@ | |||
| 5 | <% end %> | 5 | <% end %> |
| 6 | <p><%= sanitize(@page.abstract) %></p> | 6 | <p><%= sanitize(@page.abstract) %></p> |
| 7 | <%= aggregate?(@page.body) %> | 7 | <%= aggregate?(@page.body) %> |
| 8 | <% if @page.node.events.any? %> | 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? %> | ||
| 9 | <div class="chapter_events"> | 21 | <div class="chapter_events"> |
| 10 | <h3>Events</h3> | 22 | <h3><%= t(:upcoming_events) %></h3> |
| 11 | <ul> | 23 | <ul> |
| 12 | <% @page.node.events.order(:start_time).each do |event| %> | 24 | <% other_events.each do |event| %> |
| 13 | <li> | 25 | <li> |
| 14 | <span class="event_title"><%= event.display_title %></span> | 26 | <span class="event_title"><%= event.display_title %></span> |
| 15 | <% if event.rrule.present? %> | 27 | <span class="event_schedule"><%= event_schedule_text(event) %></span> |
| 16 | <span class="event_rrule"><%= event.rrule %></span> | ||
| 17 | <% end %> | ||
| 18 | </li> | 28 | </li> |
| 19 | <% end %> | 29 | <% end %> |
| 20 | </ul> | 30 | </ul> |
