From 8aab1d36553fb874d47a8a964f6a82a51c744370 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Sat, 14 Jun 2014 23:37:12 +0530 Subject: [PATCH 1/3] Added basic styling for each component --- app/assets/stylesheets/osem.css | 10 ++++-- app/views/conference/_location.html.haml | 42 +++++++++++++----------- app/views/conference/show.html.haml | 25 ++++++++++---- 3 files changed, 47 insertions(+), 30 deletions(-) diff --git a/app/assets/stylesheets/osem.css b/app/assets/stylesheets/osem.css index 5b578615..dcfd19c8 100644 --- a/app/assets/stylesheets/osem.css +++ b/app/assets/stylesheets/osem.css @@ -92,16 +92,20 @@ body { padding-bottom: 20px; } -#location{ +#venue-banner-disp{ background-repeat: no-repeat; background-position: center center; width: 100%; - min-height: 500px; background-size: cover; -webkit-background-size:cover; } -#location li{ +#venue-banner-disp li{ display: inline-block; margin-right: 2em; } + +.pad{ + padding-top: 35px; + padding-bottom: 35px; +} diff --git a/app/views/conference/_location.html.haml b/app/views/conference/_location.html.haml index ed5a7dfe..3b0c33cf 100644 --- a/app/views/conference/_location.html.haml +++ b/app/views/conference/_location.html.haml @@ -3,26 +3,27 @@ %a{ href: '#location' } Location -%div.container.text-center - .div.row.col-md-12 - - unless @conference.venue.name.blank? - %h1 - %strong #{ @conference.venue.name } - - unless @conference.venue.address.blank? - %h2 - %strong #{ @conference.venue.address } - - unless @conference.venue.description.blank? - %p - %strong #{ @conference.venue.description } - %ul +%div#venue-banner-disp + %div.container.text-center + .div.row.col-md-12 + - unless @conference.venue.name.blank? + %h1 + %strong #{ @conference.venue.name } - unless @conference.venue.address.blank? - %li - %b - = link_to 'View in Google Maps', "http://maps.google.com/maps?q=#{@conference.venue.address}", target: '_blank' - - unless @conference.venue.website.blank? - %li - %b - = link_to 'Visit Venue Website', @conference.venue.website, target: '_blank' + %h2 + %strong #{ @conference.venue.address } + - unless @conference.venue.description.blank? + %p + %strong #{ @conference.venue.description } + %ul + - unless @conference.venue.address.blank? + %li + %b + = link_to 'View in Google Maps', "http://maps.google.com/maps?q=#{@conference.venue.address}", target: '_blank' + - unless @conference.venue.website.blank? + %li + %b + = link_to 'Visit Venue Website', @conference.venue.website, target: '_blank' - unless @conference.venue.photo.blank? @@ -31,6 +32,7 @@ var photo = "#{@conference.venue.photo}"; if(photo) { - $('#location').css('background-image', 'url('+photo+')'); + $('#venue-banner-disp').css('min-height','500px'); + $('#venue-banner-disp').css('background-image', 'url('+photo+')'); } }); diff --git a/app/views/conference/show.html.haml b/app/views/conference/show.html.haml index 330da61f..5245006c 100644 --- a/app/views/conference/show.html.haml +++ b/app/views/conference/show.html.haml @@ -3,20 +3,31 @@ - unless @conference.description.blank? %p= @conference.description -%div#program - = render 'program' -%div#registration + %section{ id: 'program' } + .pad + = render 'program' + +%section{ id: 'registration' } +.pad = render 'registration' + -unless @conference.call_for_papers.blank? - %div#callforpapers + %section{ id:'callforpapers' } + .pad = render 'call_for_papers' -unless @conference.venue.blank? - %div#location + %section{ id: 'location' } + .pad = render 'location' - if @conference.venue - unless @conference.venue.lodgings.empty? = render 'lodging' -%div#sponsors + +%section{ id: 'sponsors' } +.pad = render 'sponsor' -%div#social-media + +%section{ id: 'social-media' } +.pad = render 'social_media' + From bebcc5042aa1c1562874c82fea2892972ebc8afe Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Mon, 16 Jun 2014 23:55:11 +0530 Subject: [PATCH 2/3] Dropped Js function for styling --- app/assets/stylesheets/osem.css | 3 +++ app/views/conference/_location.html.haml | 14 +------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/osem.css b/app/assets/stylesheets/osem.css index dcfd19c8..19c8e07c 100644 --- a/app/assets/stylesheets/osem.css +++ b/app/assets/stylesheets/osem.css @@ -99,6 +99,9 @@ body { background-size: cover; -webkit-background-size:cover; } +#venue-banner-disp.with-background{ + min-height: 500px; +} #venue-banner-disp li{ display: inline-block; diff --git a/app/views/conference/_location.html.haml b/app/views/conference/_location.html.haml index 3b0c33cf..48c90da3 100644 --- a/app/views/conference/_location.html.haml +++ b/app/views/conference/_location.html.haml @@ -3,7 +3,7 @@ %a{ href: '#location' } Location -%div#venue-banner-disp +%div#venue-banner-disp{ style: ("background-image: url(#{@conference.venue.photo})" if @conference.venue.photo), class:('with-background' if @conference.venue.photo) } %div.container.text-center .div.row.col-md-12 - unless @conference.venue.name.blank? @@ -24,15 +24,3 @@ %li %b = link_to 'Visit Venue Website', @conference.venue.website, target: '_blank' - - -- unless @conference.venue.photo.blank? - :javascript - $(document).ready(function(){ - var photo = "#{@conference.venue.photo}"; - if(photo) - { - $('#venue-banner-disp').css('min-height','500px'); - $('#venue-banner-disp').css('background-image', 'url('+photo+')'); - } - }); From 628f9438d93e1f76344cfca3b97dd862f14bd9b2 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Tue, 17 Jun 2014 00:15:39 +0530 Subject: [PATCH 3/3] changed if to unless in rendering css conditionally --- app/views/conference/_location.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/conference/_location.html.haml b/app/views/conference/_location.html.haml index 48c90da3..c98e9fd1 100644 --- a/app/views/conference/_location.html.haml +++ b/app/views/conference/_location.html.haml @@ -3,7 +3,7 @@ %a{ href: '#location' } Location -%div#venue-banner-disp{ style: ("background-image: url(#{@conference.venue.photo})" if @conference.venue.photo), class:('with-background' if @conference.venue.photo) } +%div#venue-banner-disp{ style: ("background-image: url(#{@conference.venue.photo})" unless @conference.venue.photo.blank?), class:('with-background' unless @conference.venue.photo.blank?) } %div.container.text-center .div.row.col-md-12 - unless @conference.venue.name.blank?