From 6358cde1380a3e24f3f6ed2d1b247dbda48dee3b Mon Sep 17 00:00:00 2001 From: echarp Date: Fri, 31 Oct 2014 14:24:40 +0100 Subject: [PATCH] Ajout de liens vers geojson --- app/assets/javascripts/maps.js.coffee | 2 +- app/assets/stylesheets/all.css.sass | 3 +-- app/views/lugs/show.html.haml | 25 +++++++++++------- app/views/maps/index.html.haml | 13 +++++++++ app/views/regions/index.html.haml | 6 +++-- app/views/tags/show.html.haml | 38 ++++++++++++++++----------- config/locales/views/en.yml | 4 +-- config/locales/views/fr.yml | 4 +-- 8 files changed, 60 insertions(+), 35 deletions(-) diff --git a/app/assets/javascripts/maps.js.coffee b/app/assets/javascripts/maps.js.coffee index 09cc2b89..4c2fab22 100644 --- a/app/assets/javascripts/maps.js.coffee +++ b/app/assets/javascripts/maps.js.coffee @@ -7,7 +7,7 @@ $(document).ready -> ).addTo map url = $(this).data 'url' - if location.search && url.indexOf '?' + if location.search && url.indexOf('?') >= 0 url += '&' + location.search.substr 1 else url += location.search diff --git a/app/assets/stylesheets/all.css.sass b/app/assets/stylesheets/all.css.sass index cc7530bb..0dbbbeb5 100644 --- a/app/assets/stylesheets/all.css.sass +++ b/app/assets/stylesheets/all.css.sass @@ -231,8 +231,7 @@ footer.bottom nav clear: both a display: inline-block - padding: 2em 1% - padding-bottom: 0 + padding: 1.8% em.fa font-size: x-large &:hover diff --git a/app/views/lugs/show.html.haml b/app/views/lugs/show.html.haml index 0a6c1be5..0aea472a 100644 --- a/app/views/lugs/show.html.haml +++ b/app/views/lugs/show.html.haml @@ -11,17 +11,25 @@ %em.fa.fa-arrow-left = Lug.model_name.human.pluralize \/ + = link_to events_url tag: @lug.name do + %em.fa.fa-calendar + Agenda + \/ = link_to events_url format: :rss, tag: @lug.name do %em.fa.fa-rss - rss + RSS \/ = link_to events_url format: :ics, tag: @lug.name do %em.fa.fa-th-list - ical + iCal + \/ + = link_to maps_url tag: @lug.name do + %em.fa.fa-map-marker + OpenStreetMap \/ = link_to maps_url format: :json, tag: @lug.name do - %em.fa.fa-map-marker - geojson + %em.fa.fa-dot-circle-o + GeoJSON %dl - if @lug.city.present? @@ -45,6 +53,7 @@ %legend %em.fa.fa-calendar = Event.model_name.human.pluralize + - if @events_future.any? %h3=raw t 'future', count: @events_future.count %ul.fa-ul @@ -57,10 +66,7 @@ %em.locality.fa-li.fa.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}") %em.city= event.city = event.title - %br/ - = display_date event - - %hr/ + .date= display_date event - if @events_past.any? %h3=raw t 'past', count: @events_past.count @@ -74,7 +80,6 @@ %em.locality.fa-li.fa.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}") %em.city= event.city = event.title - %br/ - = display_date event + .date= display_date event #map.events(data-url="#{maps_path format: :json, tag: @lug.name}") diff --git a/app/views/maps/index.html.haml b/app/views/maps/index.html.haml index 7f359ff1..f17e0b42 100644 --- a/app/views/maps/index.html.haml +++ b/app/views/maps/index.html.haml @@ -3,3 +3,16 @@ =title t '.title' #map.events(data-url="#{maps_path format: :json}") + +%nav + = link_to events_url format: :rss, tag: params[:tag] do + %em.fa.fa-rss + RSS + \/ + = link_to events_url format: :ics, tag: params[:tag] do + %em.fa.fa-th-list + iCal + \/ + = link_to maps_url format: :json, tag: params[:tag] do + %em.fa.fa-dot-circle-o + GeoJSON diff --git a/app/views/regions/index.html.haml b/app/views/regions/index.html.haml index 989d8d7f..0500bd72 100644 --- a/app/views/regions/index.html.haml +++ b/app/views/regions/index.html.haml @@ -7,18 +7,20 @@ %table.list %thead %tr - %th=t :all, scope: 'activerecord.attributes.region.name_values' + %th= link_to t(:all, scope: 'activerecord.attributes.region.name_values'), root_path %th= link_to 'RSS', events_path(format: :rss, region: :all) %th= link_to :webcal, events_path(protocol: :webcal, format: :ics, region: :all, only_path: false) %th= link_to :iCal, events_path(format: :ics, region: :all, only_path: false) + %th= link_to :GeoJSON, maps_path(format: :json, region: :all, only_path: false) %tbody - @regions.find_each do |region| %tr - %td= region.name + %td= link_to region.name, events_path(region: region.id) %td= link_to 'RSS', events_path(format: :rss, region: region.id) %td= link_to :webcal, events_path(protocol: :webcal, format: :ics, region: region.id, only_path: false) %td= link_to :iCal, events_path(format: :ics, region: region.id, only_path: false) + %td= link_to :GeoJSON, maps_path(format: :json, region: region.id, only_path: false) :markdown #{t '.help', tag: events_path(format: :rss, tag: 'toulibre', only_path: false), daylimit: events_path(format: :ics, daylimit: '42', only_path: false)} diff --git a/app/views/tags/show.html.haml b/app/views/tags/show.html.haml index 74228f0c..3166aaab 100644 --- a/app/views/tags/show.html.haml +++ b/app/views/tags/show.html.haml @@ -9,17 +9,25 @@ %em.fa.fa-arrow-left = Event.human_attribute_name(:tag).pluralize \/ + = link_to events_url tag: params[:id] do + %em.fa.fa-calendar + Agenda + \/ = link_to events_url format: :rss, tag: params[:id] do %em.fa.fa-rss - rss + RSS \/ = link_to events_url format: :ics, tag: params[:id] do %em.fa.fa-th-list - ical + iCal + \/ + = link_to maps_url tag: params[:id] do + %em.fa.fa-map-marker + OpenStreetMap \/ = link_to maps_url format: :json, tag: params[:id] do - %em.fa.fa-map-marker - geojson + %em.fa.fa-dot-circle-o + GeoJSON - if @events_future.any? || @events_past.any? %fieldset @@ -31,29 +39,27 @@ %ul.fa-ul - @events_future.order('start_time asc').each do |event| %li - - if event.locality? - %em.locality.fa-li.fa.fa-globe(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_1'}") - - else - %em.locality.fa-li.fa.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}") = link_to event do + - if event.locality? + %em.locality.fa-li.fa.fa-globe(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_1'}") + - else + %em.locality.fa-li.fa.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}") %em.city= event.city = event.title - %br/ - = display_date event + .date= display_date event - if @events_past.any? %h3=raw t 'past', count: @events_past.count %ul.fa-ul - @events_past.order('start_time desc').each do |event| %li - - if event.locality? - %em.locality.fa-li.fa.fa-globe(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_1'}") - - else - %em.locality.fa-li.fa.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}") = link_to event do + - if event.locality? + %em.locality.fa-li.fa.fa-globe(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_1'}") + - else + %em.locality.fa-li.fa.fa-shield(title="#{Event.human_attribute_name :locality} #{t 'attributes.locality_0'}") %em.city= event.city = event.title - %br/ - = display_date event + .date= display_date event #map.events(data-url="#{maps_path format: :json, tag: params[:id]}") diff --git a/config/locales/views/en.yml b/config/locales/views/en.yml index dee0807f..ac3ecacb 100644 --- a/config/locales/views/en.yml +++ b/config/locales/views/en.yml @@ -30,10 +30,10 @@ en: belgique: Belgique suisse: Suisse propose: Propose an event - feeds: RSS/iCal feed + feeds: Feeds map: Map tags: Tags - infos: Informations + infos: Infos stats: Statistics contact: Contact moderation: Moderation diff --git a/config/locales/views/fr.yml b/config/locales/views/fr.yml index f8cadfa4..3768e385 100644 --- a/config/locales/views/fr.yml +++ b/config/locales/views/fr.yml @@ -30,10 +30,10 @@ fr: belgique: Belgique suisse: Suisse propose: Proposer un événement - feeds: Flux RSS/iCal + feeds: Flux map: Carte tags: Tags - infos: Informations + infos: Infos stats: Statistiques contact: Contact moderation: Modération