pagination

This commit is contained in:
madhekare 2021-04-07 21:07:24 -07:00 committed by CactusPuppy
parent 847357dae7
commit 80d94337a2
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82
2 changed files with 6 additions and 4 deletions

View file

@ -73,7 +73,7 @@ class ConferencesController < ApplicationController
end end
if splashpage.include_happening_now if splashpage.include_happening_now
@event_list = get_happening_now_events_schedules(@conference) @event_list = get_happening_now_events_schedules(@conference)
@pagy, @events_schedules = pagy_array(@event_list, items: 2) @pagy, @events_schedules = pagy_array(@event_list, items: 3)
@happening_now_url = happening_now_conference_schedule_path(conference_id: @conference.short_title, format: :json) @happening_now_url = happening_now_conference_schedule_path(conference_id: @conference.short_title, format: :json)
end end
end end

View file

@ -54,11 +54,12 @@
- if @conference.splashpage.include_happening_now - if @conference.splashpage.include_happening_now
- if @events_schedules.any? - if @events_schedules.any?
.row .row
%h2.text-center Happening Now %h2.text-center{:style => "margin-bottom:30px"} Happening Now
- for event_schedule in @events_schedules - for event_schedule in @events_schedules
= render 'schedules/event', conference: @conference, event_schedule: event_schedule, event: event_schedule.event = render 'schedules/event', conference: @conference, event_schedule: event_schedule, event: event_schedule.event
.container{:style => "margin:auto; width:50%"} - if @events_schedules.length > 3
!= pagy_nav(@pagy) .container{:style => "margin:auto; width:50%"}
!= pagy_nav(@pagy)
- else - else
.row .row
%h3.text-center There are no events happening now. %h3.text-center There are no events happening now.
@ -66,6 +67,7 @@
.col-md-6.col-md-pull-6.col-lg-8.col-lg-pull-4 .col-md-6.col-md-pull-6.col-lg-8.col-lg-pull-4
#about #about
.row .row
%h2.text-left{:style => "margin-bottom:30px"} About the Conference
= markdown(@conference.description, escape_html=false) = markdown(@conference.description, escape_html=false)
.trapezoid .trapezoid