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

59 lines
1.8 KiB
Plaintext
Raw Normal View History

2020-04-05 17:13:37 +02:00
%h2.warning= t '.warning'
2019-06-16 17:08:56 +02:00
- unless params[:year] || params[:start_date] || params[:iframe]
= render '/maps/events'
- if params[:year]
%header.calendar-header.year
= link_to year: params[:year].to_i - 1 do
%em.fa.fa-backward
2013-12-29 17:45:53 +01:00
= params[:year]
= link_to year: params[:year].to_i + 1 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)
)
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
2015-09-12 15:31:31 +02:00
= month_calendar do |date|
- capture_haml do
.day_number= date.day
%ul.events.fa-ul= render month_events(@events, date)
2015-09-12 15:31:31 +02:00
- else
-# One month calendar
:ruby
params[:start_date] ||= Time.zone.today.beginning_of_month
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|
2015-09-12 15:31:31 +02:00
- capture_haml do
.day_number= date.day
2019-04-29 18:29:38 +02:00
%ul.events.fa-ul= render events
.links
= t '.calendar_in_html',
rss: link_to('RSS', events_path(:rss,
tag: params[:tag], region: session[:region])),
webcal: link_to('webcal', events_path(tag: params[:tag],
protocol: 'webcal', format: :ics, region: session[:region])),
ical: link_to('iCal', events_path(:rss,
tag: params[:tag], format: :ics, region: session[:region]))
2020-04-03 16:28:14 +02:00
%a#banner(href='https://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.'
2018-12-20 12:29:31 +01:00
2020-04-03 16:28:14 +02:00
/ %a#banner(href='https://www.libre-en-fete.net')
/ = image_tag 'lef.png', width: '486', height: '80', alt: 'Libre en Fete'
2019-06-25 22:39:57 +02:00
- events_meta