Le nuage de tag est simplifié, et par tag une carte est rajoutée

This commit is contained in:
echarp 2014-10-28 00:23:11 +01:00
parent e078cfefec
commit de75e82ae9
7 changed files with 26 additions and 18 deletions

View File

@ -1,5 +1,5 @@
$(document).ready -> $(document).ready ->
$('.maps #map').each -> $('#map.events').each ->
map = L.map 'map' map = L.map 'map'
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
@ -14,13 +14,13 @@ $(document).ready ->
layer.bindPopup feature.properties.popupContent layer.bindPopup feature.properties.popupContent
) )
map.addLayer L.markerClusterGroup().addLayer layer
# Automatic focus to all displayed events # Automatic focus to all displayed events
map.fitBounds layer.getBounds() map.fitBounds layer.getBounds()
map.addLayer L.markerClusterGroup().addLayer layer $('#map.event').each ->
coord = [$(this).data('latitude'), $(this).data('longitude')]
$('.events #map, .moderations #map').each ->
coord = [$(this).attr('latitude'), $(this).attr('longitude')]
map = L.map('map').setView [coord[0], coord[1]], 16 map = L.map('map').setView [coord[0], coord[1]], 16

View File

@ -4,14 +4,18 @@
@import leaflet.markercluster.default @import leaflet.markercluster.default
#map #map
height: 60em
+box-shadow(0 0 1em SteelBlue) +box-shadow(0 0 1em SteelBlue)
+transition(none) +transition(none)
* *
/* Popup are better displayed with this: */ /* Popup are better displayed with this: */
max-width: initial max-width: initial
.maps #map &.event
height: 60em
.events #map, .moderations #map
height: 20em height: 20em
.tags #map
float: left
width: 30%
height: 30em
margin: 1% 5%

View File

@ -7,9 +7,6 @@ p.tags a:last-child:after
.tag .tag
vertical-align: middle vertical-align: middle
sub
font-size: 8px
&.size_1 &.size_1
font-size: 60% font-size: 60%
letter-spacing: -1px letter-spacing: -1px

View File

@ -50,7 +50,10 @@
"http://fr.wikipedia.org/wiki/#{url_encode @event.related_region.try(:name)}" "http://fr.wikipedia.org/wiki/#{url_encode @event.related_region.try(:name)}"
- if @event.latitude && @event.longitude - if @event.latitude && @event.longitude
#map(data-url="#{maps_path format: :json}" latitude="#{@event.latitude}" longitude="#{@event.longitude}") #map.event{ data: { |
url: "#{maps_path format: :json}", |
latitude: "#{@event.latitude}", |
longitude: "#{@event.longitude}" } } |
- elsif controller.action_name != 'show' - elsif controller.action_name != 'show'
%em.fa.fa-compress %em.fa.fa-compress

View File

@ -2,4 +2,4 @@
%em.fa.fa-map-marker %em.fa.fa-map-marker
=title t '.title' =title t '.title'
#map(data-url="#{maps_path format: :json}") #map.events(data-url="#{maps_path format: :json}")

View File

@ -5,9 +5,5 @@
- @tags.each do |tag| - @tags.each do |tag|
%span.tag(class="size_#{Math.log2(tag[1]).to_i}") %span.tag(class="size_#{Math.log2(tag[1]).to_i}")
= link_to tag[0], tag_url(tag[0]) = link_to tag[0], tag_url(tag[0])
%sub<>
= link_to :rss, events_url(format: :rss, tag: tag[0])
\/
= link_to :ical, events_url(format: :ics, tag: tag[0])
%p=t '.limited' %p=t '.limited'

View File

@ -1,6 +1,14 @@
%h2 %h2
=t '.title' =t '.title'
«
%em= params[:id] %em= params[:id]
»
= link_to :rss, events_url(format: :rss, tag: params[:id])
\/
= link_to :ical, events_url(format: :ics, tag: params[:id])
#map.events(data-url="#{maps_path format: :json, tag: params[:id]}")
- if @events_future.any? - if @events_future.any?
%p=raw t '.future', count: @events_future.count %p=raw t '.future', count: @events_future.count