Another round of splash design

* Add map to splash
* Reverse venue<->conference relation
* Split venue address into fields
* Don't go through venue for lodgings anymore
This commit is contained in:
Henne Vogelsang 2014-11-20 14:57:03 +01:00
parent 30e8ab856c
commit cb227a0afc
55 changed files with 717 additions and 548 deletions

View file

@ -59,6 +59,12 @@ gem 'jquery-datatables-rails', '~> 2.2.1'
# for user avatars # for user avatars
gem 'gravtastic' gem 'gravtastic'
# for maps
gem 'leaflet-rails', '~> 0.7.4'
# for country selects
gem 'country_select', github: 'stefanpenner/country_select'
# for upload management # for upload management
gem 'paperclip' gem 'paperclip'

View file

@ -1,3 +1,10 @@
GIT
remote: git://github.com/stefanpenner/country_select.git
revision: 585e9538a01ae9878e92f12a98261a09842ed015
specs:
country_select (2.1.0)
countries (~> 0.9, >= 0.9.3)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
@ -98,12 +105,15 @@ GEM
execjs execjs
coffee-script-source (1.7.0) coffee-script-source (1.7.0)
columnize (0.8.9) columnize (0.8.9)
countries (0.9.3)
currencies (~> 0.4.2)
coveralls (0.7.0) coveralls (0.7.0)
multi_json (~> 1.3) multi_json (~> 1.3)
rest-client rest-client
simplecov (>= 0.7) simplecov (>= 0.7)
term-ansicolor term-ansicolor
thor thor
currencies (0.4.2)
d3_rails (3.4.6) d3_rails (3.4.6)
railties (>= 3.1.0) railties (>= 3.1.0)
daemons (1.1.9) daemons (1.1.9)
@ -178,6 +188,7 @@ GEM
jwt (1.0.0) jwt (1.0.0)
launchy (2.4.2) launchy (2.4.2)
addressable (~> 2.3) addressable (~> 2.3)
leaflet-rails (0.7.4)
letter_opener (1.2.0) letter_opener (1.2.0)
launchy (~> 2.2) launchy (~> 2.2)
listen (2.7.2) listen (2.7.2)
@ -430,6 +441,7 @@ DEPENDENCIES
capybara capybara
chart-js-rails chart-js-rails
cocoon cocoon
country_select!
coveralls coveralls
d3_rails d3_rails
daemons daemons
@ -447,6 +459,7 @@ DEPENDENCIES
hoptoad_notifier (~> 2.3) hoptoad_notifier (~> 2.3)
jquery-datatables-rails (~> 2.2.1) jquery-datatables-rails (~> 2.2.1)
jquery-rails jquery-rails
leaflet-rails (~> 0.7.4)
letter_opener letter_opener
mina mina
momentjs-rails (>= 2.8.1) momentjs-rails (>= 2.8.1)

View file

@ -28,11 +28,11 @@
//= require to-markdown //= require to-markdown
//= require markdown //= require markdown
//= require moment //= require moment
//= require leaflet
//= require bootstrap-datetimepicker //= require bootstrap-datetimepicker
//= require osem-datepickers //= require osem-datepickers
//= require osem-datatables //= require osem-datatables
//= require osem-tickets //= require osem-tickets
//= require osem-splash
$(document).ready(function() { $(document).ready(function() {
$('a[disabled=disabled]').click(function(event){ $('a[disabled=disabled]').click(function(event){

View file

@ -1,7 +0,0 @@
$(function () {
$(document).ready(function() {
var t = new Trianglify({cellsize: 100, x_gradient: triangle_colors });
var pattern = t.generate(document.body.clientWidth, ($( "#splash-banner" ).height() + 200 ));
$('#splash-banner').css('background-image', pattern.dataUrl);
});
});

View file

@ -12,4 +12,5 @@
*= require font-awesome *= require font-awesome
*= require bootstrap-markdown.min *= require bootstrap-markdown.min
*= require bootstrap-datetimepicker *= require bootstrap-datetimepicker
*= require leaflet
*/ */

View file

@ -1,4 +1,6 @@
#splash { #splash {
// Counter the general padding for #content
margin-bottom: -60px;
section { section {
padding-top: 60px; padding-top: 60px;
padding-bottom: 60px; padding-bottom: 60px;
@ -11,100 +13,129 @@
section:nth-child(odd) { section:nth-child(odd) {
background: none repeat scroll 0 0 #ffffff; background: none repeat scroll 0 0 #ffffff;
color: #7b7b7b; color: #7b7b7b;
.thumbnail {
background: none repeat scroll 0 0 #e0e0e0;
}
} }
}
#splash-banner{ .cta-button {
background-repeat: no-repeat; padding-top: 30px;
background-position: center center; }
background-size: cover;
margin-top: -10px; #banner{
padding-top: 100px; background-repeat: no-repeat;
padding-bottom: 100px; background-position: center center;
.container { background-size: cover;
#splash-header { margin-top: -10px;
background-color: rgba(224, 224, 224,.80); padding-top: 100px;
padding-top: 20px; padding-bottom: 100px;
padding-bottom: 20px; .container {
#header {
background-color: rgba(224, 224, 224,.80);
padding-top: 20px;
padding-bottom: 20px;
}
}
}
#program {
h3 {
padding-left: 5px;
}
.track {
padding: 20px;
}
.track:hover{
background-color: #F0FFFF;
}
}
#callforpapers {
.timer-box{
width: 130px;
margin: 35px 24px 20px 0;
border-radius: 50%;
border:4px solid #989797;
}
}
#venue {
padding-top: 0px;
padding-bottom: 0px;
}
#lodging {
.img-lodging {
max-height: 200px;
}
}
#sponsors {
.img-sponsor {
max-height: 100px;
}
.img-sponsor-1 {
max-height: 200px;
}
.img-sponsor-2 {
max-height: 150px;
}
.img-sponsor-3 {
max-height: 120px;
}
}
#social-media{
background: none repeat scroll 0 0 #2f2f2f;
padding-top: 60px;
padding-bottom: 60px;
i{
color: #4a4a4a;
}
i:hover{
color: #16a085;
}
a{
padding-left: 100px;
}
a:nth-child(-n+1) {
padding-left: 0px;
}
}
.scroll-top-wrapper {
position: fixed;
opacity: 0;
visibility: hidden;
overflow: hidden;
text-align: center;
z-index: 99999999;
background-color: #424242;
width: 50px;
height: 48px;
line-height: 48px;
right: 30px;
bottom: 30px;
padding-top: 2px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
i.fa {
line-height: inherit;
}
&.show {
visibility:visible;
cursor:pointer;
opacity: 1.0;
}
a {
color: white;
} }
} }
} }
#program {
.tracks:hover{
background-color: white;
}
}
#callforpapers {
.timer-box{
width: 130px;
margin: 35px 24px 20px 0;
border-radius: 50%;
border:4px solid #989797;
}
#cfp-date{
font-size: 40px;
color: #ff6633;
}
}
#location {
background-repeat: no-repeat;
background-position: center center;
width: 100%;
background-size: cover;
min-height: 500px;
h1,h2,p{
color: #fff;
}
h1,h2,li,p{
text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6);
font-weight: 400;
}
}
#social-media{
i{
color: #4a4a4a;
}
i:hover{
color: #16a085;
}
}
.scroll-top-wrapper {
position: fixed;
opacity: 0;
visibility: hidden;
overflow: hidden;
text-align: center;
z-index: 99999999;
background-color: #424242;
width: 50px;
height: 48px;
line-height: 48px;
right: 30px;
bottom: 30px;
padding-top: 2px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
i.fa {
line-height: inherit;
}
&.show {
visibility:visible;
cursor:pointer;
opacity: 1.0;
}
a {
color: white;
}
}

View file

@ -5,11 +5,15 @@ html {
body { body {
/* Margin bottom by 2 times the footer height */ /* Margin bottom by 2 times the footer height */
margin-bottom: 120px; margin-bottom: 60px;
/* Margin bottom by navbar height */ /* Margin bottom by navbar height */
padding-top: 60px; padding-top: 60px;
} }
#content {
padding-bottom: 60px;
}
#footer { #footer {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@ -29,3 +33,20 @@ body {
.img-center { .img-center {
margin: 0 auto; margin: 0 auto;
} }
/* centered columns styles */
.row-centered {
text-align:center;
}
.col-centered {
display:inline-block;
float:none;
/* reset the text-align */
text-align:left;
/* inline-block space fix */
margin-right:-4px;
}
.col-top {
vertical-align:top;
}

View file

@ -1,23 +1,21 @@
module Admin module Admin
class LodgingsController < Admin::BaseController class LodgingsController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :venue, through: :conference, singleton: true load_and_authorize_resource :lodging, through: :conference
load_and_authorize_resource :lodging, through: :venue
def index def index
authorize! :update, Lodging.new(venue_id: @venue.id)
end end
def show; end def show; end
def new def new
@lodging = @venue.lodgings.new @lodging = @conference.lodgings.new
end end
def create def create
@lodging = @venue.lodgings.new(lodging_params) @lodging = @conference.lodgings.new(lodging_params)
if @lodging.save if @lodging.save
redirect_to(admin_conference_lodging_path(conference_id: @conference.short_title, id: @lodging.id), redirect_to(admin_conference_lodgings_path(conference_id: @conference.short_title),
notice: 'Lodging successfully created.') notice: 'Lodging successfully created.')
else else
flash[:error] = "Creating Lodging failed: #{@lodging.errors.full_messages.join('. ')}." flash[:error] = "Creating Lodging failed: #{@lodging.errors.full_messages.join('. ')}."

View file

@ -3,16 +3,48 @@ module Admin
load_and_authorize_resource :conference, find_by: :short_title load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :venue, through: :conference, singleton: true load_and_authorize_resource :venue, through: :conference, singleton: true
def show; end
def new
@venue = @conference.build_venue
end
def edit; end def edit; end
def create
@venue = @conference.build_venue(venue_params)
if @venue.save
redirect_to admin_conference_venue_path,
notice: 'Venue successfully created.'
else
render :new
end
end
def update def update
if @venue.update_attributes(params[:venue]) if @venue.update_attributes(venue_params)
redirect_to(edit_admin_conference_venue_path(conference_id: @conference.short_title), redirect_to(admin_conference_venue_path(conference_id: @conference.short_title),
notice: 'Venue was successfully updated.') notice: 'Venue was successfully updated.')
else else
flash[:error] = "Update venue failed: #{@venue.errors.full_messages.join('. ')}." flash[:error] = "Update venue failed: #{@venue.errors.full_messages.join('. ')}."
render :edit render :edit
end end
end end
def destroy
if @venue.destroy
redirect_to admin_conference_venue_path, notice: 'Venue was successfully deleted.'
else
redirect_to admin_conference_venue_path, alert: 'A error prohibited this Venue from being destroyed: '\
"#{@venue.errors.full_messages.join('. ')}."
end
end
private
def venue_params
params[:venue]
end
end end
end end

View file

@ -171,6 +171,34 @@ module ApplicationHelper
result result
end end
def event_types(conference)
all = conference.event_types.map { |et | et.title.pluralize }
first = all[0...-1]
last = all[-1]
ets = ''
if all.length > 1
ets << first.join(', ')
ets << " and #{last}"
else
ets = all.join
end
return ets
end
def tracks(conference)
all = conference.tracks.map {|t| t.name}
first = all[0...-1]
last = all[-1]
ts = ''
if all.length > 1
ts << first.join(', ')
ts << " and #{last}"
else
ts = all.join
end
return ts
end
def markdown(text) def markdown(text)
options = { options = {
autolink: true, autolink: true,

View file

@ -43,21 +43,15 @@ class Ability
def user_with_roles(user) def user_with_roles(user)
conf_ids_for_organizer = [] conf_ids_for_organizer = []
venue_ids_for_organizer = []
conf_ids_for_cfp = [] conf_ids_for_cfp = []
venue_ids_for_cfp = []
conf_ids_for_info_desk = [] conf_ids_for_info_desk = []
conf_ids_for_volunteer_coordinator = [] conf_ids_for_volunteer_coordinator = []
# Ids of all the conferences for which the user has an 'organizer' role # Ids of all the conferences for which the user has an 'organizer' role
conf_ids_for_organizer = conf_ids_for_organizer =
Conference.with_role(:organizer, user).pluck(:id) if user.has_role? :organizer, :any Conference.with_role(:organizer, user).pluck(:id) if user.has_role? :organizer, :any
venue_ids_for_organizer =
Conference.with_role(:organizer, user).pluck(:venue_id) if user.has_role? :organizer, :any
conf_ids_for_cfp = conf_ids_for_cfp =
Conference.with_role(:cfp, user).pluck(:id) if user.has_role? :cfp, :any Conference.with_role(:cfp, user).pluck(:id) if user.has_role? :cfp, :any
venue_ids_for_cfp =
Conference.with_role(:cfp, user).pluck(:venue_id) if user.has_role? :cfp, :any
# Ids of all the conferences for which the user has an 'info_desk' role # Ids of all the conferences for which the user has an 'info_desk' role
conf_ids_for_info_desk = conf_ids_for_info_desk =
Conference.with_role(:info_desk, user).pluck(:id) if user.has_role? :info_desk, :any Conference.with_role(:info_desk, user).pluck(:id) if user.has_role? :info_desk, :any
@ -74,8 +68,6 @@ class Ability
# can :manage, Conference do |conference| # can :manage, Conference do |conference|
# conference.id = conf_ids_for_organizer # conference.id = conf_ids_for_organizer
# end # end
can :manage, Venue, id: venue_ids_for_organizer
can :index, Venue, id: venue_ids_for_cfp
can :manage, Registration, conference_id: conf_ids_for_organizer + conf_ids_for_info_desk can :manage, Registration, conference_id: conf_ids_for_organizer + conf_ids_for_info_desk
can :manage, Question, conference_id: conf_ids_for_organizer + conf_ids_for_info_desk can :manage, Question, conference_id: conf_ids_for_organizer + conf_ids_for_info_desk
cannot [:edit, :update, :destroy], Question, global: true cannot [:edit, :update, :destroy], Question, global: true
@ -92,7 +84,9 @@ class Ability
can :manage, DifficultyLevel, conference_id: conf_ids_for_organizer + conf_ids_for_cfp can :manage, DifficultyLevel, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
can :manage, EmailSettings, conference_id: conf_ids_for_organizer + conf_ids_for_cfp can :manage, EmailSettings, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
can :manage, Campaign, conference_id: conf_ids_for_organizer can :manage, Campaign, conference_id: conf_ids_for_organizer
can :manage, Lodging, venue_id: venue_ids_for_organizer can :manage, Venue, conference_id: conf_ids_for_organizer
can :index, Venue, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
can :manage, Lodging, conference_id: conf_ids_for_organizer
can :manage, Photo, conference_id: conf_ids_for_organizer can :manage, Photo, conference_id: conf_ids_for_organizer
can :manage, Room, conference_id: conf_ids_for_organizer + conf_ids_for_cfp can :manage, Room, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
can :manage, Sponsor, conference_id: conf_ids_for_organizer can :manage, Sponsor, conference_id: conf_ids_for_organizer

View file

@ -29,6 +29,7 @@ class Conference < ActiveRecord::Base
has_one :registration_period, dependent: :destroy has_one :registration_period, dependent: :destroy
has_one :email_settings, dependent: :destroy has_one :email_settings, dependent: :destroy
has_one :call_for_papers, dependent: :destroy has_one :call_for_papers, dependent: :destroy
has_one :venue, dependent: :destroy
has_many :social_events, dependent: :destroy has_many :social_events, dependent: :destroy
has_many :ticket_purchases has_many :ticket_purchases
has_many :supporters, through: :ticket_purchases, source: :user has_many :supporters, through: :ticket_purchases, source: :user
@ -53,6 +54,7 @@ class Conference < ActiveRecord::Base
has_many :tracks, dependent: :destroy has_many :tracks, dependent: :destroy
has_many :difficulty_levels, dependent: :destroy has_many :difficulty_levels, dependent: :destroy
has_many :rooms, dependent: :destroy has_many :rooms, dependent: :destroy
has_many :lodgings, dependent: :destroy
has_many :registrations, dependent: :destroy has_many :registrations, dependent: :destroy
has_many :participants, through: :registrations, source: :user has_many :participants, through: :registrations, source: :user
has_many :vdays, dependent: :destroy has_many :vdays, dependent: :destroy
@ -64,7 +66,6 @@ class Conference < ActiveRecord::Base
has_many :campaigns, dependent: :destroy has_many :campaigns, dependent: :destroy
has_many :commercials, as: :commercialable, dependent: :destroy has_many :commercials, as: :commercialable, dependent: :destroy
has_many :subscriptions, dependent: :destroy has_many :subscriptions, dependent: :destroy
belongs_to :venue
accepts_nested_attributes_for :rooms, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true accepts_nested_attributes_for :rooms, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
accepts_nested_attributes_for :tracks, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true accepts_nested_attributes_for :tracks, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
@ -99,7 +100,6 @@ class Conference < ActiveRecord::Base
validates_uniqueness_of :short_title validates_uniqueness_of :short_title
validates_format_of :short_title, with: /\A[a-zA-Z0-9_-]*\z/ validates_format_of :short_title, with: /\A[a-zA-Z0-9_-]*\z/
before_create :generate_guid before_create :generate_guid
before_create :create_venue
before_create :create_event_types before_create :create_event_types
before_create :create_email_settings before_create :create_email_settings
before_create :add_color before_create :add_color
@ -727,14 +727,13 @@ class Conference < ActiveRecord::Base
rooms.count > 0 rooms.count > 0
end end
## # Checks if the conference has a venue object.
# Checks if venue has a name, address and website.
# #
# ====Returns # ====Returns
# * +True+ -> If venue has a name, address and website. # * +True+ -> If conference has a venue object.
# * +False+ -> venue has a no name, address or website. # * +False+ -> IF conference has no venue object.
def venue_set? def venue_set?
!!venue && !!venue.name && !!venue.address && !!venue.website !!venue
end end
## ##
@ -885,14 +884,6 @@ class Conference < ActiveRecord::Base
result result
end end
##
# Creates a Venue for this Conference. Used as before_create.
#
def create_venue
self.venue_id = Venue.create.id
true
end
## ##
# Creates default EventTypes for this Conference. Used as before_create. # Creates default EventTypes for this Conference. Used as before_create.
# #

View file

@ -1,6 +1,6 @@
class Lodging < ActiveRecord::Base class Lodging < ActiveRecord::Base
attr_accessible :name, :description, :photo, :website_link, :venue_id attr_accessible :name, :description, :photo, :website_link, :conference_id
belongs_to :venue belongs_to :conference
validates :name, presence: true validates :name, presence: true

View file

@ -1,30 +1,39 @@
class Venue < ActiveRecord::Base class Venue < ActiveRecord::Base
attr_accessible :name, :description, :website, :address, :photo, :lodgings_attributes, belongs_to :conference
:include_venue_in_splash, :include_lodgings_in_splash
has_many :conferences
has_many :lodgings has_many :lodgings
before_create :generate_guid before_create :generate_guid
attr_accessible :name, :street, :postalcode, :city, :country, :longitude, :latitude, :description, :website, :photo, :lodgings_attributes, :conference_id
validates :name, :street, :city, :country, presence: true
has_attached_file :photo, has_attached_file :photo,
styles: { thumb: '100x100>', large: '300x300>' } styles: { thumb: '100x100>', large: '300x300>' }
validates_attachment_content_type :photo, validates_attachment_content_type :photo,
content_type: [/jpg/, /jpeg/, /png/, /gif/], content_type: [/jpg/, /jpeg/, /png/, /gif/],
size: { in: 0..500.kilobytes } size: { in: 0..500.kilobytes }
accepts_nested_attributes_for :lodgings, allow_destroy: true accepts_nested_attributes_for :lodgings, allow_destroy: true
after_update :send_mail_notification after_update :send_mail_notification
def address
"#{conference.venue.street}, #{conference.venue.postalcode} #{conference.venue.city}, #{conference.venue.country}"
end
def country_name
name = ISO3166::Country[country]
name.name if name
end
private private
def send_mail_notification def send_mail_notification
conferences.each do |conference| Mailbot.delay.send_email_on_venue_update(conference) if venue_notify?(conference)
Mailbot.delay.send_email_on_venue_update(conference) if venue_notify?(conference)
end
end end
def venue_notify?(conference) def venue_notify?(conference)
(self.name_changed? || self.address_changed?) && (self.name_changed? || self.street_changed?) &&
(!self.name.blank? && !self.address.blank?) && (!self.name.blank? && !self.street.blank?) &&
(conference.email_settings.send_on_venue_update && (conference.email_settings.send_on_venue_update &&
!conference.email_settings.venue_update_subject.blank? && !conference.email_settings.venue_update_subject.blank? &&
conference.email_settings.venue_update_template) conference.email_settings.venue_update_template)

View file

@ -12,7 +12,8 @@
%dt %dt
Description Description
%dd %dd
= markdown(@conference.description) - unless @conference.description.blank?
= markdown(@conference.description)
%dt %dt
Date Date
%dd %dd

View file

@ -1,8 +1,8 @@
= f.input :name = semantic_form_for(@lodging, :url => (@lodging.new_record? ? admin_conference_lodgings_path : admin_conference_lodging_path(@conference.short_title, @lodging))) do |f|
= f.input :description, :input_html => {:rows => 2, data: { provide: "markdown-editable" } }, hint: markdown_hint("Write about the hotel/place, of what they are offering, about types of rooms, prices and address.") = f.input :name
= image_tag f.object.photo(:thumb) if !f.object.photo.blank? = f.input :website_link
= f.input :photo = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.input :website_link - unless @lodging.photo.blank?
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } = image_tag @lodging.photo(:thumb)
= f.input :photo
= link_to 'Back', admin_conference_lodgings_path(@conference.short_title) = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -1,6 +0,0 @@
%h1
Edit Lodging
.row
.col-md-8
= semantic_form_for(@lodging, :url => admin_conference_lodging_path(@conference.short_title, @lodging)) do |f|
= render partial: 'form', locals: { f: f }

View file

@ -1,5 +1,5 @@
%h1 Lodgings %h1 Lodgings
- if @venue.lodgings.any? - if @conference.lodgings.any?
.row .row
.col-md-12 .col-md-12
%table.table %table.table
@ -9,7 +9,7 @@
%th Edit %th Edit
%th Delete %th Delete
%tbody %tbody
- @venue.lodgings.each_with_index do |lodging, index| - @conference.lodgings.each_with_index do |lodging, index|
%tr %tr
%td %td
= index + 1 = index + 1

View file

@ -1,6 +0,0 @@
%h1
New Lodging
.row
.col-md-8
= semantic_form_for(@lodging, :url => admin_conference_lodgings_path(@conference.short_title, @lodging)) do |f|
= render partial: 'form', locals: { f: f }

View file

@ -1,8 +1,7 @@
= semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f| = semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f|
= f.input :name, input_html: { rows: 1 } = f.inputs :name, :website
= f.input :address, input_html: { rows: 1 }
= f.input :website
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.inputs :street, :postalcode, :city, :country, :longitude, :latitude
- unless @venue.photo.blank? - unless @venue.photo.blank?
= image_tag @venue.photo(:thumb) = image_tag @venue.photo(:thumb)
= f.input :photo = f.input :photo

View file

@ -1,38 +0,0 @@
.row{'style'=>'padding-top: 15px;'}
.col-md-6
%dl.dl-horizontal
%dt
Name
%dd
= @venue.name
%dt
Address
%dd
= @venue.address
%dt
Website
%dd
= @venue.website
%dt
Description
%dd
- unless @venue.description.blank?
= markdown(@venue.description)
.row.row-flex.row-flex-wrap
.col-md-4
.thumbnail.flex-col
%h3.text-center
Venue Logo
- if @venue.photo
= image_tag(@venue.photo(:large), class: 'img-responsive')
.caption.flex-grow
.caption
%p
%dl.dl-horizontal
%dt
Filename
%dd
= @venue.photo_file_name
-else
%h4.text-center
Not set!

View file

@ -1,16 +0,0 @@
.row
.col-md-12
%ul.nav.nav-tabs{'role'=>'tablist'}
%li.active
%a{'href'=> '#show', 'role'=>'tab', 'data-toggle'=>'tab'}
Show
%li
%a{'href'=> '#edit', 'role'=>'tab', 'data-toggle'=>'tab'}
Edit
.row
.col-md-8
.tab-content
.tab-pane.active#show
= render partial: 'show'
.tab-pane#edit
= render partial: 'form'

View file

@ -0,0 +1,25 @@
-if @venue
.row
.col-md-6
=image_tag(@conference.venue.photo, class: 'img-responsive img-rounded') unless @conference.venue.photo.blank?
.col-md-6
%address
%strong
= @venue.name
%br
= @venue.street
%br
= "#{@venue.postalcode}, #{@venue.city}"
%br
= @venue.country_name
.row
.col-md-12
= link_to(edit_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary') do
Edit Venue
= link_to(admin_conference_venue_path(@conference.short_title), method: 'delete', class: 'btn btn-danger') do
Delete Venue
-else
.row
.col-md-12
= link_to(new_admin_conference_venue_path(@conference.short_title), class: 'btn btn-success') do
Create Venue

View file

@ -5,55 +5,35 @@
.container .container
.row .row
.col-md-12.text-center .col-md-12.text-center
%h1 %h2
Call For Papers Call for Papers
- if !@conference.call_for_papers.description.blank? %p.lead
= markdown(@conference.call_for_papers.description) We are ready to accept your proposals for sessions!
.row
.col-md-6.col-md-offset-3
%p
- if @conference.event_types.any?
You can submit proposals for
= "#{event_types(@conference)}."
- if @conference.tracks.any?
Proposals should fit in one of the
= "#{pluralize(@conference.tracks.count, 'track')}:"
= "#{tracks(@conference)}."
The submission period has begun
%em
= @conference.call_for_papers.start_date.strftime('%A, %B %-d. %Y')
and closes
%em
= @conference.call_for_papers.end_date.strftime('%A, %B %-d. %Y.')
That means you have only
- days = (@conference.call_for_papers.end_date - Date.today).to_i
%b
= pluralize(days, 'days')
left!
Remember
= @conference.short_title
will only be as good as the sessions you present. Submit early, submit often!
.row .row
.col-md-12.text-center .col-md-12.text-center
.lead %p.cta-button
= link_to "Submit Your Proposals Today", conference_proposal_index_path(@conference.short_title), class: 'btn btn-info', target: '_blank' = link_to "Submit your paper now", conference_proposal_index_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
- if !@conference.call_for_papers.start_date.blank? && !@conference.call_for_papers.end_date.blank?
%p
Proposals will be accepted between
%p#cfp-date
= date_string(@conference.call_for_papers.start_date, @conference.call_for_papers.end_date)
.row
.col-md-8.col-md-offset-3.text-center
%div.col-md-2.timer-box
%h2#days
.lead Days
%div.col-md-2.timer-box
%h2#hours
.lead Hours
%div.col-md-2.timer-box
%h2#minutes
.lead Minutes
%div.col-md-2.timer-box
%h2#seconds
.lead Seconds
:javascript
$( document ).ready(function(){
var target_date = new Date("#{@conference.call_for_papers.end_date}").getTime();
if(target_date > new Date().getTime())
var days, hours, minutes, seconds;
setInterval(function () {
var current_date = new Date().getTime();
var seconds_left = (target_date - current_date) / 1000;
days = parseInt(seconds_left / 86400);
seconds_left = seconds_left % 86400;
hours = parseInt(seconds_left / 3600);
seconds_left = seconds_left % 3600;
minutes = parseInt(seconds_left / 60);
seconds = parseInt(seconds_left % 60);
$('#days').text(days);
$('#hours').text(hours);
$('#minutes').text(minutes);
$('#seconds').text(seconds);
}, 1000);
});

View file

@ -10,14 +10,6 @@
%small %small
%b %b
= date_string(conference.start_date, conference.end_date) = date_string(conference.start_date, conference.end_date)
- if conference.venue.name and conference.venue.website and conference.venue.address
%p
%small<
= link_to conference.venue.name, conference.venue.website
,&nbsp;
\#{link_to conference.venue.address, "http://maps.google.com/maps?q=#{conference.venue.address}"}
- if conference.venue.description
= simple_format(conference.venue.description, class: 'lead')
.col-md-2 .col-md-2
.btn-group-vertical .btn-group-vertical
- if current_user.nil? || !current_user.subscribed?(conference) - if current_user.nil? || !current_user.subscribed?(conference)

View file

@ -1,5 +1,5 @@
%div.scroll-top-wrapper %div.scroll-top-wrapper
= link_to "#splash-banner", class: "smoothscroll" do = link_to "#banner", class: "smoothscroll" do
%i.fa.fa-2x.fa-arrow-circle-up %i.fa.fa-2x.fa-arrow-circle-up
:javascript :javascript

View file

@ -1,20 +0,0 @@
= content_for :splash_nav do
%li
%a.smoothscroll{ href: '#location' } Location
.container
.row
.col-md-12.text-center
- unless @conference.venue.name.blank?
%h1
%strong #{ @conference.venue.name }
- unless @conference.venue.address.blank?
= link_to("http://maps.google.com/maps?q=#{@conference.venue.address}") do
%h2
#{ @conference.venue.address }
- unless @conference.venue.description.blank?
.lead
= markdown(@conference.venue.description)
- unless @conference.venue.website.blank?
%p.lead
= link_to(@conference.venue.website, @conference.venue.website)

View file

@ -4,16 +4,23 @@
%h2 Accommodation Deals %h2 Accommodation Deals
%p.lead %p.lead
We have prepared affordable accommodation deals for your visit. We have prepared affordable accommodation deals for your visit.
.row - @conference.lodgings.each_slice(3) do |slice|
- @conference.venue.lodgings.each do |r| .row.row-centered
%div{ class: (@conference.venue.lodgings.count.to_i <= 2 ? "col-md-#{12/@conference.venue.lodgings.count.to_i}" : "col-md-4") } - slice.each do |lodging|
.div.thumbnail .col-md-4.ticket.col-centered.col-top
-unless r.photo.blank? .thumbnail
= image_tag r.photo(:large), class: 'img-responsive' - if lodging.photo.blank?
-unless r.name.blank? %p.text-center
%h4.text-center #{ r.name } %i.fa.fa-home.fa-5x
-unless r.description.blank? - else
.lead.text-left #{ markdown(r.description) } -if lodging.website_link.present?
- unless r.website_link.blank? = link_to(lodging.website_link, class: 'thumbnail') do
.text-center = image_tag lodging.photo(:large), class: 'img-responsive img-lodging'
= link_to 'Go to Website', r.website_link - else
= image_tag lodging.photo(:large), class: 'img-responsive img-lodging'
.caption
%h3.text-center
= lodging.name
-if lodging.description.present?
= markdown(lodging.description)

View file

@ -1,36 +1,34 @@
= content_for :splash_nav do
%li
=link_to('#program', class: 'smoothscroll') do
Program
.container .container
.row .row
.col-md-12.text-center .col-md-12
%h1 Program %h2.text-center
- if @conference.splashpage and @conference.splashpage.include_tracks Program
.row %p.lead.text-center
.col-md-12 = @conference.short_title
- @conference.tracks.each do |t| has the most awesome program ever!
.tracks{ class: (@conference.tracks.count.to_i <= 2 ? "col-md-#{12/@conference.tracks.count.to_i}" : "col-md-4") } - if @conference.splashpage and @conference.splashpage.include_tracks
%h4.text-center See rock-star speakers cover the topics of
= t.name - if @conference.splashpage and @conference.splashpage.include_tracks
%p - @conference.tracks.each_slice(3) do |slice|
= markdown(t.description) .row.row-centered
- if @conference.call_for_papers and @conference.call_for_papers.schedule_public - slice.each do |track|
.row .col-md-4.col-centered.col-top.track
.col-md-12 %h4.text-center
%p.text-center = track.name
Check out our = markdown(track.description)
= link_to 'Schedule', conference_schedule_path(@conference.short_title)
- if !@keynote_speakers.blank? - if @conference.call_for_papers and @conference.call_for_papers.schedule_public
%div.row.text-center .row
%div.col-md-12 .col-md-12
%h3 Keynote Speakers %p.cta-button.text-center
- @keynote_speakers.each do |k| = link_to(conference_schedule_path(@conference.short_title), class: 'btn btn-default btn-lg') do
%div{ class: (@keynote_speakers.count.to_i <= 2 ? "col-md-#{12/@keynote_speakers.count.to_i}" : "col-md-4") } Full Schedule
= image_tag(k.gravatar_url(size: '80'), class: 'img-circle') unless k.gravatar_url.blank?
%h4 - #FIXME: Display keynotes https://github.com/openSUSE/osem/issues/544
= k.name - #FIXME: Display schedule highlights https://github.com/openSUSE/osem/issues/545
-unless k.biography.blank?
%p
= k.biography = content_for :splash_nav do
%li
=link_to('#program', class: 'smoothscroll') do
Program

View file

@ -9,8 +9,11 @@
%p.lead %p.lead
Going to Going to
= @conference.short_title = @conference.short_title
is free of charge. We only ask you to is free of charge.
= link_to "register yourself", new_conference_conference_registrations_path(@conference.short_title) %p
until We only ask you to register yourself until
= @conference.registration_period.end_date = @conference.registration_period.end_date.strftime('%A, %B %-d. %Y')
so we can plan for the right amount of people.
%p.cta-button
= link_to(new_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-lg btn-success') do
Register Now

View file

@ -2,21 +2,18 @@
%li %li
%a.smoothscroll{ href: '#social-media' } Social Media %a.smoothscroll{ href: '#social-media' } Social Media
%div.container#social-media.text-center .container
%div.row .row
- unless @conference.contact.facebook.blank? .col-md-12.text-center
%div.col-md-3 - unless @conference.contact.facebook.blank?
= link_to "#{ @conference.contact.facebook }" do = link_to "#{ @conference.contact.facebook }" do
%i.fa.fa-facebook-square.fa-4x %i.fa.fa-facebook-square.fa-4x
- unless @conference.contact.twitter.blank? - unless @conference.contact.twitter.blank?
%div.col-md-3
= link_to "#{ @conference.contact.twitter }" do = link_to "#{ @conference.contact.twitter }" do
%i.fa.fa-twitter.fa-4x %i.fa.fa-twitter.fa-4x
- unless @conference.contact.instagram.blank? - unless @conference.contact.instagram.blank?
%div.col-md-3
= link_to "#{ @conference.contact.instagram }" do = link_to "#{ @conference.contact.instagram }" do
%i.fa.fa-instagram.fa-4x %i.fa.fa-instagram.fa-4x
- unless @conference.contact.googleplus.blank? - unless @conference.contact.googleplus.blank?
%div.col-md-3
= link_to "#{ @conference.contact.googleplus }" do = link_to "#{ @conference.contact.googleplus }" do
%i.fa.fa-google-plus-square.fa-4x %i.fa.fa-google-plus-square.fa-4x

View file

@ -12,16 +12,21 @@
wouldn't be possible! wouldn't be possible!
- @conference.sponsorship_levels.each do |sponsorship_level| - @conference.sponsorship_levels.each do |sponsorship_level|
-if sponsorship_level.sponsors.any? -if sponsorship_level.sponsors.any?
.row
.col-md-12.text-center
%h3
= sponsorship_level.title
- sponsorship_level.sponsors.each_slice(3) do |slice| - sponsorship_level.sponsors.each_slice(3) do |slice|
.row .row.row-centered
- slice.each do |sponsor| - slice.each do |sponsor|
.col-md-4 .col-md-4.col-centered.col-top
= link_to("http://#{sponsor.website_url}", class: 'thumbnail') do .thumbnail
= image_tag(sponsor.logo(:large), alt: "#{sponsor.name} Logo", title: "#{sponsor.description}") - if sponsor.logo.blank?
%h3.text-center
= link_to(sponsor.website_url, title: "#{sponsor.name}") do
= sponsor.name
- else
= link_to(sponsor.website_url, class: 'thumbnail') do
= image_tag sponsor.logo, class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}", title: "#{sponsor.name}"
.caption
-if sponsor.description.present?
= markdown(sponsor.description)
-if @conference.contact and !@conference.contact.sponsor_email.blank? -if @conference.contact and !@conference.contact.sponsor_email.blank?
.row .row
.col-md-12 .col-md-12

View file

@ -1,21 +1,25 @@
.container .container
.row .row
.col-md-12.text-center .col-md-12.text-center
%h1 %h2
Support Support
=@conference.short_title =@conference.short_title
%p.lead %p.lead
To support our event you can purchase tickets To support our event you can purchase these tickets
.row - @conference.tickets.each_slice(4) do |slice|
- @conference.tickets.each do |ticket| .row.row-centered
%div{ class: (@conference.tickets.count <= 2 ? "col-md-#{12/@conference.tickets.count}" : "col-md-4") } - slice.each do |ticket|
- if ticket.title.present? .col-md-3.col-centered.col-top
%h4.text-center .thumbnail
=ticket.title %p.text-center
- if ticket.description.present? %i.fa.fa-ticket.fa-5x
= markdown(ticket.description) .caption
.text-center %h3.text-center
.btn-group = ticket.title
= link_to(conference_tickets_path(@conference.short_title), class: 'btn btn-success') do -if ticket.description.present?
Buy Ticket = markdown(ticket.description)
= "#{humanized_money_with_symbol ticket.price}" %p.text-center
= link_to(conference_tickets_path(@conference.short_title), class: 'btn btn-success') do
Buy Ticket
= humanized_money_with_symbol ticket.price

View file

@ -0,0 +1,43 @@
= content_for :splash_nav do
%li
%a.smoothscroll{ href: '#venue' } Venue
-if !@conference.venue.latitude.blank? and !@conference.venue.longitude.blank?
#map{style: "height: 500px;" }
- popup = "<h3>#{@conference.venue.name}</h3><br>#{@conference.venue.street}<br>#{@conference.venue.postalcode}, #{@conference.venue.city}<br>#{@conference.venue.country_name}"
- content_for(:script_body) do
:javascript
// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map', {scrollWheelZoom: false}).setView([#{@conference.venue.longitude}, #{@conference.venue.latitude}], 11);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
maxZoom: 18
}).addTo(map);
// add a marker in the given location, attach some popup content to it and open the popup
L.marker([#{@conference.venue.longitude}, #{@conference.venue.latitude}]).addTo(map)
.bindPopup("#{popup}")
.openPopup();
-else
.container
.row
.col-md-12
%h2.text-center
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
.col-md-6
.thumbnail
=image_tag(@conference.venue.photo, class: 'img-responsive img-rounded') unless @conference.venue.photo.blank?
.caption
- unless @conference.venue.description.blank?
= markdown(@conference.venue.description)
.col-md-6
%address
%h1
= @conference.venue.name
= @conference.venue.street
%br
= "#{@conference.venue.postalcode}, #{@conference.venue.city}"
%br
= @conference.venue.country_name
- if @conference.venue.website
%br
=link_to @conference.venue.website, @conference.venue.website

View file

@ -1,9 +1,9 @@
#splash #splash
- if @conference.splashpage - if @conference.splashpage
#splash-banner #banner
.container .container
.row .row
.col-md-8.col-md-offset-2#splash-header .col-md-8.col-md-offset-2#header
.row .row
.col-md-4 .col-md-4
= image_tag(@conference.logo(:original), class: 'img-responsive', id: 'splash-logo') if @conference.logo? = image_tag(@conference.logo(:original), class: 'img-responsive', id: 'splash-logo') if @conference.logo?
@ -11,7 +11,10 @@
%h1 %h1
= @conference.title = @conference.title
%p.lead %p.lead
- if @conference.venue
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
- if @conference.start_date && @conference.end_date - if @conference.start_date && @conference.end_date
%br
= date_string(@conference.start_date, @conference.end_date) = date_string(@conference.start_date, @conference.end_date)
- unless @conference.description.blank? - unless @conference.description.blank?
@ -22,6 +25,10 @@
%h3.text-center %h3.text-center
= markdown(@conference.description) = markdown(@conference.description)
- if @conference.registration_open? and @conference.splashpage.include_registrations
%section#registration
= render 'registration'
- if @conference.splashpage.include_program - if @conference.splashpage.include_program
%section#program %section#program
= render 'program' = render 'program'
@ -31,21 +38,17 @@
= render 'call_for_papers' = render 'call_for_papers'
- if @conference.venue and @conference.splashpage.include_venue - if @conference.venue and @conference.splashpage.include_venue
#location{ style: ("background-image: url(#{@conference.venue.photo})" unless @conference.venue.photo.blank?) } %section#venue
= render 'location' = render 'venue'
- if @conference.registration_open? and @conference.splashpage.include_registrations - if @conference.lodgings.any? and @conference.splashpage.include_lodgings
%section#registration %section#lodging
= render 'registration' = render 'lodging'
- if @conference.tickets.any? and @conference.splashpage.include_tickets - if @conference.tickets.any? and @conference.splashpage.include_tickets
%section#tickets %section#tickets
= render 'tickets' = render 'tickets'
- if @conference.venue.lodgings.any? and @conference.splashpage.include_lodgings
%section#lodging
= render 'lodging'
- if @conference.sponsors.any? and @conference.splashpage.include_sponsors - if @conference.sponsors.any? and @conference.splashpage.include_sponsors
%section#sponsors %section#sponsors
= render 'sponsors' = render 'sponsors'
@ -61,3 +64,10 @@
:javascript :javascript
var triangle_tcs = tinycolor("#{@conference.color}").monochromatic(); var triangle_tcs = tinycolor("#{@conference.color}").monochromatic();
var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); }); var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); });
$(function () {
$(document).ready(function() {
var t = new Trianglify({cellsize: 100, x_gradient: triangle_colors });
var pattern = t.generate(document.body.clientWidth, ($( "#banner" ).height() + 200 ));
$('#banner').css('background-image', pattern.dataUrl);
});
});

View file

@ -8,7 +8,7 @@
= date_string(@conference.start_date, @conference.end_date) = date_string(@conference.start_date, @conference.end_date)
.row .row
.col-md-6 .col-md-6
- if @conference.venue.name and @conference.venue.website and @conference.venue.address - if @conference.venue.name and @conference.venue.website and @conference.venue.street
%p %p
%small %small
at at

View file

@ -45,16 +45,16 @@
- if can? :update, @conference - if can? :update, @conference
%li{:class=> active_nav_li(edit_admin_conference_splashpage_path(@conference.short_title))} %li{:class=> active_nav_li(edit_admin_conference_splashpage_path(@conference.short_title))}
= link_to 'Splashpage', edit_admin_conference_splashpage_path(@conference.short_title) = link_to 'Splashpage', edit_admin_conference_splashpage_path(@conference.short_title)
- if can? :index, @conference.venue - if can? :index, Venue.new(conference_id: @conference.id)
%li{:class=> "#{active_nav_li(edit_admin_conference_venue_path(@conference.short_title))}"} %li{:class=> "#{active_nav_li(admin_conference_venue_path(@conference.short_title))}"}
= link_to(edit_admin_conference_venue_path(@conference.short_title)) do = link_to(admin_conference_venue_path(@conference.short_title)) do
%span.fa.fa-road %span.fa.fa-road
Venue Venue
%ul %ul
- if can? :update, @conference.rooms.build - if can? :update, @conference.rooms.build
%li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))} %li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))}
= link_to 'Rooms', admin_conference_rooms_path(@conference.short_title) = link_to 'Rooms', admin_conference_rooms_path(@conference.short_title)
- if can? :update, @conference.venue.lodgings.build - if can? :update, @conference.lodgings.build
%li{ class: active_nav_li(admin_conference_lodgings_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) = link_to 'Lodgings', admin_conference_lodgings_path(@conference.short_title)
%li %li

View file

@ -41,4 +41,5 @@
You can run, copy, distribute, study, change and improve it. You can run, copy, distribute, study, change and improve it.
The source code and the developers are on The source code and the developers are on
=link_to "github.", "https://github.com/openSUSE/osem" =link_to "github.", "https://github.com/openSUSE/osem"
= content_for(:script_body)
= piwik_tracking_tag = piwik_tracking_tag

View file

@ -40,7 +40,7 @@ Osem::Application.routes.draw do
resource :splashpage resource :splashpage
resource :venue, only: [:edit, :update] resource :venue
resources :difficulty_levels, only: [:show, :update, :index] resources :difficulty_levels, only: [:show, :update, :index]

View file

@ -0,0 +1,12 @@
class AddAddressFieldsToVenue < ActiveRecord::Migration
def change
add_column :venues, :street, :string
add_column :venues, :postalcode, :integer
add_column :venues, :city, :string
add_column :venues, :country, :string
add_column :venues, :latitude, :string
add_column :venues, :longitude, :string
remove_column :venues, :address, :text
end
end

View file

@ -0,0 +1,7 @@
class CleanupVenue < ActiveRecord::Migration
def change
change_column :venues, :name, :string
remove_column :venues, :offline_map_url, :string
remove_column :venues, :offline_map_bounds, :string
end
end

View file

@ -0,0 +1,25 @@
class ChangeVenueConferenceAssociation < ActiveRecord::Migration
class TempConference < ActiveRecord::Base
self.table_name = 'conferences'
end
class TempVenue < ActiveRecord::Base
self.table_name = 'venues'
attr_accessible :conference_id
end
def change
add_column :venues, :conference_id, :integer
TempVenue.reset_column_information
# Change association from venue and conference
TempConference.all.each do |conference|
if TempVenue.exists?(id: conference.venue_id)
venue = TempVenue.find_by(id: conference.venue_id)
venue.update_attributes(conference_id: conference.id)
end
end
remove_column :conferences, :venue_id, :integer
end
end

View file

@ -0,0 +1,32 @@
class ChangeLodgingAssociationToConference < ActiveRecord::Migration
class TempConference < ActiveRecord::Base
self.table_name = 'conferences'
end
class TempVenue < ActiveRecord::Base
self.table_name = 'venues'
end
class TempLodging < ActiveRecord::Base
self.table_name = 'lodgings'
attr_accessible :conference_id
end
def change
add_column :lodgings, :conference_id, :integer
TempLodging.reset_column_information
# Change association from venue and conference
TempConference.all.each do |conference|
if TempVenue.exists?(conference_id: conference.id)
venue = TempVenue.find_by(conference_id: conference.id)
lodgings = TempLodging.where(venue_id: venue.id)
lodgings.each do |lodging|
lodging.update_attributes(conference_id: conference.id)
end
end
end
remove_column :lodgings, :venue_id, :integer
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20141117222919) do ActiveRecord::Schema.define(version: 20141118162030) do
create_table "ahoy_events", force: true do |t| create_table "ahoy_events", force: true do |t|
t.uuid "visit_id" t.uuid "visit_id"
@ -27,21 +27,21 @@ ActiveRecord::Schema.define(version: 20141117222919) do
create_table "answers", force: true do |t| create_table "answers", force: true do |t|
t.string "title" t.string "title"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
end end
create_table "call_for_papers", force: true do |t| create_table "call_for_papers", force: true do |t|
t.date "start_date", null: false t.date "start_date", null: false
t.date "end_date", null: false t.date "end_date", null: false
t.text "description", null: false t.text "description", limit: 16777215, null: false
t.integer "conference_id" t.integer "conference_id"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
t.boolean "schedule_changes", default: false t.boolean "schedule_changes", default: false
t.integer "rating", default: 3 t.integer "rating", default: 3
t.boolean "schedule_public" t.boolean "schedule_public"
t.boolean "include_cfp_in_splash", default: false t.boolean "include_cfp_in_splash", default: false
end end
create_table "campaigns", force: true do |t| create_table "campaigns", force: true do |t|
@ -57,13 +57,13 @@ ActiveRecord::Schema.define(version: 20141117222919) do
end end
create_table "comments", force: true do |t| create_table "comments", force: true do |t|
t.string "title", limit: 50, default: "" t.string "title", limit: 50, default: ""
t.text "body" t.text "body", limit: 16777215
t.integer "commentable_id" t.integer "commentable_id"
t.string "commentable_type" t.string "commentable_type"
t.integer "user_id" t.integer "user_id"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
t.string "subject" t.string "subject"
t.integer "parent_id" t.integer "parent_id"
t.integer "lft" t.integer "lft"
@ -91,9 +91,8 @@ ActiveRecord::Schema.define(version: 20141117222919) do
t.string "html_export_path" t.string "html_export_path"
t.date "start_date", null: false t.date "start_date", null: false
t.date "end_date", null: false t.date "end_date", null: false
t.integer "venue_id" t.datetime "created_at", null: false
t.datetime "created_at" t.datetime "updated_at", null: false
t.datetime "updated_at"
t.string "logo_file_name" t.string "logo_file_name"
t.string "logo_content_type" t.string "logo_content_type"
t.integer "logo_file_size" t.integer "logo_file_size"
@ -146,8 +145,8 @@ ActiveRecord::Schema.define(version: 20141117222919) do
create_table "dietary_choices", force: true do |t| create_table "dietary_choices", force: true do |t|
t.integer "conference_id" t.integer "conference_id"
t.string "title", null: false t.string "title", null: false
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
end end
create_table "difficulty_levels", force: true do |t| create_table "difficulty_levels", force: true do |t|
@ -155,37 +154,37 @@ ActiveRecord::Schema.define(version: 20141117222919) do
t.string "title" t.string "title"
t.text "description" t.text "description"
t.string "color" t.string "color"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
end end
create_table "email_settings", force: true do |t| create_table "email_settings", force: true do |t|
t.integer "conference_id" t.integer "conference_id"
t.boolean "send_on_registration", default: false t.boolean "send_on_registration", default: false
t.boolean "send_on_accepted", default: false t.boolean "send_on_accepted", default: false
t.boolean "send_on_rejected", default: false t.boolean "send_on_rejected", default: false
t.boolean "send_on_confirmed_without_registration", default: false t.boolean "send_on_confirmed_without_registration", default: false
t.text "registration_email_template" t.text "registration_email_template", limit: 16777215
t.text "accepted_email_template" t.text "accepted_email_template", limit: 16777215
t.text "rejected_email_template" t.text "rejected_email_template", limit: 16777215
t.text "confirmed_email_template" t.text "confirmed_email_template", limit: 16777215
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
t.string "registration_subject" t.string "registration_subject"
t.string "accepted_subject" t.string "accepted_subject"
t.string "rejected_subject" t.string "rejected_subject"
t.string "confirmed_without_registration_subject" t.string "confirmed_without_registration_subject"
t.boolean "send_on_updated_conference_dates", default: false t.boolean "send_on_updated_conference_dates", default: false
t.string "updated_conference_dates_subject" t.string "updated_conference_dates_subject"
t.text "updated_conference_dates_template" t.text "updated_conference_dates_template"
t.boolean "send_on_updated_conference_registration_dates", default: false t.boolean "send_on_updated_conference_registration_dates", default: false
t.string "updated_conference_registration_dates_subject" t.string "updated_conference_registration_dates_subject"
t.text "updated_conference_registration_dates_template" t.text "updated_conference_registration_dates_template"
t.boolean "send_on_venue_update", default: false t.boolean "send_on_venue_update", default: false
t.string "venue_update_subject" t.string "venue_update_subject"
t.text "venue_update_template" t.text "venue_update_template"
t.boolean "send_on_call_for_papers_dates_updates", default: false t.boolean "send_on_call_for_papers_dates_updates", default: false
t.boolean "send_on_call_for_papers_schedule_public", default: false t.boolean "send_on_call_for_papers_schedule_public", default: false
t.string "call_for_papers_schedule_public_subject" t.string "call_for_papers_schedule_public_subject"
t.string "call_for_papers_dates_updates_subject" t.string "call_for_papers_dates_updates_subject"
t.text "call_for_papers_schedule_public_template" t.text "call_for_papers_schedule_public_template"
@ -194,14 +193,14 @@ ActiveRecord::Schema.define(version: 20141117222919) do
create_table "event_attachments", force: true do |t| create_table "event_attachments", force: true do |t|
t.integer "event_id" t.integer "event_id"
t.string "title", null: false t.string "title", null: false
t.string "attachment_file_name" t.string "attachment_file_name"
t.string "attachment_content_type" t.string "attachment_content_type"
t.integer "attachment_file_size" t.integer "attachment_file_size"
t.datetime "attachment_updated_at" t.datetime "attachment_updated_at"
t.boolean "public", default: false t.boolean "public", default: true
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
end end
create_table "event_types", force: true do |t| create_table "event_types", force: true do |t|
@ -223,28 +222,28 @@ ActiveRecord::Schema.define(version: 20141117222919) do
end end
create_table "events", force: true do |t| create_table "events", force: true do |t|
t.string "guid", null: false t.string "guid", null: false
t.integer "conference_id" t.integer "conference_id"
t.integer "event_type_id" t.integer "event_type_id"
t.string "title", null: false t.string "title", null: false
t.string "subtitle" t.string "subtitle"
t.integer "time_slots" t.integer "time_slots"
t.string "state", default: "new", null: false t.string "state", default: "new", null: false
t.string "progress", default: "new", null: false t.string "progress", default: "new", null: false
t.string "language" t.string "language"
t.datetime "start_time" t.datetime "start_time"
t.text "abstract" t.text "abstract", limit: 16777215
t.text "description" t.text "description", limit: 16777215
t.boolean "public", default: true t.boolean "public", default: true
t.string "logo_file_name" t.string "logo_file_name"
t.string "logo_content_type" t.string "logo_content_type"
t.integer "logo_file_size" t.integer "logo_file_size"
t.datetime "logo_updated_at" t.datetime "logo_updated_at"
t.text "proposal_additional_speakers" t.text "proposal_additional_speakers", limit: 16777215
t.integer "track_id" t.integer "track_id"
t.integer "room_id" t.integer "room_id"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
t.boolean "require_registration" t.boolean "require_registration"
t.integer "difficulty_level_id" t.integer "difficulty_level_id"
t.integer "week" t.integer "week"
@ -262,10 +261,10 @@ ActiveRecord::Schema.define(version: 20141117222919) do
t.string "photo_content_type" t.string "photo_content_type"
t.integer "photo_file_size" t.integer "photo_file_size"
t.datetime "photo_updated_at" t.datetime "photo_updated_at"
t.integer "venue_id"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "website_link" t.string "website_link"
t.integer "conference_id"
end end
create_table "openids", force: true do |t| create_table "openids", force: true do |t|
@ -277,6 +276,29 @@ ActiveRecord::Schema.define(version: 20141117222919) do
t.datetime "updated_at" t.datetime "updated_at"
end end
create_table "people", force: true do |t|
t.string "guid", null: false
t.text "first_name"
t.text "last_name"
t.text "public_name"
t.text "company"
t.string "email", null: false
t.boolean "email_public"
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "avatar_updated_at"
t.text "biography"
t.integer "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "irc_nickname"
t.text "volunteer_experience"
t.string "tshirt"
t.string "mobile"
t.string "languages"
end
create_table "photos", force: true do |t| create_table "photos", force: true do |t|
t.text "description" t.text "description"
t.string "picture_file_name" t.string "picture_file_name"
@ -300,8 +322,8 @@ ActiveRecord::Schema.define(version: 20141117222919) do
create_table "question_types", force: true do |t| create_table "question_types", force: true do |t|
t.string "title" t.string "title"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
end end
create_table "questions", force: true do |t| create_table "questions", force: true do |t|
@ -309,8 +331,8 @@ ActiveRecord::Schema.define(version: 20141117222919) do
t.integer "question_type_id" t.integer "question_type_id"
t.integer "conference_id" t.integer "conference_id"
t.boolean "global" t.boolean "global"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
end end
create_table "registration_periods", force: true do |t| create_table "registration_periods", force: true do |t|
@ -325,12 +347,12 @@ ActiveRecord::Schema.define(version: 20141117222919) do
t.integer "conference_id" t.integer "conference_id"
t.datetime "arrival" t.datetime "arrival"
t.datetime "departure" t.datetime "departure"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
t.integer "dietary_choice_id" t.integer "dietary_choice_id"
t.text "other_dietary_choice" t.text "other_dietary_choice", limit: 16777215
t.text "other_special_needs" t.text "other_special_needs", limit: 16777215
t.boolean "attended", default: false t.boolean "attended", default: false
t.boolean "volunteer" t.boolean "volunteer"
t.integer "user_id" t.integer "user_id"
t.integer "week" t.integer "week"
@ -348,8 +370,8 @@ ActiveRecord::Schema.define(version: 20141117222919) do
create_table "roles", force: true do |t| create_table "roles", force: true do |t|
t.string "name" t.string "name"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
t.string "description" t.string "description"
t.integer "resource_id" t.integer "resource_id"
t.string "resource_type" t.string "resource_type"
@ -452,13 +474,13 @@ ActiveRecord::Schema.define(version: 20141117222919) do
end end
create_table "tracks", force: true do |t| create_table "tracks", force: true do |t|
t.string "guid", null: false t.string "guid", null: false
t.integer "conference_id" t.integer "conference_id"
t.string "name", null: false t.string "name", null: false
t.text "description" t.text "description", limit: 16777215
t.string "color" t.string "color"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
end end
create_table "users", force: true do |t| create_table "users", force: true do |t|
@ -476,8 +498,8 @@ ActiveRecord::Schema.define(version: 20141117222919) do
t.datetime "confirmed_at" t.datetime "confirmed_at"
t.datetime "confirmation_sent_at" t.datetime "confirmation_sent_at"
t.string "unconfirmed_email" t.string "unconfirmed_email"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
t.string "name" t.string "name"
t.boolean "email_public" t.boolean "email_public"
t.text "biography" t.text "biography"
@ -510,33 +532,37 @@ ActiveRecord::Schema.define(version: 20141117222919) do
t.integer "conference_id" t.integer "conference_id"
t.date "day" t.date "day"
t.text "description" t.text "description"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
end end
create_table "venues", force: true do |t| create_table "venues", force: true do |t|
t.string "guid" t.string "guid"
t.text "name", limit: 255 t.string "name"
t.text "address", limit: 255
t.string "website" t.string "website"
t.text "description" t.text "description"
t.string "offline_map_url" t.datetime "created_at", null: false
t.string "offline_map_bounds" t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "photo_file_name" t.string "photo_file_name"
t.string "photo_content_type" t.string "photo_content_type"
t.integer "photo_file_size" t.integer "photo_file_size"
t.datetime "photo_updated_at" t.datetime "photo_updated_at"
t.string "street"
t.integer "postalcode"
t.string "city"
t.string "country"
t.string "latitude"
t.string "longitude"
t.integer "conference_id"
end end
create_table "versions", force: true do |t| create_table "versions", force: true do |t|
t.string "item_type", null: false t.string "item_type", null: false
t.integer "item_id", null: false t.integer "item_id", null: false
t.string "event", null: false t.string "event", null: false
t.string "whodunnit" t.string "whodunnit"
t.text "object" t.text "object", limit: 16777215
t.text "object_changes" t.text "object_changes", limit: 16777215
t.datetime "created_at" t.datetime "created_at"
end end
@ -570,8 +596,8 @@ ActiveRecord::Schema.define(version: 20141117222919) do
create_table "votes", force: true do |t| create_table "votes", force: true do |t|
t.integer "event_id" t.integer "event_id"
t.integer "rating" t.integer "rating"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
t.integer "user_id" t.integer "user_id"
end end
@ -579,8 +605,8 @@ ActiveRecord::Schema.define(version: 20141117222919) do
t.integer "conference_id" t.integer "conference_id"
t.string "title", null: false t.string "title", null: false
t.text "description" t.text "description"
t.datetime "created_at" t.datetime "created_at", null: false
t.datetime "updated_at" t.datetime "updated_at", null: false
end end
end end

View file

@ -5,6 +5,5 @@ FactoryGirl.define do
name 'Example Hotel' name 'Example Hotel'
description 'Lorem Ipsum Dolor' description 'Lorem Ipsum Dolor'
website_link 'http://www.example.com' website_link 'http://www.example.com'
venue
end end
end end

View file

@ -2,7 +2,10 @@
FactoryGirl.define do FactoryGirl.define do
factory :venue do factory :venue do
name 'Suse Office' name 'Suse Office'
address 'Maxfeldstrasse 5 \n90409 Nuremberg' street 'Maxfeldstrasse 5'
city 'Nuremberg'
postalcode '90489'
country 'DE'
website 'www.opensuse.org' website 'www.opensuse.org'
description 'Lorem Ipsum Dolor' description 'Lorem Ipsum Dolor'
end end

View file

@ -29,7 +29,7 @@ feature 'Has correct abilities' do
expect(page).to have_link('Schedule', href: "/admin/conference/#{conference1.short_title}/schedule") expect(page).to have_link('Schedule', href: "/admin/conference/#{conference1.short_title}/schedule")
expect(page).to have_link('Campaigns', href: "/admin/conference/#{conference1.short_title}/campaigns") expect(page).to have_link('Campaigns', href: "/admin/conference/#{conference1.short_title}/campaigns")
expect(page).to have_link('Goals', href: "/admin/conference/#{conference1.short_title}/targets") expect(page).to have_link('Goals', href: "/admin/conference/#{conference1.short_title}/targets")
expect(page).to have_link('Venue', href: "/admin/conference/#{conference1.short_title}/venue/edit") expect(page).to have_link('Venue', href: "/admin/conference/#{conference1.short_title}/venue")
expect(page).to have_link('Rooms', href: "/admin/conference/#{conference1.short_title}/rooms") expect(page).to have_link('Rooms', href: "/admin/conference/#{conference1.short_title}/rooms")
expect(page).to have_link('Lodgings', href: "/admin/conference/#{conference1.short_title}/lodgings") expect(page).to have_link('Lodgings', href: "/admin/conference/#{conference1.short_title}/lodgings")
expect(page).to have_link('Sponsorship', href: "/admin/conference/#{conference1.short_title}/sponsorship_levels") expect(page).to have_link('Sponsorship', href: "/admin/conference/#{conference1.short_title}/sponsorship_levels")
@ -100,7 +100,7 @@ feature 'Has correct abilities' do
expect(page).to have_link('Schedule', href: "/admin/conference/#{conference2.short_title}/schedule") expect(page).to have_link('Schedule', href: "/admin/conference/#{conference2.short_title}/schedule")
expect(page).to_not have_link('Campaigns', href: "/admin/conference/#{conference2.short_title}/campaigns") expect(page).to_not have_link('Campaigns', href: "/admin/conference/#{conference2.short_title}/campaigns")
expect(page).to_not have_link('Goals', href: "/admin/conference/#{conference2.short_title}/targets") expect(page).to_not have_link('Goals', href: "/admin/conference/#{conference2.short_title}/targets")
expect(page).to have_link('Venue', href: "/admin/conference/#{conference2.short_title}/venue/edit") expect(page).to have_link('Venue', href: "/admin/conference/#{conference2.short_title}/venue")
expect(page).to have_link('Rooms', href: "/admin/conference/#{conference2.short_title}/rooms") expect(page).to have_link('Rooms', href: "/admin/conference/#{conference2.short_title}/rooms")
expect(page).to_not have_link('Lodgings', href: "/admin/conference/#{conference2.short_title}/lodgings") expect(page).to_not have_link('Lodgings', href: "/admin/conference/#{conference2.short_title}/lodgings")
expect(page).to_not have_link('Sponsorship', href: "/admin/conference/#{conference2.short_title}/sponsorship_levels") expect(page).to_not have_link('Sponsorship', href: "/admin/conference/#{conference2.short_title}/sponsorship_levels")
@ -171,7 +171,7 @@ feature 'Has correct abilities' do
expect(page).to_not have_link('Schedule', href: "/admin/conference/#{conference3.short_title}/schedule") expect(page).to_not have_link('Schedule', href: "/admin/conference/#{conference3.short_title}/schedule")
expect(page).to_not have_link('Campaigns', href: "/admin/conference/#{conference3.short_title}/campaigns") expect(page).to_not have_link('Campaigns', href: "/admin/conference/#{conference3.short_title}/campaigns")
expect(page).to_not have_link('Targets', href: "/admin/conference/#{conference3.short_title}/targets") expect(page).to_not have_link('Targets', href: "/admin/conference/#{conference3.short_title}/targets")
expect(page).to_not have_link('Venue', href: "/admin/conference/#{conference3.short_title}/venue/edit") expect(page).to_not have_link('Venue', href: "/admin/conference/#{conference3.short_title}/venue")
expect(page).to_not have_link('Rooms', href: "/admin/conference/#{conference3.short_title}/rooms") expect(page).to_not have_link('Rooms', href: "/admin/conference/#{conference3.short_title}/rooms")
expect(page).to_not have_link('Lodgings', href: "/admin/conference/#{conference3.short_title}/lodgings") expect(page).to_not have_link('Lodgings', href: "/admin/conference/#{conference3.short_title}/lodgings")
expect(page).to_not have_link('Sponsorship', href: "/admin/conference/#{conference3.short_title}/sponsorship_levels") expect(page).to_not have_link('Sponsorship', href: "/admin/conference/#{conference3.short_title}/sponsorship_levels")
@ -243,7 +243,7 @@ feature 'Has correct abilities' do
expect(page).to_not have_link('Schedule', href: "/admin/conference/#{conference4.short_title}/schedule") expect(page).to_not have_link('Schedule', href: "/admin/conference/#{conference4.short_title}/schedule")
expect(page).to_not have_link('Campaigns', href: "/admin/conference/#{conference4.short_title}/campaigns") expect(page).to_not have_link('Campaigns', href: "/admin/conference/#{conference4.short_title}/campaigns")
expect(page).to_not have_link('Goals', href: "/admin/conference/#{conference4.short_title}/targets") expect(page).to_not have_link('Goals', href: "/admin/conference/#{conference4.short_title}/targets")
expect(page).to_not have_link('Venue', href: "/admin/conference/#{conference4.short_title}/venue/edit") expect(page).to_not have_link('Venue', href: "/admin/conference/#{conference4.short_title}/venue")
expect(page).to_not have_link('Rooms', href: "/admin/conference/#{conference4.short_title}/rooms") expect(page).to_not have_link('Rooms', href: "/admin/conference/#{conference4.short_title}/rooms")
expect(page).to_not have_link('Lodgings', href: "/admin/conference/#{conference4.short_title}/lodgings") expect(page).to_not have_link('Lodgings', href: "/admin/conference/#{conference4.short_title}/lodgings")
expect(page).to_not have_link('Sponsorship', href: "/admin/conference/#{conference4.short_title}/sponsorship_levels") expect(page).to_not have_link('Sponsorship', href: "/admin/conference/#{conference4.short_title}/sponsorship_levels")

View file

@ -8,7 +8,6 @@ feature Lodging do
scenario 'Add a lodging', feature: true, js: true do scenario 'Add a lodging', feature: true, js: true do
path = "#{Rails.root}/app/assets/images/rails.png" path = "#{Rails.root}/app/assets/images/rails.png"
conference.venue = create(:venue)
sign_in organizer sign_in organizer
visit admin_conference_lodgings_path( visit admin_conference_lodgings_path(
conference_id: conference.short_title) conference_id: conference.short_title)
@ -16,7 +15,6 @@ feature Lodging do
click_link 'Add Lodging' click_link 'Add Lodging'
fill_in 'lodging_name', with: 'New lodging' fill_in 'lodging_name', with: 'New lodging'
fill_in 'lodging_description', with: 'This is the lodging description'
fill_in 'lodging_website_link', with: 'http:\\www.google.com' fill_in 'lodging_website_link', with: 'http:\\www.google.com'
attach_file 'Photo', path attach_file 'Photo', path
@ -25,17 +23,13 @@ feature Lodging do
# Validations # Validations
expect(flash).to eq('Lodging successfully created.') expect(flash).to eq('Lodging successfully created.')
expect(page.has_content?('New lodging')).to be true expect(page.has_content?('New lodging')).to be true
expect(page.has_content?('This is the lodging description')).to be true
expect(page.has_content?('Go to Website')).to be true
expect(Lodging.count).to eq(1) expect(Lodging.count).to eq(1)
end end
scenario 'Update a lodging', feature: true, js: true do scenario 'Update a lodging', feature: true, js: true do
path = "#{Rails.root}/app/assets/images/rails.png" path = "#{Rails.root}/app/assets/images/rails.png"
venue = create(:venue) lodging = create(:lodging, conference: conference)
lodging = create(:lodging, venue: conference.venue)
conference.venue = venue
sign_in organizer sign_in organizer
visit admin_conference_lodgings_path( visit admin_conference_lodgings_path(
@ -48,7 +42,6 @@ feature Lodging do
click_link 'Edit' click_link 'Edit'
fill_in 'lodging_name', with: 'New lodging' fill_in 'lodging_name', with: 'New lodging'
fill_in 'lodging_description', with: 'This is the lodging description'
fill_in 'lodging_website_link', with: 'http:\\www.google.com' fill_in 'lodging_website_link', with: 'http:\\www.google.com'
attach_file 'Photo', path attach_file 'Photo', path
@ -57,19 +50,15 @@ feature Lodging do
# Validations # Validations
expect(flash).to eq('Lodging successfully updated.') expect(flash).to eq('Lodging successfully updated.')
expect(page.has_content?('New lodging')).to be true expect(page.has_content?('New lodging')).to be true
expect(page.has_content?('This is the lodging description')).to be true
expect(page.has_content?('Go to Website')).to be true
lodging.reload lodging.reload
expect(lodging.name).to eq('New lodging') expect(lodging.name).to eq('New lodging')
expect(lodging.description).to eq('This is the lodging description') expect(lodging.description).to eq('Lorem Ipsum Dolor')
expect(lodging.website_link).to eq('http:\\www.google.com') expect(lodging.website_link).to eq('http:\\www.google.com')
expect(Lodging.count).to eq(1) expect(Lodging.count).to eq(1)
end end
scenario 'Delete a lodging', feature: true, js: true do scenario 'Delete a lodging', feature: true, js: true do
venue = create(:venue) conference.lodgings << create(:lodging)
create(:lodging, venue: conference.venue)
conference.venue = venue
sign_in organizer sign_in organizer
visit admin_conference_lodgings_path( visit admin_conference_lodgings_path(

View file

@ -17,8 +17,6 @@ feature Splashpage do
expect(flash).to eq('Splashpage successfully created.') expect(flash).to eq('Splashpage successfully created.')
expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title)) expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title))
splashpage = Splashpage.find_by(conference_id: conference.id)
end end
context 'splashpage already created' do context 'splashpage already created' do

View file

@ -17,8 +17,10 @@ feature Conference do
text).to eq('Update Venue') text).to eq('Update Venue')
fill_in 'venue_name', with: 'Example University' fill_in 'venue_name', with: 'Example University'
fill_in 'venue_address', with: 'Example Street 42 \n' + fill_in 'venue_street', with: 'Example Street 42'
'12345 Example City \n Germany' fill_in 'venue_city', with: 'Example City'
fill_in 'venue_postalcode', with: '12345'
select 'Germany', from: 'venue_country'
fill_in 'venue_website', with: 'www.example.com' fill_in 'venue_website', with: 'www.example.com'
fill_in 'venue_description', fill_in 'venue_description',
with: 'Lorem ipsum dolor sit amet, consetetur' \ with: 'Lorem ipsum dolor sit amet, consetetur' \
@ -31,15 +33,13 @@ feature Conference do
venue = Conference.find(conference.id).venue venue = Conference.find(conference.id).venue
expect(venue.name).to eq('Example University') expect(venue.name).to eq('Example University')
expect(venue.address).to eq('Example Street 42 \n' \ expect(venue.street).to eq('Example Street 42')
'12345 Example City \n Germany')
expect(venue.website).to eq('www.example.com') expect(venue.website).to eq('www.example.com')
expect(venue.description).to eq('Lorem ipsum dolor sit amet, consetetur' \ expect(venue.description).to eq('Lorem ipsum dolor sit amet, consetetur' \
'sadipscing elitr, sed diam nonumy eirmod tempor') 'sadipscing elitr, sed diam nonumy eirmod tempor')
click_link 'Edit Venue'
fill_in 'venue_name', with: 'Example University new' fill_in 'venue_name', with: 'Example University new'
fill_in 'venue_address', with: 'Example Street 42 \n ' \
'12345 Example City \n Germany new'
fill_in 'venue_website', with: 'www.example.com new' fill_in 'venue_website', with: 'www.example.com new'
fill_in 'venue_description', fill_in 'venue_description',
with: 'new' with: 'new'
@ -50,8 +50,6 @@ feature Conference do
venue.reload venue.reload
expect(venue.name).to eq('Example University new') expect(venue.name).to eq('Example University new')
expect(venue.address).to eq('Example Street 42 \n ' \
'12345 Example City \n Germany new')
expect(venue.website).to eq('www.example.com new') expect(venue.website).to eq('www.example.com new')
expect(venue.description).to eq('new') expect(venue.description).to eq('new')
end end

View file

@ -980,6 +980,7 @@ describe Conference do
start_date: Date.today, start_date: Date.today,
end_date: Date.today + 14) end_date: Date.today + 14)
subject.call_for_papers = nil subject.call_for_papers = nil
subject.venue = nil
subject.rooms = [] subject.rooms = []
subject.tracks = [] subject.tracks = []
subject.event_types = [] subject.event_types = []
@ -997,6 +998,7 @@ describe Conference do
start_date: Date.today, start_date: Date.today,
end_date: Date.today + 14) end_date: Date.today + 14)
subject.call_for_papers = create(:call_for_papers) subject.call_for_papers = create(:call_for_papers)
subject.venue = nil
subject.rooms = [] subject.rooms = []
subject.tracks = [] subject.tracks = []
subject.event_types = [] subject.event_types = []

View file

@ -4,7 +4,7 @@ describe 'admin/lodgings/index' do
it 'renders lodgings list' do it 'renders lodgings list' do
@conference = create(:conference) @conference = create(:conference)
@conference.venue = create(:venue) @conference.venue = create(:venue)
@conference.venue.lodgings << create(:lodging, venue: @conference.venue) @conference.lodgings << create(:lodging)
assign :venue, @conference.venue assign :venue, @conference.venue
render render
expect(rendered).to include('Example Hotel') expect(rendered).to include('Example Hotel')

View file

@ -1,17 +0,0 @@
require 'spec_helper'
describe 'admin/venues/edit' do
it 'renders venues#show' do
@conference = create(:conference)
@venue = @conference.venue
@venue.name = 'Croatia'
@venue.description = 'Lorem ipsum dolsum'
@venue.save!
assign :conference, @conference
assign :venue, @venue
render
expect(rendered).to include('Croatia')
expect(rendered).to include('Lorem ipsum dolsum')
end
end

View file

@ -33,7 +33,7 @@ describe 'conference/show.html.haml' do
conference: @conference) conference: @conference)
@conference.venue = create(:venue) @conference.venue = create(:venue)
@conference.venue.lodgings << create(:lodging, venue: @conference.venue) @conference.lodgings << create(:lodging)
assign :conference, @conference assign :conference, @conference
render render
end end
@ -51,13 +51,12 @@ describe 'conference/show.html.haml' do
end end
it 'renders call_for_papers partial' do it 'renders call_for_papers partial' do
expect(rendered).to match(/#{@conference.call_for_papers.description}/) expect(rendered).to match(/We are ready to accept your proposals for sessions!/)
end end
it 'renders sponsors partial' do it 'renders sponsors partial' do
expect(view).to render_template(partial: 'conference/_sponsors') expect(view).to render_template(partial: 'conference/_sponsors')
expect(rendered).to match(/example@example.com/) expect(rendered).to match(/example@example.com/)
expect(rendered).to match(/Platin/)
expect(rendered).to match(/Example sponsor/) expect(rendered).to match(/Example sponsor/)
expect(rendered).to match(/www.example.com/) expect(rendered).to match(/www.example.com/)
expect(rendered).to match(/Lorem Ipsum Dolor/) expect(rendered).to match(/Lorem Ipsum Dolor/)
@ -72,8 +71,8 @@ describe 'conference/show.html.haml' do
expect(rendered).to match(/twitter.com/) expect(rendered).to match(/twitter.com/)
end end
it 'renders location partial' do it 'renders venue partial' do
expect(view).to render_template(partial: 'conference/_location') expect(view).to render_template(partial: 'conference/_venue')
expect(rendered).to match(/Suse Office/) expect(rendered).to match(/Suse Office/)
expect(rendered).to match(/Maxfeldstrasse 5/) expect(rendered).to match(/Maxfeldstrasse 5/)
expect(rendered).to match(/www.opensuse.org/) expect(rendered).to match(/www.opensuse.org/)