Location Component

This commit is contained in:
Gopesh Tulsyan 2014-06-02 20:48:56 +05:30
parent 069cc0eb4c
commit b1c171cd97
12 changed files with 119 additions and 19 deletions

View file

@ -5,4 +5,7 @@
= f.input :address, :input_html => {:rows => 1}
= f.input :website
= f.input :description, :input_html => { :rows => 10, :cols => 20 }
- if !@venue.photo.blank?
= image_tag @venue.photo(:thumb)
= f.input :photo
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -0,0 +1,36 @@
= content_for :splash_nav do
%li
%a{ href: '#location' } Location
%div#location
%div.container.text-center
.div.row.col-md-12
- if !@conference.venue.name.blank?
%h1
%strong #{ @conference.venue.name }
- if !@conference.venue.address.blank?
%h2
%strong #{ @conference.venue.address }
- if !@conference.venue.description.blank?
%p
%strong #{ @conference.venue.description }
%ul
- if !@conference.venue.address.blank?
%li
%b
= link_to 'View in Google Maps', "http://maps.google.com/maps?q=#{@conference.venue.address}", target: '_blank'
- if !@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+')');
}
});

View file

@ -1,9 +1,23 @@
= content_for :brand do
= link_to @conference.title, conference_url(@conference.short_title), class: 'navbar-brand'
%div#program
= render 'program'
%div#registration
= render 'registration'
%div#callforpapers
= render 'call_for_papers'
%div#location
= render 'location'
:javascript
$(document).ready(function(){
$('#content').removeClass('container');
});

View file

@ -2,4 +2,4 @@
.col-md-12.page-header
%h2.text-center Upcoming Conferences
- @current.each do |conference|
= render :partial => "conference_details", :locals => {:conference => conference}
= render :partial => "conference_details", :locals => {:conference => conference}