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,23 +2,25 @@
%li %li
%a.smoothscroll{ href: '#booths' } Booths %a.smoothscroll{ href: '#booths' } Booths
.container - cache [@conference.confirmed_booths, '#splash#booths'] do
.row %section#booths
.col-md-12.text-center .container
%h2 Booths .row
- @conference.confirmed_booths.each_slice(3).with_index do |slice, index_for_row| .col-md-12.text-center
.row.row-centered %h2 Booths
- slice.each.with_index do |booth, index_for_column| - @conference.confirmed_booths.each_slice(3).with_index do |slice, index_for_row|
.col-md-4.col-sm-4.col-xs-10.col-centered.col-top .row.row-centered
.thumbnail - slice.each.with_index do |booth, index_for_column|
- if booth.logo_link .col-md-4.col-sm-4.col-xs-10.col-centered.col-top
= link_to booth.website_url, class: 'thumbnail' do .thumbnail
= image_tag booth.picture.large.url - if booth.logo_link
.caption = link_to booth.website_url, class: 'thumbnail' do
%h3.text-center = image_tag booth.picture.large.url
= booth.title .caption
%p.text-center.text-muted %h3.text-center
= link_to "#show_description_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do = booth.title
learn more %p.text-center.text-muted
.collapse{ id: "show_description_#{index_for_row}_#{index_for_column}" } = link_to "#show_description_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do
= markdown(booth.description) learn more
.collapse{ id: "show_description_#{index_for_row}_#{index_for_column}" }
= markdown(booth.description)

View file

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

View file

@ -2,27 +2,29 @@
%li %li
%a.smoothscroll{ href: '#callfortracks' } Call For Tracks %a.smoothscroll{ href: '#callfortracks' } Call For Tracks
.container - cache [@conference, @conference.call_for_tracks, '#splash#callfortracks'] do
.row %section#callfortracks
.col-md-12.text-center .container
%h2 .row
Call for Tracks .col-md-12.text-center
%p.lead %h2
We are ready to accept requests for tracks! Call for Tracks
.row %p.lead
.col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1 We are ready to accept requests for tracks!
%p .row
The submission period for track requests is open .col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1
%em.notranslate %p
= "#{date_string(@conference.call_for_tracks.start_date, The submission period for track requests is open
@conference.call_for_tracks.end_date)}." %em.notranslate
%b = "#{date_string(@conference.call_for_tracks.start_date,
You have @conference.call_for_tracks.end_date)}."
= pluralize(@conference.call_for_tracks.remaining_days, 'day') %b
left! You have
.row = pluralize(@conference.call_for_tracks.remaining_days, 'day')
.col-md-12.text-center left!
%p.cta-button .row
= link_to("Submit your request for track", .col-md-12.text-center
conference_program_tracks_path(@conference.short_title), %p.cta-button
class: 'btn btn-success btn-lg text-center') = link_to("Submit your request for track",
conference_program_tracks_path(@conference.short_title),
class: 'btn btn-success btn-lg text-center')

View file

@ -2,36 +2,38 @@
%li %li
%a.smoothscroll{ href: '#lodging' } Lodging %a.smoothscroll{ href: '#lodging' } Lodging
.container - cache [@conference.venue, @conference.lodgings, '#splash#lodging'] do
.row %section#lodging
.col-md-12.text-center .container
%h2 .row
Where to stay .col-md-12.text-centers
- if @conference.venue %h2
in Where to stay
= @conference.venue.city - if @conference.venue
%p.lead in
We recommend these affordable lodging accommodations for your visit. = @conference.venue.city
%p.lead
We recommend these affordable lodging accommodations for your visit.
.row.row-centered .row.row-centered
- @conference.lodgings.each do |lodging| - @conference.lodgings.each do |lodging|
.col-md-4.col-sm-4.col-centered.col-top .col-md-4.col-sm-4.col-centered.col-top
.thumbnail .thumbnail
- if lodging.picture? - if lodging.picture?
-if lodging.website_link.present? -if lodging.website_link.present?
= link_to(lodging.website_link, class: 'thumbnail') do = link_to(lodging.website_link, class: 'thumbnail') do
= image_tag lodging.picture.large.url, class: 'img-responsive img-lodging' = image_tag lodging.picture.large.url, class: 'img-responsive img-lodging'
- else - else
= image_tag lodging.picture.large.url, class: 'img-responsive img-lodging' = image_tag lodging.picture.large.url, class: 'img-responsive img-lodging'
- else
%p.text-center
-if lodging.website_link.present?
= link_to(lodging.website_link, class: 'thumbnail') do
%i.fa.fa-home.fa-5x
- else - else
%i.fa.fa-home.fa-5x %p.text-center
.caption -if lodging.website_link.present?
%h3.text-center = link_to(lodging.website_link, class: 'thumbnail') do
= lodging.name %i.fa.fa-home.fa-5x
-if lodging.description.present? - else
= markdown(lodging.description) %i.fa.fa-home.fa-5x
.caption
%h3.text-center
= lodging.name
-if lodging.description.present?
= markdown(lodging.description)

View file

@ -2,29 +2,31 @@
%li %li
%a.smoothscroll{ href: '#registration' } Registration %a.smoothscroll{ href: '#registration' } Registration
.container - cache [@conference.registration_period, @conference.tickets, '#splash#registration'] do
.row %section#registration
.col-md-12.text-center .container
%h1 Registration .row
.col-md-12.text-center
%h1 Registration
- if @conference.registration_limit_exceeded? - if @conference.registration_limit_exceeded?
%p %p
Sorry, the conference registration limit has exceeded Sorry, the conference registration limit has exceeded
- else - else
- if @conference.tickets.empty? - if @conference.tickets.empty?
%p.lead %p.lead
Going to Going to
= @conference.short_title = @conference.short_title
is free of charge. is free of charge.
%p %p
We only ask you to register yourself until We only ask you to register yourself until
= @conference.registration_period.end_date.strftime('%A, %B %-d. %Y') = @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
so we can plan for the right amount of people. so we can plan for the right amount of people.
%p.cta-button %p.cta-button
- else - else
%p %p
The registration period ends on The registration period ends on
= @conference.registration_period.end_date.strftime('%A, %B %-d. %Y') = @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
%p.cta-button %p.cta-button
= link_to(new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-lg btn-success') do = link_to(new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-lg btn-success') do
Register Now Register Now

View file

@ -3,53 +3,55 @@
=link_to('#program', class: 'smoothscroll') do =link_to('#program', class: 'smoothscroll') do
Program Program
.container - cache [@confererence, @conference.confirmed_tracks, '#splash#program'] do
.row %section#program
.col-md-12 .container
%h2.text-center .row
Program .col-md-12
%p.lead.text-center %h2.text-center
%span.notranslate Program
= @conference.title %p.lead.text-center
has the most awesome program ever! %span.notranslate
- if @conference.splashpage.include_tracks && @conference.confirmed_tracks.any? = @conference.title
See rock-star speakers cover the topics of has the most awesome program ever!
- @conference.confirmed_tracks.each_slice(3) do |slice| - if @conference.splashpage.include_tracks && @conference.confirmed_tracks.any?
See rock-star speakers cover the topics of
- @conference.confirmed_tracks.each_slice(3) do |slice|
.row.row-centered
- slice.each do |track|
.col-md-4.col-sm-4.col-centered.col-top.track
%h4.text-center
= track.name
= markdown(track.description)
- if track.start_date
%br
From: #{track.start_date.strftime('%A, %B %-d. %Y')}
- if track.end_date
%br
To: #{track.end_date.strftime('%A, %B %-d. %Y')}
- if track.room
%br
In: #{track.room.name}
- if @conference.program.try(:schedule_public?)
.row
.col-md-12
%p.cta-button.text-center
= link_to(conference_schedule_path(@conference.short_title), class: 'btn btn-default btn-lg') do
Full Schedule
%h3.text-center
Don't miss out!
%br
- if @conference.highlighted_events.any?
.row
.col-md-12
- @conference.highlighted_events.each_slice(2) do |slice|
.row.row-centered .row.row-centered
- slice.each do |track| - slice.each do |event|
.col-md-4.col-sm-4.col-centered.col-top.track .col-md-6.col-centered.col-top.highlights
%h4.text-center %p.text-center
= track.name %b= event.title
= markdown(track.description) %h5.text-center
- if track.start_date = markdown truncate(event.abstract, length: 500, separator: ' ')
%br = link_to "Read More", conference_program_proposal_path(@conference.short_title, event)
From: #{track.start_date.strftime('%A, %B %-d. %Y')}
- if track.end_date
%br
To: #{track.end_date.strftime('%A, %B %-d. %Y')}
- if track.room
%br
In: #{track.room.name}
- if @conference.program.try(:schedule_public?)
.row
.col-md-12
%p.cta-button.text-center
= link_to(conference_schedule_path(@conference.short_title), class: 'btn btn-default btn-lg') do
Full Schedule
%h3.text-center
Don't miss out!
%br
- if @conference.highlighted_events.any?
.row
.col-md-12
- @conference.highlighted_events.each_slice(2) do |slice|
.row.row-centered
- slice.each do |event|
.col-md-6.col-centered.col-top.highlights
%p.text-center
%b= event.title
%h5.text-center
= markdown truncate(event.abstract, length: 500, separator: ' ')
= link_to "Read More", conference_program_proposal_path(@conference.short_title, event)

View file

@ -1,18 +1,20 @@
.container - cache [@conference.contact, '#splash#social'] do
.row %section#social-media
.col-md-12.text-center .container
- unless @conference.contact.facebook.blank? .row
= link_to "#{ @conference.contact.facebook }" do .col-md-12.text-center
%i.fa.fa-facebook-square.fa-4x - unless @conference.contact.facebook.blank?
- unless @conference.contact.twitter.blank? = link_to "#{ @conference.contact.facebook }" do
= link_to "#{ @conference.contact.twitter }" do %i.fa.fa-facebook-square.fa-4x
%i.fa.fa-twitter.fa-4x - unless @conference.contact.twitter.blank?
- unless @conference.contact.instagram.blank? = link_to "#{ @conference.contact.twitter }" do
= link_to "#{ @conference.contact.instagram }" do %i.fa.fa-twitter.fa-4x
%i.fa.fa-instagram.fa-4x - unless @conference.contact.instagram.blank?
- unless @conference.contact.googleplus.blank? = link_to "#{ @conference.contact.instagram }" do
= link_to "#{ @conference.contact.googleplus }" do %i.fa.fa-instagram.fa-4x
%i.fa.fa-google-plus-square.fa-4x - unless @conference.contact.googleplus.blank?
- unless @conference.contact.email.blank? = link_to "#{ @conference.contact.googleplus }" do
= mail_to "#{ @conference.contact.email }" do %i.fa.fa-google-plus-square.fa-4x
%i.fa.fa-envelope-o.fa-4x - unless @conference.contact.email.blank?
= mail_to "#{ @conference.contact.email }" do
%i.fa.fa-envelope-o.fa-4x

View file

@ -2,40 +2,43 @@
%li %li
%a.smoothscroll{ href: '#sponsors' } Sponsors %a.smoothscroll{ href: '#sponsors' } Sponsors
.container - cache [@conference, @conference.sponsors, @conference.sponsorship_levels,
.row @conference.try(:call_for_sponsors), '#splash#sponsors'] do
.col-md-12.text-center %section#sponsors
%h2 Sponsors .container
- @conference.sponsorship_levels.each do |sponsorship_level| .row
-if sponsorship_level.sponsors.any? .col-md-12.text-center
- sponsorship_level.sponsors.each_slice(3) do |slice| %h2 Sponsors
.row.row-centered - @conference.sponsorship_levels.each do |sponsorship_level|
- slice.each do |sponsor| -if sponsorship_level.sponsors.any?
.col-md-4.col-sm-4.col-centered.col-top - sponsorship_level.sponsors.each_slice(3) do |slice|
%a{ href: '#', data: { toggle: 'modal', target: "#modal_#{sponsor.id}" } } .row.row-centered
= image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}" - slice.each do |sponsor|
.col-md-4.col-sm-4.col-centered.col-top
%a{ href: '#', data: { toggle: 'modal', target: "#modal_#{sponsor.id}" } }
= image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}"
.modal.fade{ id: "modal_#{sponsor.id}" } .modal.fade{ id: "modal_#{sponsor.id}" }
.modal-dialog .modal-dialog
.modal-content .modal-content
.modal-header .modal-header
%button.close{ data: { dismiss: 'modal' } } %button.close{ data: { dismiss: 'modal' } }
x x
.modal-title .modal-title
= sponsor.name = sponsor.name
.modal-body.text-center .modal-body.text-center
.logo .logo
= link_to sponsor.website_url, target: '_blank' do = link_to sponsor.website_url, target: '_blank' do
= image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}" = image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}"
.description .description
= sponsor.description = sponsor.description
.modal-footer .modal-footer
= link_to nil, "#{sponsor.website_url}", target: '_blank' = link_to nil, "#{sponsor.website_url}", target: '_blank'
- if @conference.call_for_sponsors.try(:open?) - if @conference.call_for_sponsors.try(:open?)
.row .row
.col-md-12 .col-md-12
%p.text-muted.text-center %p.text-muted.text-center
%small %small
Want to sponsor #{@conference.short_title}? Want to sponsor #{@conference.short_title}?
= link_to("mailto: #{@conference.contact.sponsor_email}?subject=#{@conference.short_title}%20Sponsorship") do = link_to("mailto: #{@conference.contact.sponsor_email}?subject=#{@conference.short_title}%20Sponsorship") do
Please contact us! Please contact us!

View file

@ -1,25 +1,30 @@
.container = content_for :splash_nav do
.row %li
.col-md-12.text-center %a.smoothscroll{ href: '#tickets' } Tickets
%h2
Support
=@conference.short_title
%p.lead
To support our event you can get these tickets
- @conference.tickets.each_slice(4) do |slice|
.row.row-centered
- slice.each do |ticket|
.col-md-3.col-centered.col-top.col-sm-3
.thumbnail
%p.text-center
%i.fa.fa-ticket.fa-5x
.caption
%h3.text-center
= ticket.title
-if ticket.description.present?
= markdown(ticket.description)
%p.text-center
= link_to(conference_tickets_path(@conference.short_title), class: 'btn btn-success') do
Get Ticket
= humanized_money_with_symbol ticket.price
- cache [@conference, @conference.tickets, '#splash#tickets'] do
%section#tickets
.container
.row
.col-md-12.text-center
%h2
Support
=@conference.short_title
%p.lead
To support our event you can get these tickets
- @conference.tickets.each_slice(4) do |slice|
.row.row-centered
- slice.each do |ticket|
.col-md-3.col-centered.col-top.col-sm-3
.thumbnail
%p.text-center
%i.fa.fa-ticket.fa-5x
.caption
%h3.text-center
= ticket.title
-if ticket.description.present?
= markdown(ticket.description)
%p.text-center
= link_to(conference_tickets_path(@conference.short_title), class: 'btn btn-success') do
Get Ticket
= humanized_money_with_symbol ticket.price

View file

@ -1,35 +1,38 @@
= content_for :splash_nav do = content_for :splash_nav do
%li %li
%a.smoothscroll{ href: '#venue' } Venue %a.smoothscroll{ href: '#venue' } Venue
-if @conference.venue.location?
= render '/conferences/venue_map' - cache [@conference.venue, @conference.venue.commercial, '#splash#venue'] do
-else %section#venue
.container -if @conference.venue.location?
.row = render '/conferences/venue_map'
.col-md-6 -else
.thumbnail#venue-pic .container
- if @conference.venue.commercial.present? and @conference.venue.commercial.persisted? .row
.flexvideo{ id: "resource-content-#{@conference.venue.commercial.id}"} .col-md-6
= render partial: 'shared/media_item', locals: { commercial: @conference.venue.commercial } .thumbnail#venue-pic
- elsif @conference.venue.picture? - if @conference.venue.commercial.present? and @conference.venue.commercial.persisted?
= image_tag @conference.venue.picture.url, alt: @conference.venue.name, class:"img-responsive" .flexvideo{ id: "resource-content-#{@conference.venue.commercial.id}"}
- else = render partial: 'shared/media_item', locals: { commercial: @conference.venue.commercial }
%p.text-center - elsif @conference.venue.picture?
%span.fa.fa-university.fa-5x = image_tag @conference.venue.picture.url, alt: @conference.venue.name, class:"img-responsive"
.caption - else
%h3.text-center %p.text-center
= @conference.venue.name %span.fa.fa-university.fa-5x
- unless @conference.venue.description.blank? .caption
= markdown(@conference.venue.description) %h3.text-center
.col-md-6 = @conference.venue.name
%h2 - unless @conference.venue.description.blank?
= "#{@conference.venue.city} / #{@conference.venue.country_name}" = markdown(@conference.venue.description)
%address .col-md-6
= @conference.venue.street %h2
%br = "#{@conference.venue.city} / #{@conference.venue.country_name}"
= "#{@conference.venue.postalcode}, #{@conference.venue.city}" %address
%br = @conference.venue.street
= @conference.venue.country_name %br
- if @conference.venue.website = "#{@conference.venue.postalcode}, #{@conference.venue.city}"
%br %br
=link_to(h(@conference.venue.website), h(@conference.venue.website)).html_safe = @conference.venue.country_name
- if @conference.venue.website
%br
=link_to(h(@conference.venue.website), h(@conference.venue.website)).html_safe

View file

@ -11,87 +11,79 @@
= @conference.title = @conference.title
#splash #splash
#banner - cache [@conference, @conference.venue, '#splash#header'] do
.container #banner
.row
.col-md-8.col-md-offset-2#header
.row
.col-md-4
= image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture?
.col-md-8
%h1
= @conference.title
%p.lead
- if @conference.venue
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
- if @conference.start_date && @conference.end_date
%br
= date_string(@conference.start_date, @conference.end_date)
- unless @conference.description.blank?
%section#about
.container .container
.row .row
.col-md-8.col-md-offset-2 .col-md-8.col-md-offset-2#header
%h3.text-center .row
= markdown(@conference.description) .col-md-4
= image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture?
.col-md-8
%h1
= @conference.title
%p.lead
- if @conference.venue
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
- if @conference.start_date && @conference.end_date
%br
= date_string(@conference.start_date, @conference.end_date)
- unless @conference.description.blank?
%section#about
.container
.row
.col-md-8.col-md-offset-2
%h3.text-center
= markdown(@conference.description)
- if @conference.splashpage.include_registrations && @conference.registration_open? - if @conference.splashpage.include_registrations && @conference.registration_open?
%section#registration = render 'registration'
= render 'registration'
- if @conference.splashpage.include_program - if @conference.splashpage.include_program
%section#program = render 'schedule_splashpage'
= render 'schedule_splashpage'
- if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?)
%section#callforpapers = render 'call_for_paper'
= render 'call_for_paper'
- if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?)
%section#callfortracks = render 'call_for_tracks'
= render 'call_for_tracks'
- if @conference.splashpage.include_venue && @conference.venue - if @conference.splashpage.include_venue && @conference.venue
%section#venue = render 'venue'
= render 'venue'
- if @conference.splashpage.include_lodgings && @conference.lodgings.any? - if @conference.splashpage.include_lodgings && @conference.lodgings.any?
%section#lodging = render 'lodging'
= render 'lodging'
- if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending? - if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending?
%section#tickets = render 'tickets'
= render 'tickets'
- if @conference.splashpage.include_booths && @conference.confirmed_booths.any? - if @conference.splashpage.include_booths && @conference.confirmed_booths.any?
%section#booths = render 'booths'
= render 'booths'
- if @conference.splashpage.include_sponsors && @conference.sponsors.any? - if @conference.splashpage.include_sponsors && @conference.sponsors.any?
%section#sponsors = render 'sponsors'
= render 'sponsors'
- if @conference.splashpage.include_social_media && @conference.contact.has_social_media? - if @conference.splashpage.include_social_media && @conference.contact.has_social_media?
%section#social-media = render 'social_media'
= render 'social_media'
// grmbl // grmbl
= render 'footer' = render 'footer'
- content_for :script_head do - cache [@conference.color, '#splash#inlinejs'] do
:javascript - content_for :script_head do
var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic(); :javascript
var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); }); var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic();
$(function () { var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); });
$(document).ready(function() { $(function () {
var triangle_width = document.body.clientWidth; $(document).ready(function() {
var triangle_height = ($( "#banner" ).height() + 200 ); var triangle_width = document.body.clientWidth;
var pattern = Trianglify({ width: triangle_width, var triangle_height = ($( "#banner" ).height() + 200 );
height: triangle_height, var pattern = Trianglify({ width: triangle_width,
cell_size: 100, height: triangle_height,
x_colors: triangle_colors cell_size: 100,
}); x_colors: triangle_colors
$('#banner').css('background-image', 'url("' + pattern.png() + '")'); });
$('#banner').css('background-image', 'url("' + pattern.png() + '")');
});
}); });
});