Multi day events and prev/next header links

rails5
echarp 6 years ago
parent bc81a2fb9c
commit 414f2ab488
  1. 17
      app/views/events/index.html.haml

@ -12,6 +12,11 @@
= link_to year: params[:year].to_i + 1, tag: params[:tag],
region: params[:region] do
%em.fa.fa-forward
:ruby
set_meta_tags(
prev: url_for(year: params[:year].to_i - 1),
next: url_for(year: params[:year].to_i + 1)
)
- (1..12).each do |i|
- params[:start_date] = "#{params[:year]}-#{i}-01"
@ -23,11 +28,17 @@
- else
-# One month calendar
- @events = @events.month params[:start_date] ||= Time.zone.today
= month_calendar do |date|
- params[:start_date] ||= Time.zone.today.beginning_of_month
:ruby
set_meta_tags(
prev: url_for(start_date: params[:start_date].to_date - 1.month),
next: url_for(start_date: params[:start_date].to_date + 1.month)
)
- @events = @events.month params[:start_date]
= month_calendar events: @events do |date, events|
- capture_haml do
.day_number= date.day
%ul.events.fa-ul= render month_events(@events, date)
%ul.events.fa-ul= render events
.formats
%em.fa.fa-rss

Loading…
Cancel
Save