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

45 lines
1.4 KiB
Plaintext
Raw Normal View History

%form.region_selector
- if (params[:month])
= hidden_field_tag :month, params[:month]
- if (params[:year])
= hidden_field_tag :year, params[:year]
= label_tag :region, Region.model_name.human
= select_tag :region,
options_from_collection_for_select(Region.all, 'id', 'name', params[:region]),
2013-12-29 20:42:00 +01:00
prompt: t('.all_regions')
2013-12-29 17:45:53 +01:00
- if (params[:year] and !params[:month])
-# Whole year calendar
%h2
- params[:year] ||= Date.today.year
= link_to '<<', "?year=#{params[:year].to_i-1}"
= params[:year]
= link_to '>>', "?year=#{params[:year].to_i+1}"
- (1..12).each do |i|
- params[:month] = i
= calendar @events, { prev_text: '', next_text: '', start_day: :monday,
2013-12-29 20:42:00 +01:00
params: { region: params[:region], tag: params[:tag] } } do |event|
2013-12-29 17:45:53 +01:00
%ul.events
%li.event
2013-12-29 20:42:00 +01:00
= link_to event do
%strong= event.city.gsub('-', ' ')
2013-12-29 17:45:53 +01:00
= event.title
- else
= calendar @events, { prev_text: '<<', next_text: '>>', start_day: :monday,
2013-12-29 20:42:00 +01:00
params: { region: params[:region], tag: params[:tag] } } do |event|
2013-12-29 17:45:53 +01:00
%ul.events
%li.event
2013-12-29 20:42:00 +01:00
= link_to event do
%strong= event.city.gsub('-', ' ')
2013-12-29 17:45:53 +01:00
= event.title
2013-12-28 23:45:13 +01:00
.formats
=t '.calendar_in'
2014-01-05 22:10:11 +01:00
= link_to('rss', events_url(:rss, tag: params[:tag]))+','
= link_to 'iCal', events_url(:rss, tag: params[:tag])
2014-01-02 00:21:49 +01:00
ou
2014-01-05 22:10:11 +01:00
= link_to 'calendrier Google', events_url(:rss, tag: params[:tag])