Add confirmed booths to splashpage

This commit is contained in:
nasia 2017-07-27 11:22:14 +03:00 committed by Stella Rouzi
parent 3f324d4e6f
commit 8b5ebb3dd7
10 changed files with 51 additions and 1 deletions

View file

@ -118,6 +118,7 @@ linters:
- "app/views/conference_registrations/_registration_info.html.haml"
- "app/views/conference_registrations/_volunteer.html.haml"
- "app/views/conference_registrations/show.html.haml"
- "app/views/conferences/_booths.html.haml"
- "app/views/conferences/_call_for_paper.html.haml"
- "app/views/conferences/_conference_details.html.haml"
- "app/views/conferences/_gallery.html.haml"

View file

@ -47,7 +47,8 @@ module Admin
:include_tracks, :include_program, :include_cfp,
:include_venue, :include_registrations,
:include_tickets, :include_lodgings,
:include_sponsors, :include_social_media)
:include_sponsors, :include_social_media,
:include_booths)
end
end
end

View file

@ -25,6 +25,8 @@ class Booth < ActiveRecord::Base
:submitter_relationship,
presence: true
scope :confirmed, -> { where(state: 'confirmed') }
mount_uploader :picture, PictureUploader, mount_on: :logo_link
state_machine initial: :new do

View file

@ -14,6 +14,7 @@
= f.input :include_tickets, label: 'Display tickets', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tickets) }
= f.input :include_lodgings, label: 'Display the lodgings', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_lodgings) }
= f.input :include_sponsors, label: 'Display sponsors', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_sponsors) }
= f.input :include_booths, label: 'Display confirmed booths', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_booths) }
= f.input :include_social_media, label: 'Display social media', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_social_media) }
= f.inputs name: 'Access' do
= f.input :public, label: 'Make splash page public?'

View file

@ -66,6 +66,13 @@
Yes
- else
No
%dt
Include Booths
%dd
- if @splashpage.include_booths
Yes
- else
No
%dt
Include Social Media:
%dd

View file

@ -0,0 +1,24 @@
= content_for :splash_nav do
%li
%a.smoothscroll{ href: '#booths' } Booths
.container
.row
.col-md-12.text-center
%h2 Booths
- @conference.booths.confirmed.each_slice(3).with_index do |slice, index_for_row|
.row.row-centered
- slice.each.with_index do |booth, index_for_column|
.col-md-4.col-sm-4.col-xs-10.col-centered.col-top
.thumbnail
- if booth.logo_link
= link_to booth.website_url, class: 'thumbnail' do
= image_tag booth.picture.large.url
.caption
%h3.text-center
= booth.title
%p.text-center.text-muted
= link_to "#show_descrition_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do
learn more
.collapse{ id: "show_descrition_#{index_for_row}_#{index_for_column}" }
= markdown(booth.description)

View file

@ -38,6 +38,10 @@
= link_to "My Proposals", conference_program_proposals_path(conference.short_title), class: 'btn btn-default'
- elsif can? :new, conference.program.events.new
= link_to "Submit Proposal", new_conference_program_proposal_path(conference.short_title), class: 'btn btn-default'
- if current_user && current_user.booths.where(conference_id: conference.id).count > 0
= link_to 'My Booth Requests', conference_booths_path(conference.short_title), class: 'btn btn-default'
- elsif can? :new, conference.booths.new
= link_to 'Request Booth', new_conference_booth_path(conference.short_title), class: 'btn btn-default'
- if current_user.nil? || !current_user.subscribed?(conference)
= link_to 'Subscribe', conference_subscriptions_path(conference.short_title), method: :post, class: 'btn btn-default'
- else

View file

@ -65,6 +65,10 @@
%section#tickets
= render 'tickets'
- if @conference.booths.confirmed.any? and @conference.splashpage.include_booths
%section#booths
= render 'booths'
- if @conference.sponsors.any? and @conference.splashpage.include_sponsors
%section#sponsors
= render 'sponsors'

View file

@ -0,0 +1,5 @@
class AddIncludeBoothsToSplashpages < ActiveRecord::Migration
def change
add_column :splashpages, :include_booths, :boolean
end
end

View file

@ -451,6 +451,7 @@ ActiveRecord::Schema.define(version: 20170807092805) do
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "include_cfp", default: false
t.boolean "include_booths"
end
create_table "sponsors", force: :cascade do |t|