mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Get rid of the schedule controller
This commit is contained in:
parent
ebb7d8da2c
commit
ce6ed0a8e9
10 changed files with 19 additions and 30 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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'])
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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?
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue