Controlador para los eventos públicos
# File app/controllers/events_controller.rb, line 33 def index prepare_events(@context, request.xhr?) respond_to do |format| format.html do if request.xhr? render :partial => '/shared/list_items', :locals => {:items => @actions, :type => 'events'}, :layout => false else render end end format.ics { render :layout => false } end end
# File app/controllers/events_controller.rb, line 53 def list redirect_to params.merge(:action => 'index') end
RSS de los eventos públicos
# File app/controllers/events_controller.rb, line 94 def myfeed @title = t('events.agenda') cj = get_list_conditions() respond_to do |format| format.ics { @events = Event.published.translated.future(1.month.ago).find(:all, :conditions => cj[:conditions], :joins => cj[:joins]) render :layout => false } end end
Ver los datos públicos de un evento publicado.
# File app/controllers/events_controller.rb, line 58 def show @title = t('events.agenda') begin @event = Event.published.find(params[:id]) rescue ActiveRecord::RecordNotFound if can_edit?("events") @event = Event.find(params[:id]) else #raise ActiveRecord::RecordNotFound bad_record return end end @comments = @event.comments.approved.paginate :page => params[:page], :per_page => 25 if @category # Comprobar que la categoria y el documento estan relacionados if @event.tags.private.collect(&:name_es) & @category.tags.private.collect(&:name_es) == [] logger.info "Categoria y documento no relacionados" raise ActiveRecord::RecordNotFound end end respond_to do |format| format.html { render } format.ics { render :layout => false} format.xml format.iphone format.android format.floki end end
# File app/controllers/events_controller.rb, line 48 def summary get_month_events render :layout => !request.xhr? end