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

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,27 +2,29 @@
%li
%a.smoothscroll{ href: '#callfortracks' } Call For Tracks
.container
.row
.col-md-12.text-center
%h2
Call for Tracks
%p.lead
We are ready to accept requests for tracks!
.row
.col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1
%p
The submission period for track requests is open
%em.notranslate
= "#{date_string(@conference.call_for_tracks.start_date,
@conference.call_for_tracks.end_date)}."
%b
You have
= pluralize(@conference.call_for_tracks.remaining_days, 'day')
left!
.row
.col-md-12.text-center
%p.cta-button
= link_to("Submit your request for track",
conference_program_tracks_path(@conference.short_title),
class: 'btn btn-success btn-lg text-center')
- cache [@conference, @conference.call_for_tracks, '#splash#callfortracks'] do
%section#callfortracks
.container
.row
.col-md-12.text-center
%h2
Call for Tracks
%p.lead
We are ready to accept requests for tracks!
.row
.col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1
%p
The submission period for track requests is open
%em.notranslate
= "#{date_string(@conference.call_for_tracks.start_date,
@conference.call_for_tracks.end_date)}."
%b
You have
= pluralize(@conference.call_for_tracks.remaining_days, 'day')
left!
.row
.col-md-12.text-center
%p.cta-button
= 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
%a.smoothscroll{ href: '#lodging' } Lodging
.container
.row
.col-md-12.text-center
%h2
Where to stay
- if @conference.venue
in
= @conference.venue.city
%p.lead
We recommend these affordable lodging accommodations for your visit.
- cache [@conference.venue, @conference.lodgings, '#splash#lodging'] do
%section#lodging
.container
.row
.col-md-12.text-centers
%h2
Where to stay
- if @conference.venue
in
= @conference.venue.city
%p.lead
We recommend these affordable lodging accommodations for your visit.
.row.row-centered
- @conference.lodgings.each do |lodging|
.col-md-4.col-sm-4.col-centered.col-top
.thumbnail
- if lodging.picture?
-if lodging.website_link.present?
= link_to(lodging.website_link, class: 'thumbnail') do
= image_tag lodging.picture.large.url, class: 'img-responsive img-lodging'
- else
= 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
.row.row-centered
- @conference.lodgings.each do |lodging|
.col-md-4.col-sm-4.col-centered.col-top
.thumbnail
- if lodging.picture?
-if lodging.website_link.present?
= link_to(lodging.website_link, class: 'thumbnail') do
= image_tag lodging.picture.large.url, class: 'img-responsive img-lodging'
- else
= image_tag lodging.picture.large.url, class: 'img-responsive img-lodging'
- else
%i.fa.fa-home.fa-5x
.caption
%h3.text-center
= lodging.name
-if lodging.description.present?
= markdown(lodging.description)
%p.text-center
-if lodging.website_link.present?
= link_to(lodging.website_link, class: 'thumbnail') do
%i.fa.fa-home.fa-5x
- else
%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
%a.smoothscroll{ href: '#registration' } Registration
.container
.row
.col-md-12.text-center
%h1 Registration
- cache [@conference.registration_period, @conference.tickets, '#splash#registration'] do
%section#registration
.container
.row
.col-md-12.text-center
%h1 Registration
- if @conference.registration_limit_exceeded?
%p
Sorry, the conference registration limit has exceeded
- else
- if @conference.tickets.empty?
%p.lead
Going to
= @conference.short_title
is free of charge.
%p
We only ask you to register yourself until
= @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
so we can plan for the right amount of people.
%p.cta-button
- else
%p
The registration period ends on
= @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
%p.cta-button
= link_to(new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-lg btn-success') do
Register Now
- if @conference.registration_limit_exceeded?
%p
Sorry, the conference registration limit has exceeded
- else
- if @conference.tickets.empty?
%p.lead
Going to
= @conference.short_title
is free of charge.
%p
We only ask you to register yourself until
= @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
so we can plan for the right amount of people.
%p.cta-button
- else
%p
The registration period ends on
= @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
%p.cta-button
= link_to(new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-lg btn-success') do
Register Now

View file

@ -3,53 +3,55 @@
=link_to('#program', class: 'smoothscroll') do
Program
.container
.row
.col-md-12
%h2.text-center
Program
%p.lead.text-center
%span.notranslate
= @conference.title
has the most awesome program ever!
- 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|
- cache [@confererence, @conference.confirmed_tracks, '#splash#program'] do
%section#program
.container
.row
.col-md-12
%h2.text-center
Program
%p.lead.text-center
%span.notranslate
= @conference.title
has the most awesome program ever!
- 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
- 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
- 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)
- 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
.row
.col-md-12.text-center
- unless @conference.contact.facebook.blank?
= link_to "#{ @conference.contact.facebook }" do
%i.fa.fa-facebook-square.fa-4x
- unless @conference.contact.twitter.blank?
= link_to "#{ @conference.contact.twitter }" do
%i.fa.fa-twitter.fa-4x
- unless @conference.contact.instagram.blank?
= link_to "#{ @conference.contact.instagram }" do
%i.fa.fa-instagram.fa-4x
- unless @conference.contact.googleplus.blank?
= link_to "#{ @conference.contact.googleplus }" do
%i.fa.fa-google-plus-square.fa-4x
- unless @conference.contact.email.blank?
= mail_to "#{ @conference.contact.email }" do
%i.fa.fa-envelope-o.fa-4x
- cache [@conference.contact, '#splash#social'] do
%section#social-media
.container
.row
.col-md-12.text-center
- unless @conference.contact.facebook.blank?
= link_to "#{ @conference.contact.facebook }" do
%i.fa.fa-facebook-square.fa-4x
- unless @conference.contact.twitter.blank?
= link_to "#{ @conference.contact.twitter }" do
%i.fa.fa-twitter.fa-4x
- unless @conference.contact.instagram.blank?
= link_to "#{ @conference.contact.instagram }" do
%i.fa.fa-instagram.fa-4x
- unless @conference.contact.googleplus.blank?
= link_to "#{ @conference.contact.googleplus }" do
%i.fa.fa-google-plus-square.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
%a.smoothscroll{ href: '#sponsors' } Sponsors
.container
.row
.col-md-12.text-center
%h2 Sponsors
- @conference.sponsorship_levels.each do |sponsorship_level|
-if sponsorship_level.sponsors.any?
- sponsorship_level.sponsors.each_slice(3) do |slice|
.row.row-centered
- 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}"
- 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
- @conference.sponsorship_levels.each do |sponsorship_level|
-if sponsorship_level.sponsors.any?
- sponsorship_level.sponsors.each_slice(3) do |slice|
.row.row-centered
- 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-dialog
.modal-content
.modal-header
%button.close{ data: { dismiss: 'modal' } }
x
.modal-title
= sponsor.name
.modal-body.text-center
.logo
= link_to sponsor.website_url, target: '_blank' do
= image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}"
.description
= sponsor.description
.modal-footer
= link_to nil, "#{sponsor.website_url}", target: '_blank'
- if @conference.call_for_sponsors.try(:open?)
.row
.col-md-12
%p.text-muted.text-center
%small
Want to sponsor #{@conference.short_title}?
= link_to("mailto: #{@conference.contact.sponsor_email}?subject=#{@conference.short_title}%20Sponsorship") do
Please contact us!
.modal.fade{ id: "modal_#{sponsor.id}" }
.modal-dialog
.modal-content
.modal-header
%button.close{ data: { dismiss: 'modal' } }
x
.modal-title
= sponsor.name
.modal-body.text-center
.logo
= link_to sponsor.website_url, target: '_blank' do
= image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}"
.description
= sponsor.description
.modal-footer
= link_to nil, "#{sponsor.website_url}", target: '_blank'
- if @conference.call_for_sponsors.try(:open?)
.row
.col-md-12
%p.text-muted.text-center
%small
Want to sponsor #{@conference.short_title}?
= link_to("mailto: #{@conference.contact.sponsor_email}?subject=#{@conference.short_title}%20Sponsorship") do
Please contact us!

View file

@ -1,25 +1,30 @@
.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
= 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
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
%li
%a.smoothscroll{ href: '#venue' } Venue
-if @conference.venue.location?
= render '/conferences/venue_map'
-else
.container
.row
.col-md-6
.thumbnail#venue-pic
- if @conference.venue.commercial.present? and @conference.venue.commercial.persisted?
.flexvideo{ id: "resource-content-#{@conference.venue.commercial.id}"}
= render partial: 'shared/media_item', locals: { commercial: @conference.venue.commercial }
- elsif @conference.venue.picture?
= image_tag @conference.venue.picture.url, alt: @conference.venue.name, class:"img-responsive"
- else
%p.text-center
%span.fa.fa-university.fa-5x
.caption
%h3.text-center
= @conference.venue.name
- unless @conference.venue.description.blank?
= markdown(@conference.venue.description)
.col-md-6
%h2
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
%address
= @conference.venue.street
%br
= "#{@conference.venue.postalcode}, #{@conference.venue.city}"
%br
= @conference.venue.country_name
- if @conference.venue.website
%br
=link_to(h(@conference.venue.website), h(@conference.venue.website)).html_safe
- cache [@conference.venue, @conference.venue.commercial, '#splash#venue'] do
%section#venue
-if @conference.venue.location?
= render '/conferences/venue_map'
-else
.container
.row
.col-md-6
.thumbnail#venue-pic
- if @conference.venue.commercial.present? and @conference.venue.commercial.persisted?
.flexvideo{ id: "resource-content-#{@conference.venue.commercial.id}"}
= render partial: 'shared/media_item', locals: { commercial: @conference.venue.commercial }
- elsif @conference.venue.picture?
= image_tag @conference.venue.picture.url, alt: @conference.venue.name, class:"img-responsive"
- else
%p.text-center
%span.fa.fa-university.fa-5x
.caption
%h3.text-center
= @conference.venue.name
- unless @conference.venue.description.blank?
= markdown(@conference.venue.description)
.col-md-6
%h2
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
%address
= @conference.venue.street
%br
= "#{@conference.venue.postalcode}, #{@conference.venue.city}"
%br
= @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
#splash
#banner
.container
.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
- cache [@conference, @conference.venue, '#splash#header'] do
#banner
.container
.row
.col-md-8.col-md-offset-2
%h3.text-center
= markdown(@conference.description)
.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
.row
.col-md-8.col-md-offset-2
%h3.text-center
= markdown(@conference.description)
- if @conference.splashpage.include_registrations && @conference.registration_open?
%section#registration
= render 'registration'
= render 'registration'
- if @conference.splashpage.include_program
%section#program
= render 'schedule_splashpage'
= render 'schedule_splashpage'
- 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?)
%section#callfortracks
= render 'call_for_tracks'
= render 'call_for_tracks'
- if @conference.splashpage.include_venue && @conference.venue
%section#venue
= render 'venue'
= render 'venue'
- if @conference.splashpage.include_lodgings && @conference.lodgings.any?
%section#lodging
= render 'lodging'
= render 'lodging'
- 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?
%section#booths
= render 'booths'
= render 'booths'
- 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?
%section#social-media
= render 'social_media'
= render 'social_media'
// grmbl
= render 'footer'
- 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(); });
$(function () {
$(document).ready(function() {
var triangle_width = document.body.clientWidth;
var triangle_height = ($( "#banner" ).height() + 200 );
var pattern = Trianglify({ width: triangle_width,
height: triangle_height,
cell_size: 100,
x_colors: triangle_colors
});
$('#banner').css('background-image', 'url("' + pattern.png() + '")');
- 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(); });
$(function () {
$(document).ready(function() {
var triangle_width = document.body.clientWidth;
var triangle_height = ($( "#banner" ).height() + 200 );
var pattern = Trianglify({ width: triangle_width,
height: triangle_height,
cell_size: 100,
x_colors: triangle_colors
});
$('#banner').css('background-image', 'url("' + pattern.png() + '")');
});
});
});