Skip to content
Extraits de code Groupes Projets
Valider 0260eb2a rédigé par echarp's avatar echarp
Parcourir les fichiers

On peut maintenant filtrer pour n'avoir que des evts nationaux

parent f2f6bcf0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
&:hover &:hover
background-color: #eee background-color: #eee
+text-shadow(1px 1px 0.2em gray) +text-shadow(1px 1px 0.2em gray)
em.fa-globe
color: red
&:hover ul &:hover ul
display: block display: block
......
...@@ -87,8 +87,8 @@ class EventsController < ApplicationController ...@@ -87,8 +87,8 @@ class EventsController < ApplicationController
def set_events def set_events
@events = Event.moderated @events = Event.moderated
@events = @events.region params[:region] \ @events = @events.region params[:region] if params[:region]
if params[:region] && params[:region] != 'all' @events = @events.locality params[:locality] if params[:locality]
@events = @events.tag params[:tag] if params[:tag] @events = @events.tag params[:tag] if params[:tag]
end end
......
...@@ -41,7 +41,8 @@ class Event < ActiveRecord::Base ...@@ -41,7 +41,8 @@ class Event < ActiveRecord::Base
start_date.beginning_of_month.beginning_of_week, start_date.beginning_of_month.beginning_of_week,
start_date.end_of_month.end_of_week.end_of_day start_date.end_of_month.end_of_week.end_of_day
end) end)
scope :region, -> region { where region: region } scope :region, -> region { where region: region unless region == 'all' }
scope :locality, -> locality { where locality: locality }
scope :tag, -> tag { where 'tags like ?', "%#{tag}%" } scope :tag, -> tag { where 'tags like ?', "%#{tag}%" }
scope :geo, -> { where 'latitude is not null and longitude is not null' } scope :geo, -> { where 'latitude is not null and longitude is not null' }
......
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
%em.locality.fa.fa-shield %em.locality.fa.fa-shield
= Region.find params[:region] = Region.find params[:region]
%em.fa.fa-chevron-down %em.fa.fa-chevron-down
- elsif params[:locality]
%span.placeholder
%em.locality.fa.fa-globe
=t '.national'
%em.fa.fa-chevron-down
- else - else
%span.placeholder %span.placeholder
%em.locality.fa.fa-globe %em.locality.fa.fa-globe
...@@ -25,3 +30,11 @@ ...@@ -25,3 +30,11 @@
start_date: params[:start_date], start_date: params[:start_date],
year: params[:year], year: params[:year],
tag: params[:tag] tag: params[:tag]
%li
= link_to locality: 1,
start_date: params[:start_date],
year: params[:year],
tag: params[:tag] do
%em.fa.fa-globe
=t '.national'
...@@ -117,6 +117,7 @@ it more readable or agreable. ...@@ -117,6 +117,7 @@ it more readable or agreable.
regions: regions:
selector: selector:
all_regions: All regions all_regions: All regions
national: National events
index: index:
title: Feeds title: Feeds
quick: Each feed lists events for the coming 30 days in a given region quick: Each feed lists events for the coming 30 days in a given region
......
...@@ -112,10 +112,11 @@ fr: ...@@ -112,10 +112,11 @@ fr:
regions: regions:
selector: selector:
all_regions: Toutes les régions all_regions: Toutes les régions
national: Événements nationaux
index: index:
title: Liste des flux title: Liste des flux
quick: Chaque flux liste les évènements pour les 30 prochains jours en quick: Chaque flux liste les évènements pour les 30 prochains jours dans
cours dans une région donnée une région donnée
help: "Quelques fonctionnalités intéressantes:\n help: "Quelques fonctionnalités intéressantes:\n
\n \n
* Vous pouvez limiter les évènements à un certain tag, en passant le * Vous pouvez limiter les évènements à un certain tag, en passant le
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter