You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
agenda-libre-ruby/app/views/regions/_filter.haml

34 lines
1.0 KiB

-# Choose a region to filter events with
%ul.regions
%li#near-me{ class: ('selected' if (params[:near] && params[:near][:location]).present?) }
- if (params[:near] && params[:near][:location]).present?
%a(href="?near=")
%em.fa.fa-map-pin
= params[:near][:location]
- if params[:near][:distance].present?
%em.fa.fa-arrows-alt-h
= params[:near][:distance]
km
%em.fa.fa-times
- else
%a.near-me(href="?near[distance]=1&near[location]=[me]")
%em.fa.fa-street-view
= t '.nearMe'
%ul.near-me
%li
%a.near-me(href="?near[distance]=10&near[location]=[me]")
%em.fa.fa-arrows-alt-h
10km
%li
%a.near-me(href="?near[distance]=100&near[location]=[me]")
%em.fa.fa-arrows-alt-h
100km
%li
%a.near-me(href="?near[distance]=1000&near[location]=[me]")
%em.fa.fa-arrows-alt-h
1000km
= render partial: '/regions/filter_region', collection: Region.top