Some advances to maps, and translations. Refs #71
This commit is contained in:
parent
a77839e814
commit
50f429784c
@ -30,7 +30,7 @@ $(document).ready ->
|
|||||||
map.addLayer layer
|
map.addLayer layer
|
||||||
controls.addOverlay layer, text + ' - ' + count
|
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
|
# Automatic focus to all displayed events
|
||||||
map.fitBounds layer.getBounds()
|
map.fitBounds layer.getBounds()
|
||||||
|
|
||||||
|
@ -15,10 +15,12 @@ class MapsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
kind = Kind.find_by_name params[:id]
|
@kind = Kind.find_by_name params[:id]
|
||||||
orgas = apply_scopes(Orga.moderated.geo).joins(:kind).where(kind: kind)
|
|
||||||
respond_to do |format|
|
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
%li
|
%li
|
||||||
= link_to maps_path format: :json do
|
= link_to maps_path format: :json do
|
||||||
%em.fa.fa-calendar
|
%em.fa.fa-calendar
|
||||||
= Event.model_name.human.pluralize
|
= Event.model_name.human
|
||||||
- Kind.all.each do |kind|
|
- Kind.all.each do |kind|
|
||||||
%li
|
%li
|
||||||
= link_to map_path kind.name, format: :json do
|
= link_to map_path kind.name, format: :json do
|
||||||
|
15
app/views/maps/show.html.haml
Normal file
15
app/views/maps/show.html.haml
Normal file
@ -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:
|
kind:
|
||||||
name_association: Association
|
name_association: Association
|
||||||
name_enterprise: Enterprise
|
name_enterprise: Enterprise
|
||||||
name_lug: LUG
|
name_lug: GLUG
|
||||||
name_provider: ISP
|
name_provider: ISP
|
||||||
name_institution: Institution
|
name_institution: Institution
|
||||||
name_lab: Lab
|
name_lab: Lab
|
||||||
|
@ -55,7 +55,7 @@ fr:
|
|||||||
kind:
|
kind:
|
||||||
name_association: Association
|
name_association: Association
|
||||||
name_enterprise: Entreprise
|
name_enterprise: Entreprise
|
||||||
name_lug: GUL
|
name_lug: GULL
|
||||||
name_provider: FAI
|
name_provider: FAI
|
||||||
name_institution: Institution
|
name_institution: Institution
|
||||||
name_lab: Lab
|
name_lab: Lab
|
||||||
|
Loading…
Reference in New Issue
Block a user