diff --git a/Gemfile b/Gemfile index 231984a5..7da812cc 100644 --- a/Gemfile +++ b/Gemfile @@ -59,6 +59,12 @@ gem 'jquery-datatables-rails', '~> 2.2.1' # for user avatars gem 'gravtastic' +# for maps +gem 'leaflet-rails', '~> 0.7.4' + +# for country selects +gem 'country_select', github: 'stefanpenner/country_select' + # for upload management gem 'paperclip' diff --git a/Gemfile.lock b/Gemfile.lock index bc351fb0..37423292 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 remote: https://rubygems.org/ specs: @@ -98,12 +105,15 @@ GEM execjs coffee-script-source (1.7.0) columnize (0.8.9) + countries (0.9.3) + currencies (~> 0.4.2) coveralls (0.7.0) multi_json (~> 1.3) rest-client simplecov (>= 0.7) term-ansicolor thor + currencies (0.4.2) d3_rails (3.4.6) railties (>= 3.1.0) daemons (1.1.9) @@ -178,6 +188,7 @@ GEM jwt (1.0.0) launchy (2.4.2) addressable (~> 2.3) + leaflet-rails (0.7.4) letter_opener (1.2.0) launchy (~> 2.2) listen (2.7.2) @@ -430,6 +441,7 @@ DEPENDENCIES capybara chart-js-rails cocoon + country_select! coveralls d3_rails daemons @@ -447,6 +459,7 @@ DEPENDENCIES hoptoad_notifier (~> 2.3) jquery-datatables-rails (~> 2.2.1) jquery-rails + leaflet-rails (~> 0.7.4) letter_opener mina momentjs-rails (>= 2.8.1) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 12ac7ca6..b81e82d5 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -28,11 +28,11 @@ //= require to-markdown //= require markdown //= require moment +//= require leaflet //= require bootstrap-datetimepicker //= require osem-datepickers //= require osem-datatables //= require osem-tickets -//= require osem-splash $(document).ready(function() { $('a[disabled=disabled]').click(function(event){ diff --git a/app/assets/javascripts/osem-splash.js b/app/assets/javascripts/osem-splash.js deleted file mode 100644 index 8b89f2d8..00000000 --- a/app/assets/javascripts/osem-splash.js +++ /dev/null @@ -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); - }); -}); \ No newline at end of file diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 25a8d80e..a9d2d93b 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -12,4 +12,5 @@ *= require font-awesome *= require bootstrap-markdown.min *= require bootstrap-datetimepicker + *= require leaflet */ diff --git a/app/assets/stylesheets/osem-splash.css.scss b/app/assets/stylesheets/osem-splash.css.scss index 85973df0..3a17e3ec 100644 --- a/app/assets/stylesheets/osem-splash.css.scss +++ b/app/assets/stylesheets/osem-splash.css.scss @@ -1,4 +1,6 @@ #splash { + // Counter the general padding for #content + margin-bottom: -60px; section { padding-top: 60px; padding-bottom: 60px; @@ -11,100 +13,129 @@ section:nth-child(odd) { background: none repeat scroll 0 0 #ffffff; color: #7b7b7b; - } -} - -#splash-banner{ - background-repeat: no-repeat; - background-position: center center; - background-size: cover; - margin-top: -10px; - padding-top: 100px; - padding-bottom: 100px; - .container { - #splash-header { - background-color: rgba(224, 224, 224,.80); - padding-top: 20px; - padding-bottom: 20px; + .thumbnail { + background: none repeat scroll 0 0 #e0e0e0; } } -} -#program { - .tracks:hover{ - background-color: white; + .cta-button { + padding-top: 30px; } -} -#callforpapers { - .timer-box{ - width: 130px; - margin: 35px 24px 20px 0; - border-radius: 50%; - border:4px solid #989797; + #banner{ + background-repeat: no-repeat; + background-position: center center; + background-size: cover; + margin-top: -10px; + padding-top: 100px; + padding-bottom: 100px; + .container { + #header { + background-color: rgba(224, 224, 224,.80); + padding-top: 20px; + padding-bottom: 20px; + } + } } - #cfp-date{ - font-size: 40px; - color: #ff6633; + + #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; } -} -#location { - background-repeat: no-repeat; - background-position: center center; - width: 100%; - background-size: cover; - min-height: 500px; - h1,h2,p{ - color: #fff; + #lodging { + .img-lodging { + max-height: 200px; + } } - h1,h2,li,p{ - text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6); - font-weight: 400; + + #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{ - i{ - color: #4a4a4a; + #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; + } } - 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; + + .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; + } } } \ No newline at end of file diff --git a/app/assets/stylesheets/osem.css.scss b/app/assets/stylesheets/osem.css.scss index 1bfda63d..624e968d 100644 --- a/app/assets/stylesheets/osem.css.scss +++ b/app/assets/stylesheets/osem.css.scss @@ -5,11 +5,15 @@ html { body { /* Margin bottom by 2 times the footer height */ - margin-bottom: 120px; + margin-bottom: 60px; /* Margin bottom by navbar height */ padding-top: 60px; } +#content { + padding-bottom: 60px; +} + #footer { position: absolute; bottom: 0; @@ -28,4 +32,21 @@ body { .img-center { 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; } \ No newline at end of file diff --git a/app/controllers/admin/lodgings_controller.rb b/app/controllers/admin/lodgings_controller.rb index e05ea3b0..43600b26 100644 --- a/app/controllers/admin/lodgings_controller.rb +++ b/app/controllers/admin/lodgings_controller.rb @@ -1,23 +1,21 @@ module Admin class LodgingsController < Admin::BaseController load_and_authorize_resource :conference, find_by: :short_title - load_and_authorize_resource :venue, through: :conference, singleton: true - load_and_authorize_resource :lodging, through: :venue + load_and_authorize_resource :lodging, through: :conference def index - authorize! :update, Lodging.new(venue_id: @venue.id) end def show; end def new - @lodging = @venue.lodgings.new + @lodging = @conference.lodgings.new end def create - @lodging = @venue.lodgings.new(lodging_params) + @lodging = @conference.lodgings.new(lodging_params) 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.') else flash[:error] = "Creating Lodging failed: #{@lodging.errors.full_messages.join('. ')}." diff --git a/app/controllers/admin/venues_controller.rb b/app/controllers/admin/venues_controller.rb index 1a11713a..9bb8e9b0 100644 --- a/app/controllers/admin/venues_controller.rb +++ b/app/controllers/admin/venues_controller.rb @@ -3,16 +3,48 @@ module Admin load_and_authorize_resource :conference, find_by: :short_title load_and_authorize_resource :venue, through: :conference, singleton: true + def show; end + + def new + @venue = @conference.build_venue + 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 - if @venue.update_attributes(params[:venue]) - redirect_to(edit_admin_conference_venue_path(conference_id: @conference.short_title), + if @venue.update_attributes(venue_params) + redirect_to(admin_conference_venue_path(conference_id: @conference.short_title), notice: 'Venue was successfully updated.') else flash[:error] = "Update venue failed: #{@venue.errors.full_messages.join('. ')}." render :edit 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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e84b9a57..9da23c54 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -171,6 +171,34 @@ module ApplicationHelper result 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) options = { autolink: true, diff --git a/app/models/ability.rb b/app/models/ability.rb index ba6f1093..9ec2b3ee 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -43,21 +43,15 @@ class Ability def user_with_roles(user) conf_ids_for_organizer = [] - venue_ids_for_organizer = [] conf_ids_for_cfp = [] - venue_ids_for_cfp = [] conf_ids_for_info_desk = [] conf_ids_for_volunteer_coordinator = [] # Ids of all the conferences for which the user has an 'organizer' role conf_ids_for_organizer = 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 = 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 conf_ids_for_info_desk = 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| # conference.id = conf_ids_for_organizer # 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, Question, conference_id: conf_ids_for_organizer + conf_ids_for_info_desk 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, EmailSettings, conference_id: conf_ids_for_organizer + conf_ids_for_cfp 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, Room, conference_id: conf_ids_for_organizer + conf_ids_for_cfp can :manage, Sponsor, conference_id: conf_ids_for_organizer diff --git a/app/models/conference.rb b/app/models/conference.rb index 75995134..63c4065d 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -29,6 +29,7 @@ class Conference < ActiveRecord::Base has_one :registration_period, dependent: :destroy has_one :email_settings, dependent: :destroy has_one :call_for_papers, dependent: :destroy + has_one :venue, dependent: :destroy has_many :social_events, dependent: :destroy has_many :ticket_purchases has_many :supporters, through: :ticket_purchases, source: :user @@ -53,6 +54,7 @@ class Conference < ActiveRecord::Base has_many :tracks, dependent: :destroy has_many :difficulty_levels, dependent: :destroy has_many :rooms, dependent: :destroy + has_many :lodgings, dependent: :destroy has_many :registrations, dependent: :destroy has_many :participants, through: :registrations, source: :user has_many :vdays, dependent: :destroy @@ -64,7 +66,6 @@ class Conference < ActiveRecord::Base has_many :campaigns, dependent: :destroy has_many :commercials, as: :commercialable, 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 :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_format_of :short_title, with: /\A[a-zA-Z0-9_-]*\z/ before_create :generate_guid - before_create :create_venue before_create :create_event_types before_create :create_email_settings before_create :add_color @@ -727,14 +727,13 @@ class Conference < ActiveRecord::Base rooms.count > 0 end - ## - # Checks if venue has a name, address and website. + # Checks if the conference has a venue object. # # ====Returns - # * +True+ -> If venue has a name, address and website. - # * +False+ -> venue has a no name, address or website. + # * +True+ -> If conference has a venue object. + # * +False+ -> IF conference has no venue object. def venue_set? - !!venue && !!venue.name && !!venue.address && !!venue.website + !!venue end ## @@ -885,14 +884,6 @@ class Conference < ActiveRecord::Base result 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. # diff --git a/app/models/lodging.rb b/app/models/lodging.rb index 554c6e8a..7c37a047 100644 --- a/app/models/lodging.rb +++ b/app/models/lodging.rb @@ -1,6 +1,6 @@ class Lodging < ActiveRecord::Base - attr_accessible :name, :description, :photo, :website_link, :venue_id - belongs_to :venue + attr_accessible :name, :description, :photo, :website_link, :conference_id + belongs_to :conference validates :name, presence: true diff --git a/app/models/venue.rb b/app/models/venue.rb index 3f9dffbd..2eab0d82 100644 --- a/app/models/venue.rb +++ b/app/models/venue.rb @@ -1,30 +1,39 @@ class Venue < ActiveRecord::Base - attr_accessible :name, :description, :website, :address, :photo, :lodgings_attributes, - :include_venue_in_splash, :include_lodgings_in_splash - has_many :conferences + belongs_to :conference has_many :lodgings 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, 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, allow_destroy: true 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 def send_mail_notification - conferences.each do |conference| - Mailbot.delay.send_email_on_venue_update(conference) if venue_notify?(conference) - end + Mailbot.delay.send_email_on_venue_update(conference) if venue_notify?(conference) end def venue_notify?(conference) - (self.name_changed? || self.address_changed?) && - (!self.name.blank? && !self.address.blank?) && + (self.name_changed? || self.street_changed?) && + (!self.name.blank? && !self.street.blank?) && (conference.email_settings.send_on_venue_update && !conference.email_settings.venue_update_subject.blank? && conference.email_settings.venue_update_template) diff --git a/app/views/admin/conference/_edit_show.html.haml b/app/views/admin/conference/_edit_show.html.haml index c7375f78..aed09aad 100644 --- a/app/views/admin/conference/_edit_show.html.haml +++ b/app/views/admin/conference/_edit_show.html.haml @@ -12,7 +12,8 @@ %dt Description %dd - = markdown(@conference.description) + - unless @conference.description.blank? + = markdown(@conference.description) %dt Date %dd diff --git a/app/views/admin/lodgings/_form.html.haml b/app/views/admin/lodgings/_form.html.haml index 0e397359..9c4d7765 100644 --- a/app/views/admin/lodgings/_form.html.haml +++ b/app/views/admin/lodgings/_form.html.haml @@ -1,8 +1,8 @@ -= f.input :name -= 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.") -= image_tag f.object.photo(:thumb) if !f.object.photo.blank? -= f.input :photo -= f.input :website_link -= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } - -= link_to 'Back', admin_conference_lodgings_path(@conference.short_title) += semantic_form_for(@lodging, :url => (@lodging.new_record? ? admin_conference_lodgings_path : admin_conference_lodging_path(@conference.short_title, @lodging))) do |f| + = f.input :name + = f.input :website_link + = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint + - unless @lodging.photo.blank? + = image_tag @lodging.photo(:thumb) + = f.input :photo + = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/lodgings/edit.html.haml b/app/views/admin/lodgings/edit.html.haml deleted file mode 100644 index 8e9b1d22..00000000 --- a/app/views/admin/lodgings/edit.html.haml +++ /dev/null @@ -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 } diff --git a/app/views/admin/lodgings/index.html.haml b/app/views/admin/lodgings/index.html.haml index 68ebf00b..f3a15e45 100644 --- a/app/views/admin/lodgings/index.html.haml +++ b/app/views/admin/lodgings/index.html.haml @@ -1,5 +1,5 @@ %h1 Lodgings -- if @venue.lodgings.any? +- if @conference.lodgings.any? .row .col-md-12 %table.table @@ -9,7 +9,7 @@ %th Edit %th Delete %tbody - - @venue.lodgings.each_with_index do |lodging, index| + - @conference.lodgings.each_with_index do |lodging, index| %tr %td = index + 1 diff --git a/app/views/admin/lodgings/new.html.haml b/app/views/admin/lodgings/new.html.haml deleted file mode 100644 index 1e5ea564..00000000 --- a/app/views/admin/lodgings/new.html.haml +++ /dev/null @@ -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 } diff --git a/app/views/admin/venues/_form.html.haml b/app/views/admin/venues/_form.html.haml index f94ddd7f..bc74818c 100644 --- a/app/views/admin/venues/_form.html.haml +++ b/app/views/admin/venues/_form.html.haml @@ -1,8 +1,7 @@ = semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f| - = f.input :name, input_html: { rows: 1 } - = f.input :address, input_html: { rows: 1 } - = f.input :website + = f.inputs :name, :website = 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? = image_tag @venue.photo(:thumb) = f.input :photo diff --git a/app/views/admin/venues/_show.html.haml b/app/views/admin/venues/_show.html.haml deleted file mode 100644 index fa6688c6..00000000 --- a/app/views/admin/venues/_show.html.haml +++ /dev/null @@ -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! \ No newline at end of file diff --git a/app/views/admin/venues/edit.html.haml b/app/views/admin/venues/edit.html.haml deleted file mode 100644 index d5c798a7..00000000 --- a/app/views/admin/venues/edit.html.haml +++ /dev/null @@ -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' diff --git a/app/views/admin/venues/show.html.haml b/app/views/admin/venues/show.html.haml new file mode 100644 index 00000000..f421aeaa --- /dev/null +++ b/app/views/admin/venues/show.html.haml @@ -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 \ No newline at end of file diff --git a/app/views/conference/_call_for_papers.html.haml b/app/views/conference/_call_for_papers.html.haml index 51e58a87..28124125 100644 --- a/app/views/conference/_call_for_papers.html.haml +++ b/app/views/conference/_call_for_papers.html.haml @@ -5,55 +5,35 @@ .container .row .col-md-12.text-center - %h1 - Call For Papers - - if !@conference.call_for_papers.description.blank? - = markdown(@conference.call_for_papers.description) + %h2 + Call for Papers + %p.lead + 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 .col-md-12.text-center - .lead - = link_to "Submit Your Proposals Today", conference_proposal_index_path(@conference.short_title), class: 'btn btn-info', target: '_blank' - - 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); - }); - + %p.cta-button + = link_to "Submit your paper now", conference_proposal_index_path(@conference.short_title), class: 'btn btn-success btn-lg text-center' \ No newline at end of file diff --git a/app/views/conference/_conference_details.html.haml b/app/views/conference/_conference_details.html.haml index 9dd90e4e..29d12933 100644 --- a/app/views/conference/_conference_details.html.haml +++ b/app/views/conference/_conference_details.html.haml @@ -10,14 +10,6 @@ %small %b = 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 - , - \#{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 .btn-group-vertical - if current_user.nil? || !current_user.subscribed?(conference) diff --git a/app/views/conference/_footer.html.haml b/app/views/conference/_footer.html.haml index 571d56ea..e27eb76e 100644 --- a/app/views/conference/_footer.html.haml +++ b/app/views/conference/_footer.html.haml @@ -1,5 +1,5 @@ %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 :javascript diff --git a/app/views/conference/_location.html.haml b/app/views/conference/_location.html.haml deleted file mode 100644 index 2cff45e3..00000000 --- a/app/views/conference/_location.html.haml +++ /dev/null @@ -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) diff --git a/app/views/conference/_lodging.html.haml b/app/views/conference/_lodging.html.haml index 1a13065e..d0bf9de9 100644 --- a/app/views/conference/_lodging.html.haml +++ b/app/views/conference/_lodging.html.haml @@ -4,16 +4,23 @@ %h2 Accommodation Deals %p.lead We have prepared affordable accommodation deals for your visit. - .row - - @conference.venue.lodgings.each do |r| - %div{ class: (@conference.venue.lodgings.count.to_i <= 2 ? "col-md-#{12/@conference.venue.lodgings.count.to_i}" : "col-md-4") } - .div.thumbnail - -unless r.photo.blank? - = image_tag r.photo(:large), class: 'img-responsive' - -unless r.name.blank? - %h4.text-center #{ r.name } - -unless r.description.blank? - .lead.text-left #{ markdown(r.description) } - - unless r.website_link.blank? - .text-center - = link_to 'Go to Website', r.website_link + - @conference.lodgings.each_slice(3) do |slice| + .row.row-centered + - slice.each do |lodging| + .col-md-4.ticket.col-centered.col-top + .thumbnail + - if lodging.photo.blank? + %p.text-center + %i.fa.fa-home.fa-5x + - else + -if lodging.website_link.present? + = link_to(lodging.website_link, class: 'thumbnail') do + = image_tag lodging.photo(:large), class: 'img-responsive img-lodging' + - else + = image_tag lodging.photo(:large), class: 'img-responsive img-lodging' + .caption + %h3.text-center + = lodging.name + -if lodging.description.present? + = markdown(lodging.description) + diff --git a/app/views/conference/_program.html.haml b/app/views/conference/_program.html.haml index 84aa5f97..bba0c5b0 100644 --- a/app/views/conference/_program.html.haml +++ b/app/views/conference/_program.html.haml @@ -1,36 +1,34 @@ -= content_for :splash_nav do - %li - =link_to('#program', class: 'smoothscroll') do - Program - .container .row - .col-md-12.text-center - %h1 Program - - if @conference.splashpage and @conference.splashpage.include_tracks - .row - .col-md-12 - - @conference.tracks.each do |t| - .tracks{ class: (@conference.tracks.count.to_i <= 2 ? "col-md-#{12/@conference.tracks.count.to_i}" : "col-md-4") } - %h4.text-center - = t.name - %p - = markdown(t.description) - - if @conference.call_for_papers and @conference.call_for_papers.schedule_public - .row - .col-md-12 - %p.text-center - Check out our - = link_to 'Schedule', conference_schedule_path(@conference.short_title) - - if !@keynote_speakers.blank? - %div.row.text-center - %div.col-md-12 - %h3 Keynote Speakers - - @keynote_speakers.each do |k| - %div{ class: (@keynote_speakers.count.to_i <= 2 ? "col-md-#{12/@keynote_speakers.count.to_i}" : "col-md-4") } - = image_tag(k.gravatar_url(size: '80'), class: 'img-circle') unless k.gravatar_url.blank? - %h4 - = k.name - -unless k.biography.blank? - %p - = k.biography + .col-md-12 + %h2.text-center + Program + %p.lead.text-center + = @conference.short_title + has the most awesome program ever! + - if @conference.splashpage and @conference.splashpage.include_tracks + See rock-star speakers cover the topics of + - if @conference.splashpage and @conference.splashpage.include_tracks + - @conference.tracks.each_slice(3) do |slice| + .row.row-centered + - slice.each do |track| + .col-md-4.col-centered.col-top.track + %h4.text-center + = track.name + = markdown(track.description) + + - if @conference.call_for_papers and @conference.call_for_papers.schedule_public + .row + .col-md-12 + %p.cta-button.text-center + = link_to(conference_schedule_path(@conference.short_title), class: 'btn btn-default btn-lg') do + Full Schedule + + - #FIXME: Display keynotes https://github.com/openSUSE/osem/issues/544 + - #FIXME: Display schedule highlights https://github.com/openSUSE/osem/issues/545 + + + = content_for :splash_nav do + %li + =link_to('#program', class: 'smoothscroll') do + Program \ No newline at end of file diff --git a/app/views/conference/_registration.html.haml b/app/views/conference/_registration.html.haml index 5a5480cf..a19ba66b 100644 --- a/app/views/conference/_registration.html.haml +++ b/app/views/conference/_registration.html.haml @@ -9,8 +9,11 @@ %p.lead Going to = @conference.short_title - is free of charge. We only ask you to - = link_to "register yourself", new_conference_conference_registrations_path(@conference.short_title) - until - = @conference.registration_period.end_date - + is free of charge. + %p + We only ask you to register yourself until + = @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 diff --git a/app/views/conference/_social_media.html.haml b/app/views/conference/_social_media.html.haml index 7aca46bd..eefcbd0c 100644 --- a/app/views/conference/_social_media.html.haml +++ b/app/views/conference/_social_media.html.haml @@ -2,21 +2,18 @@ %li %a.smoothscroll{ href: '#social-media' } Social Media -%div.container#social-media.text-center - %div.row - - unless @conference.contact.facebook.blank? - %div.col-md-3 +.container + .row + .col-md-12.text-center + - unless @conference.contact.facebook.blank? = link_to "#{ @conference.contact.facebook }" do %i.fa.fa-facebook-square.fa-4x - - unless @conference.contact.twitter.blank? - %div.col-md-3 + - unless @conference.contact.twitter.blank? = link_to "#{ @conference.contact.twitter }" do %i.fa.fa-twitter.fa-4x - - unless @conference.contact.instagram.blank? - %div.col-md-3 + - unless @conference.contact.instagram.blank? = link_to "#{ @conference.contact.instagram }" do %i.fa.fa-instagram.fa-4x - - unless @conference.contact.googleplus.blank? - %div.col-md-3 + - unless @conference.contact.googleplus.blank? = link_to "#{ @conference.contact.googleplus }" do %i.fa.fa-google-plus-square.fa-4x diff --git a/app/views/conference/_sponsors.html.haml b/app/views/conference/_sponsors.html.haml index bb1755e3..7c965369 100644 --- a/app/views/conference/_sponsors.html.haml +++ b/app/views/conference/_sponsors.html.haml @@ -12,16 +12,21 @@ wouldn't be possible! - @conference.sponsorship_levels.each do |sponsorship_level| -if sponsorship_level.sponsors.any? - .row - .col-md-12.text-center - %h3 - = sponsorship_level.title - sponsorship_level.sponsors.each_slice(3) do |slice| - .row + .row.row-centered - slice.each do |sponsor| - .col-md-4 - = link_to("http://#{sponsor.website_url}", class: 'thumbnail') do - = image_tag(sponsor.logo(:large), alt: "#{sponsor.name} Logo", title: "#{sponsor.description}") + .col-md-4.col-centered.col-top + .thumbnail + - 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? .row .col-md-12 diff --git a/app/views/conference/_tickets.html.haml b/app/views/conference/_tickets.html.haml index 5f8e43ec..d014fa90 100644 --- a/app/views/conference/_tickets.html.haml +++ b/app/views/conference/_tickets.html.haml @@ -1,21 +1,25 @@ .container .row .col-md-12.text-center - %h1 + %h2 Support =@conference.short_title %p.lead - To support our event you can purchase tickets - .row - - @conference.tickets.each do |ticket| - %div{ class: (@conference.tickets.count <= 2 ? "col-md-#{12/@conference.tickets.count}" : "col-md-4") } - - if ticket.title.present? - %h4.text-center - =ticket.title - - if ticket.description.present? - = markdown(ticket.description) - .text-center - .btn-group - = link_to(conference_tickets_path(@conference.short_title), class: 'btn btn-success') do - Buy Ticket - = "#{humanized_money_with_symbol ticket.price}" + To support our event you can purchase these tickets + - @conference.tickets.each_slice(4) do |slice| + .row.row-centered + - slice.each do |ticket| + .col-md-3.col-centered.col-top + .thumbnail + %p.text-center + %i.fa.fa-ticket.fa-5x + .caption + %h3.text-center + = ticket.title + -if ticket.description.present? + = markdown(ticket.description) + %p.text-center + = link_to(conference_tickets_path(@conference.short_title), class: 'btn btn-success') do + Buy Ticket + = humanized_money_with_symbol ticket.price + diff --git a/app/views/conference/_venue.html.haml b/app/views/conference/_venue.html.haml new file mode 100644 index 00000000..5c8742bb --- /dev/null +++ b/app/views/conference/_venue.html.haml @@ -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 = "