diff --git a/app/assets/stylesheets/events.sass b/app/assets/stylesheets/events.sass index e4a2c0da..369302b3 100644 --- a/app/assets/stylesheets/events.sass +++ b/app/assets/stylesheets/events.sass @@ -10,8 +10,9 @@ header.calendar-header em.locality.fa color: gray -span.city:after, strong.city:after, em.city:after +strong.city:after, em.city:after content: ':' + margin-left: 0.25em p.full_address span:after diff --git a/app/assets/stylesheets/frTypo.sass b/app/assets/stylesheets/frTypo.sass index 7dd0b07a..237e7c18 100644 --- a/app/assets/stylesheets/frTypo.sass +++ b/app/assets/stylesheets/frTypo.sass @@ -1,4 +1,4 @@ -.finePre, .city:after, span.label:after +.finePre, span.label:after margin-left: 0.25em .finePost margin-right: 0.25em diff --git a/app/views/events/index.html.haml b/app/views/events/index.html.haml index e32f0795..a08b2c1a 100644 --- a/app/views/events/index.html.haml +++ b/app/views/events/index.html.haml @@ -31,7 +31,7 @@ = month_calendar events: @events do |date, events| - capture_haml do .day_number= date.day - %ul.events.fa-ul= render partial: :event, collection: events, cached: true + %ul.events.fa-ul= render events .links = raw t '.calendar_in', diff --git a/app/views/events/index.rss.builder b/app/views/events/index.rss.builder index ee0195cb..82ac6cab 100644 --- a/app/views/events/index.rss.builder +++ b/app/views/events/index.rss.builder @@ -26,8 +26,11 @@ xml.rdf :RDF, 'xmlns:georss' => 'http://www.georss.org/georss' do xml.channel 'rdf:about' => root_url do title = t 'layouts.application.title' - region = Region.find_by id: session[:region] - title += " [#{region.name}]" if region + region = Region.find_by id: params[:region] + if region.present? + title += " - #{t(region.code.presence ? region.code : region.name, + scope: :countries, default: region.name)}" + end xml.title title xml.description t 'layouts.application.subtitle' xml.link root_url diff --git a/app/views/events/show.html.haml b/app/views/events/show.html.haml index 44d3d540..f28b55e5 100644 --- a/app/views/events/show.html.haml +++ b/app/views/events/show.html.haml @@ -18,13 +18,13 @@ %p.full_address - if @event.place_name.present? - %span= @event.place_name + %span.place_name= @event.place_name - if @event.address.present? - %span= @event.address - %span= link_to @event.city, - "https://fr.wikipedia.org/wiki/#{url_encode @event.city}" - %span= link_to @event.region.try(:name), - "https://fr.wikipedia.org/wiki/#{url_encode @event.region.try :name}" + %span.address= @event.address + %span.city= @event.city + %span.region + = t @event.region.code.present? ? @event.region.code : @event.region.name, + scope: :countries, default: @event.region.name - if @event.latitude && @event.longitude .event#map{ data: { url: maps_path(format: :json), diff --git a/app/views/events/show.text.haml b/app/views/events/show.text.haml index 851befd8..15ec97ac 100644 --- a/app/views/events/show.text.haml +++ b/app/views/events/show.text.haml @@ -5,7 +5,7 @@ != display_attr @event, :place_name != display_attr @event, :address != display_attr @event, :city -!= display_attr @event, :region, t(@event.region.code, scope: :countries, default: @event.region.name) +!= display_attr @event, :region, t(@event.region.code.present? ? @event.region.code : @event.region.name, scope: :countries, default: @event.region.name) != display_attr @event, :locality, t("attributes.locality_#{@event.locality}") != display_attr @event, :url - if @event.contact.present? diff --git a/app/views/maps/index.json.jbuilder b/app/views/maps/index.json.jbuilder index 54c64644..aac088c0 100644 --- a/app/views/maps/index.json.jbuilder +++ b/app/views/maps/index.json.jbuilder @@ -1,20 +1,22 @@ -json.array!(@events) do |event| +json.array!(@events) do |e| json.merge!( type: 'Feature', properties: { - id: event.id, - name: event.title, - start_time: event.start_time, end_time: event.end_time, - submission_time: event.submission_time, - decision_time: event.decision_time, - place_name: event.place_name, address: event.address, city: event.city, - region: event.region.name, region_id: event.region_id, - tags: event.tag_list, - popupContent: link_to(event, event_url(event)) + id: e.id, + name: e.title, + start_time: e.start_time, end_time: e.end_time, + submission_time: e.submission_time, + decision_time: e.decision_time, + place_name: e.place_name, address: e.address, city: e.city, + region: t(e.region.code.presence ? e.region.code : e.region.name, + scope: :countries, default: e.region.name), + region_id: e.region_id, + tags: e.tag_list, + popupContent: link_to(e, event_url(e)) }, geometry: { type: 'Point', - coordinates: [event.longitude, event.latitude] + coordinates: [e.longitude, e.latitude] } ) end diff --git a/app/views/orgas/show.html.haml b/app/views/orgas/show.html.haml index dbae26f4..db7637ec 100644 --- a/app/views/orgas/show.html.haml +++ b/app/views/orgas/show.html.haml @@ -11,13 +11,13 @@ %p.full_address - if @orga.place_name.present? - %span= @orga.place_name + %span.place_name= @orga.place_name - if @orga.address.present? - %span= @orga.address - %span= link_to @orga.city, - "https://fr.wikipedia.org/wiki/#{url_encode @orga.city}" - %span= link_to @orga.region.try(:name), - "https://fr.wikipedia.org/wiki/#{url_encode @orga.region.try :name}" + %span.address= @orga.address + %span.city= @orga.city + %span.region + = t @orga.region.code.present? ? @orga.region.code : @orga.region.name, + scope: :countries, default: @orga.region.name - if @orga.latitude && @orga.longitude .orga#map{ data: { url: maps_path(format: :json).to_s, diff --git a/app/views/orgas/show.text.haml b/app/views/orgas/show.text.haml index 2091f8c4..704c64da 100644 --- a/app/views/orgas/show.text.haml +++ b/app/views/orgas/show.text.haml @@ -5,7 +5,7 @@ != display_attr @orga, :address != display_attr @orga, :city != display_attr @orga, :department -!= display_attr @orga, :region, t(@orga.region.code, scope: :countries, default: @orga.region.name) +!= display_attr @orga, :region, t(@orga.region.code.present? ? @orga.region.code : @orga.region.name, scope: :countries, default: @orga.region.name) != display_attr @orga, :url != display_attr @orga, :diaspora != display_attr @orga, :feed diff --git a/app/views/regions/_filter_region.haml b/app/views/regions/_filter_region.haml index c423fbcf..9cd20c13 100644 --- a/app/views/regions/_filter_region.haml +++ b/app/views/regions/_filter_region.haml @@ -14,7 +14,7 @@ = t filter_region.code, scope: :countries, default: filter_region.name - else %em.fa.fa-shield-alt - = filter_region.name + = t filter_region.name, scope: :countries, default: filter_region.name - if params[:region] == filter_region.id.to_s %em.fa.fa-times - elsif !filter_region.region && filter_region.regions.present? diff --git a/app/views/regions/_selector_region.haml b/app/views/regions/_selector_region.haml index 53e30e47..52f2609c 100644 --- a/app/views/regions/_selector_region.haml +++ b/app/views/regions/_selector_region.haml @@ -7,11 +7,12 @@ = t selector_region.code, scope: :countries, default: selector_region.name - else %em.fa.fa-map - = selector_region + = t selector_region, scope: :countries, default: selector_region - if selector_region.regions.present? %small %em.fa.fa-chevron-right - if selector_region.regions.present? .radios = f.collection_radio_buttons :region_id, - Region.where(region: selector_region), :id, :name, include_hidden: false + Region.where(region: selector_region), :id, :name, include_hidden: false do |b| + = b.label { b.radio_button + t(b.text, scope: :countries, default: b.text) } diff --git a/app/views/regions/index.html.haml b/app/views/regions/index.html.haml index 7040fdb5..7f95eb4d 100644 --- a/app/views/regions/index.html.haml +++ b/app/views/regions/index.html.haml @@ -19,7 +19,10 @@ %tbody - @regions.find_each do |region| %tr - %td= link_to region.name, events_path(region: region.id) + %td + = link_to events_path(region: region.id) do + = t(region.code.present? ? region.code : region.name, + scope: :countries, default: region.name) %td= link_to 'RSS', events_path(format: :rss, region: region.id) %td= link_to :webcal, events_path(protocol: :webcal, format: :ics, region: region.id, diff --git a/app/views/stats/index.html.haml b/app/views/stats/index.html.haml index 87c0f44c..a0b5909c 100644 --- a/app/views/stats/index.html.haml +++ b/app/views/stats/index.html.haml @@ -63,7 +63,8 @@ %tbody - @regions.each do |region| %tr - %th.region= region + %th.region= t(region.code.presence ? region.code : region.name, + scope: :countries, default: region.name) - total = 0 - @years.each do |year| %td.quantity diff --git a/config/locales/countries.nl.yml b/config/locales/countries.nl.yml new file mode 100644 index 00000000..f7c28cf2 --- /dev/null +++ b/config/locales/countries.nl.yml @@ -0,0 +1,3 @@ +nl: + countries: + Bruxelles: Brussels