Browse Source

The tag page now displays a map, and related organisations

remotes/origin/master
echarp 2 years ago
parent
commit
3127a9fcbd
  1. 2
      app/assets/stylesheets/maps.sass
  2. 2
      app/controllers/tags_controller.rb
  3. 2
      app/views/maps/_events.html.haml
  4. 20
      app/views/maps/_tag.html.haml
  5. 46
      app/views/tags/_aside.html.haml
  6. 34
      app/views/tags/show.html.haml
  7. 2
      config/locales/views/de.yml
  8. 2
      config/locales/views/en.yml
  9. 2
      config/locales/views/fr.yml
  10. 2
      config/locales/views/nl.yml
  11. 2
      config/locales/views/pt-BR.yml

2
app/assets/stylesheets/maps.sass

@ -4,7 +4,7 @@
*
/* Popup are better displayed with this: */
max-width: initial
ul.feeds li
ul li
a
display: inline-block
.awesome-marker

2
app/controllers/tags_controller.rb

@ -1,7 +1,6 @@
# Manage event and organisation tags
class TagsController < InheritedResources::Base
has_scope :region, :locality, :daylimit
has_scope :period, type: :hash, using: %i[year week]
has_scope :tag, as: :id
def index
@ -22,6 +21,7 @@ class TagsController < InheritedResources::Base
def show
@events_future = apply_scopes Event.moderated.future
@events_past = apply_scopes Event.moderated.past
@orgas = apply_scopes Orga.moderated.active
respond_to do |format|
format.html

2
app/views/maps/_events.html.haml

@ -1,6 +1,6 @@
= render '/regions/filter'
%ul.list.feeds#map
%ul.list.events#map
%li
= link_to maps_path format: :json do
.awesome-marker.awesome-marker-icon-blue

20
app/views/maps/_tag.html.haml

@ -0,0 +1,20 @@
%ul.list#map
%li
= link_to maps_path tag: params[:id], format: :json do
.awesome-marker.awesome-marker-icon-blue
%i.icon-white.fa.fa-calendar
- if params[:future] == 'false'
= Event.model_name.human
- else
= t '.future'
- cs = %w[blue red darkred orange green darkgreen purple darkpuple cadetblue]
- idx = 1
- Kind.all.each do |kind|
%li
= link_to map_path kind.name, tag: params[:id], format: :json do
.awesome-marker{ class: "awesome-marker-icon-#{cs[idx % cs.length]}" }
%i.icon-white.fa{ class: "fa-#{kind.icon}" }
= Kind.human_attribute_name "name_#{kind.name}"
- idx += 1

46
app/views/tags/_aside.html.haml

@ -0,0 +1,46 @@
%aside
- if @orgas.present?
%h2
= link_to orgas_path do
%em.fa.fa-users
= Orga.model_name.human.pluralize
%ul.fa-ul
- @orgas.each do |orga|
%li
= link_to orga do
- if orga.kind
%em.fa.fa-li{ class: "fa-#{orga.kind.icon}",
title: Kind.human_attribute_name("name_#{orga.kind.name}") }
= orga.name
= render partial: '/orgas/favicon', locals: { orga: orga }
%h2
%em.fa.fa-link
= t '.links'
%ul.fa-ul
%li
= link_to tags_path, class: :back do
%em.fa.fa-li.fa-arrow-left
= Event.human_attribute_name :tags
%li
= link_to events_path tag: params[:id] do
%em.fa.fa-li.fa-calendar
Agenda
%li
= link_to events_path format: :rss, tag: params[:id] do
%em.fa.fa-li.fa-rss
RSS
%li
= link_to events_path format: :ics, tag: params[:id] do
%em.fa.fa-li.fa-th-list
iCal
%li
= link_to maps_path tag: params[:id] do
%em.fa.fa-li.fa-map-marker
OpenStreetMap
%li
= link_to maps_path format: :json, tag: params[:id] do
%em.fa.fa-li.fa-dot-circle
GeoJSON

34
app/views/tags/show.html.haml

@ -1,5 +1,3 @@
= render partial: '/tags/context', locals: { tags: params[:id] }
%h2
%em.fa.fa-tag
= title params[:id]
@ -7,36 +5,10 @@
%em.fa.fa-forward
= t '.count', count: @events_future.count
%aside
%h2
%em.fa.fa-link
= t '.links'
- unless params[:iframe]
= render '/maps/tag'
%ul.fa-ul
%li
= link_to tags_path, class: :back do
%em.fa.fa-li.fa-arrow-left
= Event.human_attribute_name :tags
%li
= link_to events_path tag: params[:id] do
%em.fa.fa-li.fa-calendar
Agenda
%li
= link_to events_path format: :rss, tag: params[:id] do
%em.fa.fa-li.fa-rss
RSS
%li
= link_to events_path format: :ics, tag: params[:id] do
%em.fa.fa-li.fa-th-list
iCal
%li
= link_to maps_path tag: params[:id] do
%em.fa.fa-li.fa-map-marker
OpenStreetMap
%li
= link_to maps_path format: :json, tag: params[:id] do
%em.fa.fa-li.fa-dot-circle
GeoJSON
= render 'aside'
- @events_future.order('start_time asc').each do |event|
%article.event{ class: event.tag_list }

2
config/locales/views/de.yml

@ -263,6 +263,8 @@ erneut zu übermitteln."
title: Karte der Veranstaltungen und Organisationen
events:
future: Kommende Veranstaltung
tag:
future: Kommende Veranstaltung
users:
sign_in:
title: Identifizierung

2
config/locales/views/en.yml

@ -251,6 +251,8 @@ description."
title: Events and organisations map
events:
future: Coming event
tag:
future: Future
users:
sign_in:
title: Authentication

2
config/locales/views/fr.yml

@ -270,6 +270,8 @@ description plus complète."
title: Carte des événements et organisations
events:
future: Événement à venir
tag:
future: Événement à venir
users:
sign_in:
title: Identification

2
config/locales/views/nl.yml

@ -265,6 +265,8 @@ vollediger beschrijving."
title: Evenementen en organisaties kaart
events:
future: Aankomende evenement
tag:
future: Aankomende evenement
users:
sign_in:
title: Identificatie

2
config/locales/views/pt-BR.yml

@ -244,6 +244,8 @@ descrição mais completa."
title: Mapa de eventos e organizações
events:
future: Evento Futuro
tag:
future: Evento Futuro
users:
sign_in:
title: Autenticação

Loading…
Cancel
Save