Ajout d'une url pour le flux rss semblable à l'ancienne en php
This commit is contained in:
parent
fcdee7fb94
commit
97d285e497
@ -20,7 +20,7 @@ main form.region_selector + h2
|
||||
|
||||
// For whole year calendar
|
||||
main form.region_selector + h2 + h2
|
||||
padding: 6px 0 0
|
||||
padding: 0.26em 0 0
|
||||
font-size: 1.2em
|
||||
margin-bottom: 0.8em
|
||||
|
||||
|
@ -2,30 +2,26 @@ class EventsController < InheritedResources::Base
|
||||
before_action :set_event, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
def index
|
||||
@events = Event
|
||||
if (params[:region] && params[:region].present? && params[:region] != 'all')
|
||||
@events = @events.region(params[:region])
|
||||
end
|
||||
if (params[:tag])
|
||||
@events = @events.tag(params[:tag])
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
if (params[:year] and !params[:month])
|
||||
# Whole year calendar
|
||||
@events = Event.year(params[:year] || Date.today.year)
|
||||
@events = @events.year params[:year]
|
||||
else
|
||||
@events = Event.month(params[:year] || Date.today.year, params[:month] || Date.today.month)
|
||||
end
|
||||
if (params[:region] && params[:region].present? && params[:region] != 'all')
|
||||
@events = @events.region(params[:region])
|
||||
end
|
||||
if (params[:tag])
|
||||
@events = @events.tag(params[:tag])
|
||||
@events = @events.month(params[:year] || Date.today.year, params[:month] || Date.today.month)
|
||||
end
|
||||
}
|
||||
|
||||
format.rss {
|
||||
@events = Event.where('start_time >= now()').order(start_time: :asc).limit(25)
|
||||
if (params[:region] && params[:region].present? && params[:region] != 'all')
|
||||
@events = @events.region(params[:region])
|
||||
end
|
||||
if (params[:tag])
|
||||
@events = @events.tag(params[:tag])
|
||||
end
|
||||
@events = @events.where('start_time >= now()').order(start_time: :asc).limit(25)
|
||||
}
|
||||
end
|
||||
end
|
||||
@ -38,7 +34,6 @@ class EventsController < InheritedResources::Base
|
||||
@event.region = Region.find(params[:event][:region])
|
||||
|
||||
if (params[:visu])
|
||||
logger.info 'XXXXXXXXXXXXXXX'
|
||||
render action: 'new'
|
||||
return
|
||||
end
|
||||
|
@ -2,6 +2,8 @@ AgendaDuLibreRails::Application.routes.draw do
|
||||
resources :events
|
||||
resources :users
|
||||
|
||||
get ':format.php' => 'events#index'
|
||||
|
||||
devise_for :admin_users, ActiveAdmin::Devise.config
|
||||
ActiveAdmin.routes(self)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user