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

recurrent
echarp 8 years ago
parent e078cfefec
commit de75e82ae9
  1. 10
      app/assets/javascripts/maps.js.coffee
  2. 12
      app/assets/stylesheets/maps.css.sass
  3. 3
      app/assets/stylesheets/tags.css.sass
  4. 5
      app/views/events/show.html.haml
  5. 2
      app/views/maps/index.html.haml
  6. 4
      app/views/tags/index.html.haml
  7. 8
      app/views/tags/show.html.haml

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

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

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

@ -50,7 +50,10 @@
"http://fr.wikipedia.org/wiki/#{url_encode @event.related_region.try(:name)}"
- 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'
%em.fa.fa-compress

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

@ -5,9 +5,5 @@
- @tags.each do |tag|
%span.tag(class="size_#{Math.log2(tag[1]).to_i}")
= 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'

@ -1,6 +1,14 @@
%h2
=t '.title'
«
%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?
%p=raw t '.future', count: @events_future.count

Loading…
Cancel
Save