Location component splash view
This commit is contained in:
parent
f5c5e6a44b
commit
f0b6c32a54
5 changed files with 63 additions and 2 deletions
|
|
@ -91,3 +91,17 @@ body {
|
||||||
#submissions {
|
#submissions {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#location{
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center center;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 500px;
|
||||||
|
background-size: cover;
|
||||||
|
-webkit-background-size:cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
#location li{
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 2em;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
= f.input :address, :input_html => {:rows => 1}
|
= f.input :address, :input_html => {:rows => 1}
|
||||||
= f.input :website
|
= f.input :website
|
||||||
= f.input :description, :input_html => { :rows => 10, :cols => 20 }
|
= f.input :description, :input_html => { :rows => 10, :cols => 20 }
|
||||||
- if !@venue.photo.blank?
|
- unless @venue.photo.blank?
|
||||||
= image_tag @venue.photo(:thumb)
|
= image_tag @venue.photo(:thumb)
|
||||||
= f.input :photo
|
= f.input :photo
|
||||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
||||||
|
|
|
||||||
35
app/views/conference/_location.html.haml
Normal file
35
app/views/conference/_location.html.haml
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
= content_for :splash_nav do
|
||||||
|
%li
|
||||||
|
%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
|
||||||
|
- 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'
|
||||||
|
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
$(document).ready(function(){
|
||||||
|
var photo = "#{@conference.venue.photo}";
|
||||||
|
if(photo)
|
||||||
|
{
|
||||||
|
$('#location').css('background-image', 'url('+photo+')');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -10,6 +10,9 @@
|
||||||
-unless @conference.call_for_papers.blank?
|
-unless @conference.call_for_papers.blank?
|
||||||
%div#callforpapers
|
%div#callforpapers
|
||||||
= render 'call_for_papers'
|
= render 'call_for_papers'
|
||||||
|
-unless @conference.venue.blank?
|
||||||
|
%div#location
|
||||||
|
= render 'location'
|
||||||
%div#sponsors
|
%div#sponsors
|
||||||
= render 'sponsor'
|
= render 'sponsor'
|
||||||
%div#social-media
|
%div#social-media
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ describe 'conference/show.html.haml' do
|
||||||
@sponsorship_level = @conference.sponsorship_levels.first
|
@sponsorship_level = @conference.sponsorship_levels.first
|
||||||
@sponsorship_level.sponsors << create(:sponsor, sponsorship_level: @sponsorship_level,
|
@sponsorship_level.sponsors << create(:sponsor, sponsorship_level: @sponsorship_level,
|
||||||
conference: @conference)
|
conference: @conference)
|
||||||
|
@conference.venue = create(:venue)
|
||||||
assign :conference, @conference
|
assign :conference, @conference
|
||||||
render
|
render
|
||||||
end
|
end
|
||||||
|
|
@ -51,4 +52,12 @@ describe 'conference/show.html.haml' do
|
||||||
expect(rendered).to include('http://www.google-example.com')
|
expect(rendered).to include('http://www.google-example.com')
|
||||||
expect(rendered).to include('http://youtu.be/rtyutut')
|
expect(rendered).to include('http://youtu.be/rtyutut')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'renders location partial' do
|
||||||
|
expect(view).to render_template(partial: 'conference/_location')
|
||||||
|
expect(rendered).to include('Suse Office')
|
||||||
|
expect(rendered).to include('Maxfeldstrasse 5 \n90409 Nuremberg')
|
||||||
|
expect(rendered).to include('www.opensuse.org')
|
||||||
|
expect(rendered).to include('Lorem Ipsum Dolor')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue