Adds lodging splash view

Check for venue photo before rendering
This commit is contained in:
Gopesh Tulsyan 2014-06-14 23:37:12 +05:30
parent 01bd45a045
commit 0b6b046016
4 changed files with 38 additions and 8 deletions

View file

@ -25,11 +25,12 @@
= link_to 'Visit Venue Website', @conference.venue.website, target: '_blank'
:javascript
$(document).ready(function(){
var photo = "#{@conference.venue.photo}";
if(photo)
{
$('#location').css('background-image', 'url('+photo+')');
}
});
- unless @conference.venue.photo.blank?
:javascript
$(document).ready(function(){
var photo = "#{@conference.venue.photo}";
if(photo)
{
$('#location').css('background-image', 'url('+photo+')');
}
});

View file

@ -0,0 +1,18 @@
%div.row.col-md-12.text-center
%h2 Lodgings
-unless @conference.lodging_description.blank?
%p.lead
= @conference.lodging_description
%div.row
- @conference.venue.lodgings.each do |r|
%div.col-md-3.thumbnail
-unless r.photo.blank?
= image_tag r.photo(:large), class: 'img-responsive'
-unless r.name.blank?
%h4.text-center #{ r.name }
-unless r.description.blank?
%p.text-left #{ r.description }
- unless r.website_link.blank?
.text-center
= link_to 'Go to Website', r.website_link

View file

@ -13,6 +13,9 @@
-unless @conference.venue.blank?
%div#location
= render 'location'
- if @conference.venue
- unless @conference.venue.lodgings.empty?
= render 'lodging'
%div#sponsors
= render 'sponsor'
%div#social-media