2014-08-16 23:35:22 +02:00
|
|
|
= render '/lugs/search'
|
2014-10-19 00:40:22 +02:00
|
|
|
= render '/regions/selector'
|
2014-08-16 12:35:51 +02:00
|
|
|
|
2014-06-27 00:52:47 +02:00
|
|
|
- if params[:year]
|
2013-12-29 17:45:53 +01:00
|
|
|
-# Whole year calendar
|
2014-08-09 18:59:11 +02:00
|
|
|
- @events = @events.year params[:year].to_i
|
2014-06-27 00:52:47 +02:00
|
|
|
%header.calendar-header.year
|
2014-12-28 16:54:58 +01:00
|
|
|
= link_to '<<', year: params[:year].to_i - 1, tag: params[:tag],
|
|
|
|
region: params[:region]
|
2013-12-29 17:45:53 +01:00
|
|
|
= params[:year]
|
2014-12-28 16:54:58 +01:00
|
|
|
= link_to '>>', year: params[:year].to_i + 1, tag: params[:tag],
|
|
|
|
region: params[:region]
|
2013-12-29 17:45:53 +01:00
|
|
|
|
|
|
|
- (1..12).each do |i|
|
2014-06-27 00:52:47 +02:00
|
|
|
- params[:start_date] = "#{params[:year]}-#{i}-01"
|
2013-12-29 17:45:53 +01:00
|
|
|
|
2014-09-05 22:15:38 +02:00
|
|
|
= month_calendar day_names: 'date.day_names', events: @events,
|
2014-08-09 18:59:11 +02:00
|
|
|
previous_link: nil, next_link: nil,
|
|
|
|
title: ->(start_date) { raw link_to l(start_date, format: :month),
|
2014-12-28 16:54:58 +01:00
|
|
|
root_path(start_date: start_date),
|
|
|
|
class: 'month_selector' } do |date, events|
|
2014-06-27 00:52:47 +02:00
|
|
|
.day_number= date.day
|
2014-09-28 12:53:17 +02:00
|
|
|
%ul.events.fa-ul
|
2014-08-31 16:43:15 +02:00
|
|
|
- events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
|
2014-08-16 23:35:22 +02:00
|
|
|
- .sort_by { |e| e.city }.each do |event|
|
2014-12-28 16:54:58 +01:00
|
|
|
%li.event{ title: display_date(event) }
|
2014-09-28 12:53:17 +02:00
|
|
|
- if event.locality?
|
2014-12-28 16:54:58 +01:00
|
|
|
%em.locality.fa.fa-globe
|
2014-06-27 00:52:47 +02:00
|
|
|
= link_to event do
|
2014-12-28 16:54:58 +01:00
|
|
|
%strong.city{ title: event.address }= event.city
|
2014-06-27 00:52:47 +02:00
|
|
|
= event.title
|
|
|
|
|
|
|
|
- else
|
2014-08-09 18:59:11 +02:00
|
|
|
-# One month calendar
|
|
|
|
- @events = @events.month params[:start_date].try :to_date
|
2014-09-05 22:15:38 +02:00
|
|
|
= month_calendar day_names: 'date.day_names', events: @events,
|
2014-08-09 18:59:11 +02:00
|
|
|
title: ->(start_date) { raw "#{I18n.t('date.month_names')[start_date.month]} #{link_to start_date.year,
|
2014-10-31 14:33:39 +01:00
|
|
|
root_path(year: start_date.year)}" },
|
2014-08-09 18:59:11 +02:00
|
|
|
previous_link: ->(param, date_range) { link_to '<<',
|
2014-12-28 16:54:58 +01:00
|
|
|
{ param => (date_range.first - 1.day).beginning_of_month,
|
|
|
|
tag: params[:tag], region: params[:region] } },
|
2014-08-09 18:59:11 +02:00
|
|
|
next_link: ->(param, date_range) { link_to '>>',
|
2014-12-28 16:54:58 +01:00
|
|
|
{ param => (date_range.last + 1.day).beginning_of_month,
|
|
|
|
tag: params[:tag], region: params[:region] } } do |date, events|
|
2014-06-27 00:52:47 +02:00
|
|
|
.day_number= date.day
|
2014-09-27 13:06:11 +02:00
|
|
|
%ul.events.fa-ul
|
2014-08-31 16:43:15 +02:00
|
|
|
- events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
|
2014-08-16 23:35:22 +02:00
|
|
|
- .sort_by { |e| e.city }.each do |event|
|
2014-12-28 16:54:58 +01:00
|
|
|
%li.event{ title: display_date(event) }
|
2014-09-27 13:06:11 +02:00
|
|
|
- if event.locality?
|
2014-12-28 16:54:58 +01:00
|
|
|
%em.locality.fa.fa-globe
|
2013-12-29 20:42:00 +01:00
|
|
|
= link_to event do
|
2014-12-28 16:54:58 +01:00
|
|
|
%strong.city{ title: event.address }= event.city
|
2013-12-29 17:45:53 +01:00
|
|
|
= event.title
|
|
|
|
|
2014-08-16 23:19:03 +02:00
|
|
|
.formats
|
|
|
|
%em.fa.fa-rss
|
2014-12-28 16:54:58 +01:00
|
|
|
= raw t '.calendar_in',
|
2014-10-31 14:33:39 +01:00
|
|
|
rss: link_to('RSS', events_path(:rss,
|
2014-08-16 23:19:03 +02:00
|
|
|
tag: params[:tag], region: params[:region])),
|
2014-10-31 14:33:39 +01:00
|
|
|
webcal: link_to('webcal', events_path(:rss,
|
2014-12-28 16:54:58 +01:00
|
|
|
tag: params[:tag], protocol: 'webcal', format: :ics, tag: params[:tag],
|
|
|
|
region: params[:region])),
|
2014-10-31 14:33:39 +01:00
|
|
|
ical: link_to('iCal', events_path(:rss,
|
2014-12-28 16:54:58 +01:00
|
|
|
tag: params[:tag], format: :ics, tag: params[:tag],
|
|
|
|
region: params[:region]))
|
2014-07-29 00:00:13 +02:00
|
|
|
|
2014-08-16 23:19:03 +02:00
|
|
|
%a#banner(href='http://april.org/campagne')
|
2014-12-28 16:54:58 +01:00
|
|
|
-# %img(src='http://www.april.org/campagne/images/priorite-logiciel-libre-je-soutiens-april.png'
|
2014-08-16 23:19:03 +02:00
|
|
|
width='580' height='76' alt='Priorité au Logiciel Libre! Je soutiens l\'April.')
|
|
|
|
= image_tag 'priorite-logiciel-libre-je-soutiens-april_2_m.png',
|
|
|
|
width: '374', height: '48',
|
|
|
|
alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.'
|
2014-08-09 18:59:11 +02:00
|
|
|
|
|
|
|
- set_events_meta
|