Use fragment caching on the splashpage

This commit is contained in:
James Mason 2017-11-21 09:54:27 -08:00
parent 7f2346650f
commit f4b869c129
11 changed files with 335 additions and 317 deletions

View file

@ -2,7 +2,9 @@
%li
%a.smoothscroll{ href: '#booths' } Booths
.container
- cache [@conference.confirmed_booths, '#splash#booths'] do
%section#booths
.container
.row
.col-md-12.text-center
%h2 Booths

View file

@ -2,7 +2,10 @@
%li
%a.smoothscroll{ href: '#callforpapers' } Call For Papers
.container
- cache [@conference, @conference.call_for_events, @conference.confirmed_tracks,
'#splash#callforpapers'] do
%section#callforpapers
.container
.row
.col-md-12.text-center
%h2

View file

@ -2,7 +2,9 @@
%li
%a.smoothscroll{ href: '#callfortracks' } Call For Tracks
.container
- cache [@conference, @conference.call_for_tracks, '#splash#callfortracks'] do
%section#callfortracks
.container
.row
.col-md-12.text-center
%h2

View file

@ -2,9 +2,11 @@
%li
%a.smoothscroll{ href: '#lodging' } Lodging
.container
- cache [@conference.venue, @conference.lodgings, '#splash#lodging'] do
%section#lodging
.container
.row
.col-md-12.text-center
.col-md-12.text-centers
%h2
Where to stay
- if @conference.venue

View file

@ -2,7 +2,9 @@
%li
%a.smoothscroll{ href: '#registration' } Registration
.container
- cache [@conference.registration_period, @conference.tickets, '#splash#registration'] do
%section#registration
.container
.row
.col-md-12.text-center
%h1 Registration

View file

@ -3,7 +3,9 @@
=link_to('#program', class: 'smoothscroll') do
Program
.container
- cache [@confererence, @conference.confirmed_tracks, '#splash#program'] do
%section#program
.container
.row
.col-md-12
%h2.text-center

View file

@ -1,4 +1,6 @@
.container
- cache [@conference.contact, '#splash#social'] do
%section#social-media
.container
.row
.col-md-12.text-center
- unless @conference.contact.facebook.blank?

View file

@ -2,7 +2,10 @@
%li
%a.smoothscroll{ href: '#sponsors' } Sponsors
.container
- cache [@conference, @conference.sponsors, @conference.sponsorship_levels,
@conference.try(:call_for_sponsors), '#splash#sponsors'] do
%section#sponsors
.container
.row
.col-md-12.text-center
%h2 Sponsors

View file

@ -1,4 +1,10 @@
.container
= content_for :splash_nav do
%li
%a.smoothscroll{ href: '#tickets' } Tickets
- cache [@conference, @conference.tickets, '#splash#tickets'] do
%section#tickets
.container
.row
.col-md-12.text-center
%h2
@ -22,4 +28,3 @@
= link_to(conference_tickets_path(@conference.short_title), class: 'btn btn-success') do
Get Ticket
= humanized_money_with_symbol ticket.price

View file

@ -1,9 +1,12 @@
= content_for :splash_nav do
%li
%a.smoothscroll{ href: '#venue' } Venue
-if @conference.venue.location?
- cache [@conference.venue, @conference.venue.commercial, '#splash#venue'] do
%section#venue
-if @conference.venue.location?
= render '/conferences/venue_map'
-else
-else
.container
.row
.col-md-6

View file

@ -11,6 +11,7 @@
= @conference.title
#splash
- cache [@conference, @conference.venue, '#splash#header'] do
#banner
.container
.row
@ -37,49 +38,40 @@
= markdown(@conference.description)
- if @conference.splashpage.include_registrations && @conference.registration_open?
%section#registration
= render 'registration'
- if @conference.splashpage.include_program
%section#program
= render 'schedule_splashpage'
- if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?)
%section#callforpapers
= render 'call_for_paper'
- if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?)
%section#callfortracks
= render 'call_for_tracks'
- if @conference.splashpage.include_venue && @conference.venue
%section#venue
= render 'venue'
- if @conference.splashpage.include_lodgings && @conference.lodgings.any?
%section#lodging
= render 'lodging'
- if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending?
%section#tickets
= render 'tickets'
- if @conference.splashpage.include_booths && @conference.confirmed_booths.any?
%section#booths
= render 'booths'
- if @conference.splashpage.include_sponsors && @conference.sponsors.any?
%section#sponsors
= render 'sponsors'
- if @conference.splashpage.include_social_media && @conference.contact.has_social_media?
%section#social-media
= render 'social_media'
// grmbl
= render 'footer'
- content_for :script_head do
- cache [@conference.color, '#splash#inlinejs'] do
- content_for :script_head do
:javascript
var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic();
var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); });