diff --git a/app/controllers/conference_controller.rb b/app/controllers/conference_controller.rb index 969b77dd..feaa2a0e 100644 --- a/app/controllers/conference_controller.rb +++ b/app/controllers/conference_controller.rb @@ -11,6 +11,18 @@ class ConferenceController < ApplicationController @keynote_speakers = @conference.keynote_speakers 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 @photos = @conference.photos render 'photos', formats: [:js] diff --git a/app/controllers/schedule_controller.rb b/app/controllers/schedule_controller.rb deleted file mode 100644 index efdc65c8..00000000 --- a/app/controllers/schedule_controller.rb +++ /dev/null @@ -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 diff --git a/app/models/ability.rb b/app/models/ability.rb index 332c612f..644c71b2 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -104,7 +104,7 @@ class Ability def guest ## 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 end diff --git a/app/models/email_settings.rb b/app/models/email_settings.rb index f315e2db..d40b2eb8 100644 --- a/app/models/email_settings.rb +++ b/app/models/email_settings.rb @@ -27,7 +27,7 @@ class EmailSettings < ActiveRecord::Base conference.short_title, host: CONFIG['url_for_emails']), 'cfp_start_date' => conference.call_for_papers.start_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']) } diff --git a/app/views/admin/commercials/index.html.haml b/app/views/admin/commercials/index.html.haml index 9146f654..a6f6d3c3 100644 --- a/app/views/admin/commercials/index.html.haml +++ b/app/views/admin/commercials/index.html.haml @@ -4,7 +4,7 @@ %h1 Commercials %p.text-muted 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. - @commercials.each_slice(3) do |slice| .row diff --git a/app/views/conference/_conference_details.html.haml b/app/views/conference/_conference_details.html.haml index 7724c1aa..7d3c35db 100644 --- a/app/views/conference/_conference_details.html.haml +++ b/app/views/conference/_conference_details.html.haml @@ -25,7 +25,7 @@ = link_to "Modify Registration", edit_conference_conference_registrations_path(conference.short_title), :class =>"btn btn-default" - else = 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 = link_to "View My Proposals", conference_proposal_index_path(conference.short_title), :class =>"btn btn-default" - elsif conference.cfp_open? diff --git a/app/views/conference/_program.html.haml b/app/views/conference/_program.html.haml index f352528d..40e5db13 100644 --- a/app/views/conference/_program.html.haml +++ b/app/views/conference/_program.html.haml @@ -21,7 +21,7 @@ .row .col-md-12 %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 - #FIXME: Display keynotes https://github.com/openSUSE/osem/issues/544 diff --git a/app/views/schedule/index.html.erb b/app/views/conference/schedule.html.erb similarity index 100% rename from app/views/schedule/index.html.erb rename to app/views/conference/schedule.html.erb diff --git a/app/views/proposal/show.html.haml b/app/views/proposal/show.html.haml index 018948a1..409165bb 100644 --- a/app/views/proposal/show.html.haml +++ b/app/views/proposal/show.html.haml @@ -7,7 +7,7 @@ %br %small = @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 = link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary pull-right" .row diff --git a/config/routes.rb b/config/routes.rb index 6ee73635..4e39d25f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -101,12 +101,8 @@ Osem::Application.routes.draw do resources :ticket_purchases, only: [:create, :destroy] resource :subscriptions, only: [:create, :destroy] - resource :schedule, only: [] do - get '/' => 'schedule#index' - end - member do - get 'gallery_photos' + get :schedule end end