Skip to content
Extraits de code Groupes Projets
Valider ec406e5c rédigé par Geneviève Bastien's avatar Geneviève Bastien
Parcourir les fichiers

events: allow rss feeds to show all events


RSS feeds can be easily parsed and hence can be used to populate program for
events with the proper tags. By adding the 'showall=true' to the query string,
it is possible to see all events corresponding to the requested criteria in
the RSS feed, whether past or future and more than 20.

Signed-off-by: default avatarGeneviève Bastien <gbastien@versatic.net>
parent e749a62f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -15,7 +15,7 @@ class EventsController < ApplicationController
respond_to do |format|
format.html
format.json { @events = @events.future }
format.rss { @events = @events.future.order('id desc').limit 20 }
format.rss { @events = filter_for_rss }
format.ics { @events = @events.last_year }
format.xml
end
......@@ -107,6 +107,14 @@ class EventsController < ApplicationController
:contact, :submitter, :tags
end
def filter_for_rss
if(!params.has_key?(:showall))
@events.future.order('id desc').limit 20
else
@events.order('id desc')
end
end
def locked
redirect_to edit_event_url(@event, secret: @event.secret),
alert: t('staleObjectError')
......
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