pagination happening now
This commit is contained in:
parent
7f133928b6
commit
847357dae7
8 changed files with 188 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
|||
class ApplicationController < ActionController::Base
|
||||
before_action :set_paper_trail_whodunnit
|
||||
include ApplicationHelper
|
||||
include Pagy::Backend
|
||||
add_flash_types :error
|
||||
protect_from_forgery with: :exception, prepend: true
|
||||
before_action :store_location
|
||||
|
|
|
|||
|
|
@ -72,7 +72,8 @@ class ConferencesController < ApplicationController
|
|||
@sponsors = @conference.sponsors
|
||||
end
|
||||
if splashpage.include_happening_now
|
||||
@events_schedules = get_happening_now_events_schedules(@conference)
|
||||
@event_list = get_happening_now_events_schedules(@conference)
|
||||
@pagy, @events_schedules = pagy_array(@event_list, items: 2)
|
||||
@happening_now_url = happening_now_conference_schedule_path(conference_id: @conference.short_title, format: :json)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ApplicationHelper
|
||||
include Pagy::Frontend
|
||||
# Returns a string build from the start and end date of the given conference.
|
||||
#
|
||||
# If the conference is only one day long
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
DEFAULT_LOGO = 'snapcon_logo.png'
|
||||
DEFAULT_COLOR = '#0B3559'
|
||||
|
||||
|
||||
module ConferenceHelper
|
||||
# Return true if only call_for_papers or call_for_tracks or call_for_booths is open
|
||||
def one_call_open(*calls)
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@
|
|||
%h2.text-center Happening Now
|
||||
- for event_schedule in @events_schedules
|
||||
= render 'schedules/event', conference: @conference, event_schedule: event_schedule, event: event_schedule.event
|
||||
.container{:style => "margin:auto; width:50%"}
|
||||
!= pagy_nav(@pagy)
|
||||
- else
|
||||
.row
|
||||
%h3.text-center There are no events happening now.
|
||||
|
|
@ -67,6 +69,7 @@
|
|||
= markdown(@conference.description, escape_html=false)
|
||||
.trapezoid
|
||||
|
||||
|
||||
-# calls for content, or program
|
||||
- if @conference.splashpage.include_cfp
|
||||
= render 'call_for_content', conference: @conference,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue