Get rid of the schedule controller

This commit is contained in:
Henne Vogelsang 2014-11-27 14:31:44 +01:00
parent ebb7d8da2c
commit ce6ed0a8e9
10 changed files with 19 additions and 30 deletions

View file

@ -11,6 +11,18 @@ class ConferenceController < ApplicationController
@keynote_speakers = @conference.keynote_speakers @keynote_speakers = @conference.keynote_speakers
end end
def schedule
@rooms = @conference.rooms
@events = @conference.events
@dates = @conference.start_date..@conference.end_date
if @dates == Date.current
@today = Date.current.strftime('%Y-%m-%d')
else
@today = @conference.start_date.strftime('%Y-%m-%d')
end
end
def gallery_photos def gallery_photos
@photos = @conference.photos @photos = @conference.photos
render 'photos', formats: [:js] render 'photos', formats: [:js]

View file

@ -1,19 +0,0 @@
class ScheduleController < ApplicationController
authorize_resource class: false
layout 'application'
def index
@conference = Conference.
includes(:rooms, events: [:speakers, :track, :event_type]).
where(conferences: { short_title: params[:conference_id] }).first
@rooms = @conference.rooms
@events = @conference.events
@dates = @conference.start_date..@conference.end_date
if @dates == Date.current
@today = Date.current.strftime('%Y-%m-%d')
else
@today = @conference.start_date.strftime('%Y-%m-%d')
end
end
end

View file

@ -104,7 +104,7 @@ class Ability
def guest def guest
## Abilities for everyone, even guests (not logged in users) ## Abilities for everyone, even guests (not logged in users)
can [:index, :show], Conference do |conference| can [:index, :show, :schedule], Conference do |conference|
conference.splashpage && conference.splashpage.public == true conference.splashpage && conference.splashpage.public == true
end end

View file

@ -27,7 +27,7 @@ class EmailSettings < ActiveRecord::Base
conference.short_title, host: CONFIG['url_for_emails']), conference.short_title, host: CONFIG['url_for_emails']),
'cfp_start_date' => conference.call_for_papers.start_date, 'cfp_start_date' => conference.call_for_papers.start_date,
'cfp_end_date' => conference.call_for_papers.end_date, 'cfp_end_date' => conference.call_for_papers.end_date,
'schedule_link' => Rails.application.routes.url_helpers.conference_schedule_url( 'schedule_link' => Rails.application.routes.url_helpers.schedule_conference_url(
conference.short_title, host: CONFIG['url_for_emails']) conference.short_title, host: CONFIG['url_for_emails'])
} }

View file

@ -4,7 +4,7 @@
%h1 Commercials %h1 Commercials
%p.text-muted %p.text-muted
Conference commercials will be displayed on the events in the Conference commercials will be displayed on the events in the
= link_to "schedule,", conference_schedule_path(@conference.short_title) = link_to "schedule,", schedule_conference_path(@conference.short_title)
if the event speaker didn't add an event commercial. if the event speaker didn't add an event commercial.
- @commercials.each_slice(3) do |slice| - @commercials.each_slice(3) do |slice|
.row .row

View file

@ -25,7 +25,7 @@
= link_to "Modify Registration", edit_conference_conference_registrations_path(conference.short_title), :class =>"btn btn-default" = link_to "Modify Registration", edit_conference_conference_registrations_path(conference.short_title), :class =>"btn btn-default"
- else - else
= link_to "Register", new_conference_conference_registrations_path(conference.short_title), :class =>"btn btn-success" = link_to "Register", new_conference_conference_registrations_path(conference.short_title), :class =>"btn btn-success"
= link_to "Schedule", conference_schedule_path(conference.short_title), :class =>"btn btn-default" if conference.call_for_paper and conference.call_for_paper.schedule_public = link_to "Schedule", schedule_conference_path(conference.short_title), :class =>"btn btn-default" if conference.call_for_paper and conference.call_for_paper.schedule_public
- if !current_user.nil? && current_user.proposal_count(conference) > 0 - if !current_user.nil? && current_user.proposal_count(conference) > 0
= link_to "View My Proposals", conference_proposal_index_path(conference.short_title), :class =>"btn btn-default" = link_to "View My Proposals", conference_proposal_index_path(conference.short_title), :class =>"btn btn-default"
- elsif conference.cfp_open? - elsif conference.cfp_open?

View file

@ -21,7 +21,7 @@
.row .row
.col-md-12 .col-md-12
%p.cta-button.text-center %p.cta-button.text-center
= link_to(conference_schedule_path(@conference.short_title), class: 'btn btn-default btn-lg') do = link_to(schedule_conference_path(@conference.short_title), class: 'btn btn-default btn-lg') do
Full Schedule Full Schedule
- #FIXME: Display keynotes https://github.com/openSUSE/osem/issues/544 - #FIXME: Display keynotes https://github.com/openSUSE/osem/issues/544

View file

@ -7,7 +7,7 @@
%br %br
%small %small
= @event.subtitle = @event.subtitle
= link_to "Schedule", conference_schedule_path(@conference.short_title), :class =>"btn btn-success pull-right" = link_to "Schedule", schedule_conference_path(@conference.short_title), :class =>"btn btn-success pull-right"
- if can? :edit, @event - if can? :edit, @event
= link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary pull-right" = link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary pull-right"
.row .row

View file

@ -101,12 +101,8 @@ Osem::Application.routes.draw do
resources :ticket_purchases, only: [:create, :destroy] resources :ticket_purchases, only: [:create, :destroy]
resource :subscriptions, only: [:create, :destroy] resource :subscriptions, only: [:create, :destroy]
resource :schedule, only: [] do
get '/' => 'schedule#index'
end
member do member do
get 'gallery_photos' get :schedule
end end
end end