From 760dd06d3187241dd00b2adc5880200b20d5c600 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Wed, 11 Jun 2014 00:03:48 +0530 Subject: [PATCH] Adds carousel to splash view --- app/assets/stylesheets/osem.css | 9 +++++++++ app/views/conference/_carousel.html.haml | 19 +++++++++++++++++++ app/views/conference/show.html.haml | 3 +++ 3 files changed, 31 insertions(+) create mode 100644 app/views/conference/_carousel.html.haml diff --git a/app/assets/stylesheets/osem.css b/app/assets/stylesheets/osem.css index 396957dd..25f6fb68 100644 --- a/app/assets/stylesheets/osem.css +++ b/app/assets/stylesheets/osem.css @@ -83,3 +83,12 @@ body { .top-submitter img { margin: 0 auto; } + +#gallery-carousel .item img{ + height: 700px; + background-repeat: no-repeat; + background-position: center center; + width: 100%; + background-size: cover; + -webkit-background-size:cover; +} diff --git a/app/views/conference/_carousel.html.haml b/app/views/conference/_carousel.html.haml new file mode 100644 index 00000000..98da7299 --- /dev/null +++ b/app/views/conference/_carousel.html.haml @@ -0,0 +1,19 @@ +%div#gallery-carousel.carousel.slide{"data-ride" => "carousel"} + / Indicators + %ol.carousel-indicators + - @conference.photos.each_with_index do |p,i| + %li{"data-slide-to" => "#{i}", "data-target" => "#gallery-carousel", class: i==0 ? "active": "" } + / Wrapper for slides + .carousel-inner + - @conference.photos.each_with_index do |p,i| + %div{ class: i==0 ? "active item": "item" } + = image_tag(p.picture(:original), class: 'img-responsive') + - unless p.description.blank? + %div.carousel-caption + %p.text-center + = p.description + / Controls + %a.left.carousel-control{"data-slide" => "prev", href: "#gallery-carousel"} + %span.glyphicon.glyphicon-chevron-left + %a.right.carousel-control{"data-slide" => "next", href: "#gallery-carousel"} + %span.glyphicon.glyphicon-chevron-right diff --git a/app/views/conference/show.html.haml b/app/views/conference/show.html.haml index cbadd6d3..2f911bc4 100644 --- a/app/views/conference/show.html.haml +++ b/app/views/conference/show.html.haml @@ -1,5 +1,8 @@ = content_for :brand do = link_to @conference.title, conference_url(@conference.short_title), class: 'navbar-brand' +- unless @conference.photos.blank? + %div + = render 'carousel' %div#program = render 'program' %div#registration