show happening now and happening next on the events page
This commit is contained in:
parent
fd96f3d937
commit
312d3e3a23
2 changed files with 27 additions and 1 deletions
|
|
@ -1,6 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
EVENTS_PER_PAGE = Rails.configuration.conference[:events_per_page]
|
||||||
|
|
||||||
class ProposalsController < ApplicationController
|
class ProposalsController < ApplicationController
|
||||||
|
include ConferenceHelper
|
||||||
before_action :authenticate_user!, except: [:show, :new, :create]
|
before_action :authenticate_user!, except: [:show, :new, :create]
|
||||||
load_resource :conference, find_by: :short_title
|
load_resource :conference, find_by: :short_title
|
||||||
load_resource :program, through: :conference, singleton: true
|
load_resource :program, through: :conference, singleton: true
|
||||||
|
|
@ -19,6 +22,7 @@ class ProposalsController < ApplicationController
|
||||||
@event_schedule = @event.event_schedules.find_by(schedule_id: @program.selected_schedule_id)
|
@event_schedule = @event.event_schedules.find_by(schedule_id: @program.selected_schedule_id)
|
||||||
@speakers_ordered = @event.speakers_ordered
|
@speakers_ordered = @event.speakers_ordered
|
||||||
@surveys_after_event = @event.surveys.after_event.select(&:active?)
|
@surveys_after_event = @event.surveys.after_event.select(&:active?)
|
||||||
|
load_happening_now
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
@ -166,6 +170,8 @@ class ProposalsController < ApplicationController
|
||||||
|
|
||||||
def registrations; end
|
def registrations; end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def event_params
|
def event_params
|
||||||
|
|
@ -179,4 +185,16 @@ class ProposalsController < ApplicationController
|
||||||
def user_params
|
def user_params
|
||||||
params.require(:user).permit(:email, :password, :password_confirmation, :username)
|
params.require(:user).permit(:email, :password, :password_confirmation, :username)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def load_happening_now
|
||||||
|
events_schedules_list = get_happening_now_events_schedules(@conference)
|
||||||
|
@is_happening_next = false
|
||||||
|
if events_schedules_list.empty?
|
||||||
|
events_schedules_list = get_happening_next_events_schedules(@conference)
|
||||||
|
@is_happening_next = true
|
||||||
|
end
|
||||||
|
@events_schedules_limit = EVENTS_PER_PAGE
|
||||||
|
@events_schedules_length = events_schedules_list.length
|
||||||
|
@pagy, @events_schedules = pagy_array(events_schedules_list, items: @events_schedules_limit, link_extra: 'data-remote="true"')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
- @event.volunteers.each do |volunteer|
|
- @event.volunteers.each do |volunteer|
|
||||||
= render 'volunteer_info', speaker: volunteer, show_bio: false
|
= render 'volunteer_info', speaker: volunteer, show_bio: false
|
||||||
|
|
||||||
.col-md-9
|
.col-md-6
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.lead
|
.lead
|
||||||
|
|
@ -140,6 +140,14 @@
|
||||||
.page-header
|
.page-header
|
||||||
= render partial: 'surveys/list', locals: { surveys: @surveys_after_event, conference: @conference }
|
= render partial: 'surveys/list', locals: { surveys: @surveys_after_event, conference: @conference }
|
||||||
|
|
||||||
|
.col-md-3
|
||||||
|
#happening-now
|
||||||
|
= render 'conferences/happening_now', conference: @conference,
|
||||||
|
events_schedules: @events_schedules, pagy: @pagy,
|
||||||
|
events_schedules_length: @events_schedules_length,
|
||||||
|
events_schedules_limit: @events_schedules_limit,
|
||||||
|
is_happening_next: @is_happening_next
|
||||||
|
|
||||||
- if @event.committee_review.present? || @event.submission_text.present? && can?(:edit, @event)
|
- if @event.committee_review.present? || @event.submission_text.present? && can?(:edit, @event)
|
||||||
%hr
|
%hr
|
||||||
%p Information for event authors only:
|
%p Information for event authors only:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue