Some advances to maps, and translations. Refs #71

recurrent
echarp 7 years ago
parent a77839e814
commit 50f429784c
  1. 2
      app/assets/javascripts/maps.js.coffee
  2. 8
      app/controllers/maps_controller.rb
  3. 2
      app/views/maps/index.html.haml
  4. 15
      app/views/maps/show.html.haml
  5. 2
      config/locales/models/en.yml
  6. 2
      config/locales/models/fr.yml

@ -30,7 +30,7 @@ $(document).ready ->
map.addLayer layer
controls.addOverlay layer, text + ' - ' + count
if (url.contains('maps.json') && layer.getBounds()._northEast && layer.getBounds()._southWest)
if (location.href.contains('maps/') || url.contains('maps.json')) && layer.getBounds()._northEast && layer.getBounds()._southWest
# Automatic focus to all displayed events
map.fitBounds layer.getBounds()

@ -15,10 +15,12 @@ class MapsController < ApplicationController
end
def show
kind = Kind.find_by_name params[:id]
orgas = apply_scopes(Orga.moderated.geo).joins(:kind).where(kind: kind)
@kind = Kind.find_by_name params[:id]
respond_to do |format|
format.json { render json: orgas }
format.html { render layout: 'iframe' if params[:iframe] }
format.json do
render json: apply_scopes(Orga.moderated.geo).where(kind: @kind)
end
end
end
end

@ -10,7 +10,7 @@
%li
= link_to maps_path format: :json do
%em.fa.fa-calendar
= Event.model_name.human.pluralize
= Event.model_name.human
- Kind.all.each do |kind|
%li
= link_to map_path kind.name, format: :json do

@ -0,0 +1,15 @@
%h2
%em.fa.fa-map-marker
= t 'layouts.application.map'
%em.fa{ class: "fa-#{@kind.icon}" }
= Kind.human_attribute_name("name_#{@kind.name}")
- if params[:tag]
«
%em= params[:tag]
»
%ul#map.list
%li
= link_to map_path @kind.name, format: :json do
%em.fa{ class: "fa-#{@kind.icon}" }
= Kind.human_attribute_name("name_#{@kind.name}")

@ -55,7 +55,7 @@ en:
kind:
name_association: Association
name_enterprise: Enterprise
name_lug: LUG
name_lug: GLUG
name_provider: ISP
name_institution: Institution
name_lab: Lab

@ -55,7 +55,7 @@ fr:
kind:
name_association: Association
name_enterprise: Entreprise
name_lug: GUL
name_lug: GULL
name_provider: FAI
name_institution: Institution
name_lab: Lab

Loading…
Cancel
Save