agenda-libre-ruby/app/views/events/index.html.haml

62 lines
2.1 KiB
Plaintext

= render '/orgas/search'
= render '/regions/selector'
- if params[:year]
-# Whole year calendar
- @events = @events.year params[:year]
%header.calendar-header.year
= link_to '<<', year: params[:year].to_i - 1, tag: params[:tag],
region: params[:region]
= params[:year]
= link_to '>>', year: params[:year].to_i + 1, tag: params[:tag],
region: params[:region]
- (1..12).each do |i|
- params[:start_date] = "#{params[:year]}-#{i}-01"
= month_calendar do |date|
- capture_haml do
.day_number= date.day
%ul.events.fa-ul
- @events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
- .sort_by { |e| e.city }.each do |event|
%li.event{ title: display_date(event) }
- if event.locality?
%em.locality.fa.fa-globe
= link_to event do
%strong.city{ title: event.address }= event.city
= event.title
- else
-# One month calendar
- @events = @events.month params[:start_date] ||= Time.zone.today
= month_calendar do |date|
- capture_haml do
.day_number= date.day
%ul.events.fa-ul
- @events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
- .sort_by { |e| e.city }.each do |event|
%li.event{ title: display_date(event) }
- if event.locality?
%em.locality.fa.fa-globe
= link_to event do
%strong.city{ title: event.address }= event.city
= event.title
.formats
%em.fa.fa-rss
= raw t '.calendar_in',
rss: link_to('RSS', events_path(:rss,
tag: params[:tag], region: params[:region])),
webcal: link_to('webcal', events_path(tag: params[:tag],
protocol: 'webcal', format: :ics, region: params[:region])),
ical: link_to('iCal', events_path(:rss,
tag: params[:tag], format: :ics, region: params[:region]))
%a#banner(href='http://april.org/campagne')
= image_tag 'priorite-logiciel-libre-je-soutiens-april_2_m.png',
width: '374', height: '48',
alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.'
- set_events_meta