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

28 lines
746 B
Plaintext

%nav.region_selector
-# Display the currently selected region
%h3
- if params[:region] && params[:region] != 'all'
%em.locality.fa.fa-shield
= Region.find params[:region]
%em.fa.fa-chevron-down
- else
%span.placeholder
%em.locality.fa.fa-globe
=t '.all_regions'
%em.fa.fa-chevron-down
-# Choose a region to filter events with
%ul
%li
= link_to t('.all_regions'), region: nil,
start_date: params[:start_date],
year: params[:year],
tag: params[:tag]
- Region.pluck(:id, :name).each do |id, name|
%li
= link_to name, region: id,
start_date: params[:start_date],
year: params[:year],
tag: params[:tag]