agenda-libre-ruby/app/views/regions/_selector.haml

41 lines
1.0 KiB
Plaintext
Raw Normal View History

2014-08-16 16:04:42 +02:00
%nav.region_selector
-# Display the currently selected region
%h3
- if params[:region] && params[:region] != 'all'
%em.locality.fa.fa-shield
2014-08-16 16:04:42 +02:00
= Region.find params[:region]
%em.fa.fa-chevron-down
- elsif params[:locality]
%span.placeholder
%em.locality.fa.fa-globe
=t '.national'
%em.fa.fa-chevron-down
2014-08-16 16:04:42 +02:00
- else
%span.placeholder
%em.locality.fa.fa-globe
2014-08-16 16:04:42 +02:00
=t '.all_regions'
%em.fa.fa-chevron-down
2014-08-16 16:04:42 +02:00
-# Choose a region to filter events with
%ul
%li
2014-08-16 16:04:42 +02:00
= link_to t('.all_regions'), region: nil,
start_date: params[:start_date],
year: params[:year],
tag: params[:tag]
2014-08-16 16:04:42 +02:00
2014-08-25 17:55:14 +02:00
- Region.pluck(:id, :name).each do |id, name|
2014-08-16 16:04:42 +02:00
%li
2014-08-25 17:55:14 +02:00
= link_to name, region: id,
2014-08-16 16:04:42 +02:00
start_date: params[:start_date],
year: params[:year],
tag: params[:tag]
%li
= link_to locality: 1,
start_date: params[:start_date],
year: params[:year],
tag: params[:tag] do
%em.fa.fa-globe
=t '.national'