The tag page now displays a map, and related organisations

This commit is contained in:
echarp 2020-02-04 17:56:45 +01:00
parent a91e15e973
commit 3127a9fcbd
11 changed files with 82 additions and 34 deletions

View File

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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 }

View File

@ -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

View File

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

View File

@ -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

View File

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

View File

@ -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