From f4b869c1297652ced7f8258cd51a754febec7b9e Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 21 Nov 2017 09:54:27 -0800 Subject: [PATCH] Use fragment caching on the splashpage --- app/views/conferences/_booths.html.haml | 42 +++---- .../conferences/_call_for_paper.html.haml | 5 +- .../conferences/_call_for_tracks.html.haml | 50 +++++---- app/views/conferences/_lodging.html.haml | 64 ++++++----- app/views/conferences/_registration.html.haml | 52 ++++----- .../_schedule_splashpage.html.haml | 100 +++++++++-------- app/views/conferences/_social_media.html.haml | 38 ++++--- app/views/conferences/_sponsors.html.haml | 75 +++++++------ app/views/conferences/_tickets.html.haml | 53 +++++---- app/views/conferences/_venue.html.haml | 67 +++++------ app/views/conferences/show.html.haml | 106 ++++++++---------- 11 files changed, 335 insertions(+), 317 deletions(-) diff --git a/app/views/conferences/_booths.html.haml b/app/views/conferences/_booths.html.haml index 39dc9253..fd9db04f 100644 --- a/app/views/conferences/_booths.html.haml +++ b/app/views/conferences/_booths.html.haml @@ -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) diff --git a/app/views/conferences/_call_for_paper.html.haml b/app/views/conferences/_call_for_paper.html.haml index 2dbd2ecd..9d8188fa 100644 --- a/app/views/conferences/_call_for_paper.html.haml +++ b/app/views/conferences/_call_for_paper.html.haml @@ -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 diff --git a/app/views/conferences/_call_for_tracks.html.haml b/app/views/conferences/_call_for_tracks.html.haml index c457880d..e627fca8 100644 --- a/app/views/conferences/_call_for_tracks.html.haml +++ b/app/views/conferences/_call_for_tracks.html.haml @@ -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') diff --git a/app/views/conferences/_lodging.html.haml b/app/views/conferences/_lodging.html.haml index a9754190..006978d3 100644 --- a/app/views/conferences/_lodging.html.haml +++ b/app/views/conferences/_lodging.html.haml @@ -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) diff --git a/app/views/conferences/_registration.html.haml b/app/views/conferences/_registration.html.haml index 5614bdba..9db1f280 100644 --- a/app/views/conferences/_registration.html.haml +++ b/app/views/conferences/_registration.html.haml @@ -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 diff --git a/app/views/conferences/_schedule_splashpage.html.haml b/app/views/conferences/_schedule_splashpage.html.haml index 10584bcb..cccbe929 100644 --- a/app/views/conferences/_schedule_splashpage.html.haml +++ b/app/views/conferences/_schedule_splashpage.html.haml @@ -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) diff --git a/app/views/conferences/_social_media.html.haml b/app/views/conferences/_social_media.html.haml index b072423f..4d3a5c4f 100644 --- a/app/views/conferences/_social_media.html.haml +++ b/app/views/conferences/_social_media.html.haml @@ -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 diff --git a/app/views/conferences/_sponsors.html.haml b/app/views/conferences/_sponsors.html.haml index 94da9940..5f961acd 100644 --- a/app/views/conferences/_sponsors.html.haml +++ b/app/views/conferences/_sponsors.html.haml @@ -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! diff --git a/app/views/conferences/_tickets.html.haml b/app/views/conferences/_tickets.html.haml index 8a202295..d06218ce 100644 --- a/app/views/conferences/_tickets.html.haml +++ b/app/views/conferences/_tickets.html.haml @@ -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 diff --git a/app/views/conferences/_venue.html.haml b/app/views/conferences/_venue.html.haml index 4436b0fe..0c7ef254 100644 --- a/app/views/conferences/_venue.html.haml +++ b/app/views/conferences/_venue.html.haml @@ -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 diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index c6a7fd54..65a3b629 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -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() + '")'); + }); }); - });