Merge c1063645da into 17427c88fe
This commit is contained in:
commit
78d5bd670d
28 changed files with 333 additions and 22 deletions
|
|
@ -83,3 +83,17 @@ body {
|
|||
.top-submitter img {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
|
|
|
|||
23
app/controllers/admin/lodgings_controller.rb
Normal file
23
app/controllers/admin/lodgings_controller.rb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
module Admin
|
||||
class LodgingsController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
|
||||
def index
|
||||
@venue = @conference.venue
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def update
|
||||
@venue = @conference.venue
|
||||
if @venue.update_attributes(params[:venue])
|
||||
redirect_to(admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
notice: 'Lodgings were successfully updated.')
|
||||
else
|
||||
redirect_to(admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
notice: 'Lodgings Updation Failed!')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -6,13 +6,13 @@ class Admin::VenueController < ApplicationController
|
|||
|
||||
def update
|
||||
@venue = @conference.venue
|
||||
venue_params = params[:venue]
|
||||
@venue.name = venue_params[:name]
|
||||
@venue.address= venue_params[:address]
|
||||
@venue.website = venue_params[:website]
|
||||
@venue.description = venue_params[:description]
|
||||
@venue.save
|
||||
redirect_to(admin_conference_venue_info_path(:conference_id => @conference.short_title), :notice => 'Venue was successfully updated.')
|
||||
if @venue.update_attributes!(params[:venue])
|
||||
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
||||
notice: 'Venue was successfully updated.')
|
||||
else
|
||||
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
||||
notice: 'Venue Updation Failed!')
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ class Conference < ActiveRecord::Base
|
|||
:difficulty_levels_attributes, :use_difficulty_levels,
|
||||
:use_vpositions, :use_vdays, :vdays_attributes, :vpositions_attributes, :use_volunteers,
|
||||
:media_id, :media_type, :color, :description,
|
||||
:registration_description, :ticket_description
|
||||
:registration_description, :ticket_description,
|
||||
:lodging_description
|
||||
|
||||
has_paper_trail
|
||||
|
||||
|
|
|
|||
10
app/models/lodging.rb
Normal file
10
app/models/lodging.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class Lodging < ActiveRecord::Base
|
||||
attr_accessible :name, :description, :photo, :website_link
|
||||
belongs_to :venue
|
||||
has_attached_file :photo,
|
||||
styles: { thumb: '100x100>', large: '300x300>' }
|
||||
|
||||
validates_attachment_content_type :photo,
|
||||
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
||||
size: { in: 0..500.kilobytes }
|
||||
end
|
||||
|
|
@ -1,7 +1,16 @@
|
|||
class Venue < ActiveRecord::Base
|
||||
attr_accessible :name, :description, :website, :address, :photo, :lodgings_attributes
|
||||
has_many :conferences
|
||||
has_many :lodgings
|
||||
before_create :generate_guid
|
||||
has_attached_file :photo,
|
||||
styles: { thumb: '100x100>', large: '300x300>' }
|
||||
|
||||
validates_attachment_content_type :photo,
|
||||
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
||||
size: { in: 0..500.kilobytes }
|
||||
accepts_nested_attributes_for :lodgings, reject_if: proc { |r| r['name'].blank? },
|
||||
allow_destroy: true
|
||||
private
|
||||
|
||||
def generate_guid
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
= f.input :registration_end_date, :as => :string, :input_html => { :id => "conference-reg-end-datepicker", :readonly => "readonly" }
|
||||
= f.input :registration_description, hint: 'This description will appear in registration segment of the splash'
|
||||
= f.input :ticket_description, hint: 'This will appear in the Tickets segment of the splash'
|
||||
|
||||
= f.input :lodging_description, hint: 'This will appear in the lodging segement of the splash'
|
||||
= f.inputs :name => "Media" do
|
||||
- if !@conference.logo.blank?
|
||||
= image_tag @conference.logo(:thumb)
|
||||
|
|
|
|||
11
app/views/admin/lodgings/_lodging_fields.html.erb
Normal file
11
app/views/admin/lodgings/_lodging_fields.html.erb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<div class="nested-fields">
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :description, :input_html => {:rows => 2 }, hint: 'Write about the hotel/place,
|
||||
of what they are offering, about types of rooms, prices and address' %>
|
||||
<%= image_tag f.object.photo(:thumb) if !f.object.photo.blank? %>
|
||||
<%= f.input :photo %>
|
||||
<%= f.input :website_link %>
|
||||
<%= remove_association_link :lodging, f %>
|
||||
<% end %>
|
||||
</div>
|
||||
5
app/views/admin/lodgings/index.html.haml
Normal file
5
app/views/admin/lodgings/index.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(@venue, :url => admin_conference_lodging_path(@conference.short_title, @conference.venue.lodgings), :html => {:multipart => true}) do |f|
|
||||
= dynamic_association :lodgings, "Lodgings", f
|
||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
||||
|
|
@ -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"}
|
||||
|
|
|
|||
39
app/views/conference/_location.html.haml
Normal file
39
app/views/conference/_location.html.haml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
= 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'
|
||||
- if @conference.venue
|
||||
- unless @conference.venue.lodgings.empty?
|
||||
= render 'lodging'
|
||||
|
||||
|
||||
:javascript
|
||||
$(document).ready(function(){
|
||||
var photo = "#{@conference.venue.photo}";
|
||||
if(photo)
|
||||
{
|
||||
$('#location').css('background-image', 'url('+photo+')');
|
||||
}
|
||||
});
|
||||
17
app/views/conference/_lodging.html.haml
Normal file
17
app/views/conference/_lodging.html.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
%div.row.col-md-12
|
||||
%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 #{ r.name }
|
||||
-unless r.description.blank?
|
||||
%p.text-left #{ r.description }
|
||||
- unless r.website_link.blank?
|
||||
= link_to 'Go to Website', r.website_link
|
||||
|
|
@ -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');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
%ul.nav.nav-stacked.nav-pills.small.collapse.subNav
|
||||
%li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))}
|
||||
= link_to 'Rooms', admin_conference_rooms_path(@conference.short_title)
|
||||
%li{ class: active_nav_li(admin_conference_lodgings_path(@conference.short_title)) }
|
||||
= link_to 'Lodgings', admin_conference_lodgings_path(@conference.short_title)
|
||||
%li{ class: active_nav_li(admin_conference_supporter_levels_path(@conference.short_title)) }
|
||||
= link_to(admin_conference_supporter_levels_path(@conference.short_title)) do
|
||||
Supporter Levels
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue