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

76 lines
3.0 KiB
Plaintext
Raw Normal View History

2015-02-15 17:10:17 +01:00
= render '/orgas/search'
= render '/regions/selector'
- if params[:year]
2013-12-29 17:45:53 +01:00
-# Whole year calendar
- @events = @events.year params[:year].to_i
%header.calendar-header.year
= link_to '<<', year: params[:year].to_i - 1, tag: params[:tag],
region: params[:region]
2013-12-29 17:45:53 +01:00
= params[:year]
= 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|
- 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,
previous_link: nil, next_link: nil,
title: ->(start_date) { raw link_to l(start_date, format: :month),
root_path(start_date: start_date),
class: 'month_selector' } do |date, events|
.day_number= date.day
%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|
%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].try :to_date
2014-09-05 22:15:38 +02:00
= month_calendar day_names: 'date.day_names', events: @events,
title: ->(start_date) { raw "#{I18n.t('date.month_names')[start_date.month]} #{link_to start_date.year,
root_path(year: start_date.year)}" },
previous_link: ->(param, date_range) { link_to '<<',
{ param => (date_range.first - 1.day).beginning_of_month,
tag: params[:tag], region: params[:region] } },
next_link: ->(param, date_range) { link_to '>>',
{ param => (date_range.last + 1.day).beginning_of_month,
tag: params[:tag], region: params[:region] } } do |date, events|
.day_number= date.day
%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|
%li.event{ title: display_date(event) }
- if event.locality?
%em.locality.fa.fa-globe
2013-12-29 20:42:00 +01:00
= link_to event do
%strong.city{ title: event.address }= event.city
2013-12-29 17:45:53 +01:00
= 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(:rss,
tag: params[:tag], protocol: 'webcal', format: :ics, tag: params[:tag],
region: params[:region])),
ical: link_to('iCal', events_path(:rss,
tag: params[:tag], format: :ics, tag: params[:tag],
region: params[:region]))
%a#banner(href='http://april.org/campagne')
-# %img(src='http://www.april.org/campagne/images/priorite-logiciel-libre-je-soutiens-april.png'
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.'
- set_events_meta