From cf3aeda1d2435067b5ca217cab28ab90932947c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Fri, 24 Nov 2017 21:41:08 +0100 Subject: [PATCH 01/56] Fixing admin user creation in docker Added db:seed in order to have the deleted user, and be able to have an admin user. --- docker/init.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/init.sh b/docker/init.sh index 3a2031f3..23188d98 100644 --- a/docker/init.sh +++ b/docker/init.sh @@ -42,6 +42,9 @@ fi echo ">>> Upgrading database..." bundle exec rake db:migrate +echo ">>> Seed database..." +bundle exec rake db:seed + rm .my.cnf echo ">>> Precompiling assets..." From e40cdeb94bdff796a59f0f275c844aa798237546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Tue, 28 Nov 2017 17:27:42 +0100 Subject: [PATCH 02/56] Update init.sh --- docker/init.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/init.sh b/docker/init.sh index 23188d98..6a29044f 100644 --- a/docker/init.sh +++ b/docker/init.sh @@ -37,14 +37,14 @@ dockerize -wait tcp://$DATABASE_HOST:$DATABASE_PORT -timeout 60s true if [ $(echo "show tables;" | mysql --host $DATABASE_HOST --port $DATABASE_PORT $MYSQL_DATABASE | wc -l) -le 1 ]; then echo ">>> Initializing database..." bundle exec rake db:schema:load + + echo ">>> Seed database..." + bundle exec rake db:seed fi echo ">>> Upgrading database..." bundle exec rake db:migrate -echo ">>> Seed database..." -bundle exec rake db:seed - rm .my.cnf echo ">>> Precompiling assets..." From e01d8493742728334e726b7dfdc7aa2599a08d4e Mon Sep 17 00:00:00 2001 From: James Mason Date: Thu, 30 Nov 2017 10:37:20 -0800 Subject: [PATCH 03/56] Add a picture format for conference tickets --- app/uploaders/picture_uploader.rb | 9 +++++++++ db/migrate/20171130172334_rebuild_conference_pictures.rb | 9 +++++++++ db/schema.rb | 2 +- spec/models/conference_spec.rb | 4 ++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20171130172334_rebuild_conference_pictures.rb diff --git a/app/uploaders/picture_uploader.rb b/app/uploaders/picture_uploader.rb index b17f0d76..76cf0708 100644 --- a/app/uploaders/picture_uploader.rb +++ b/app/uploaders/picture_uploader.rb @@ -80,6 +80,11 @@ class PictureUploader < CarrierWave::Uploader::Base process resize_and_pad: [320, 120, 'white'] end + version :ticket, if: :conference? + version :ticket do + process resize_and_pad: [120, 70] + end + # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: def extension_white_list @@ -95,4 +100,8 @@ class PictureUploader < CarrierWave::Uploader::Base def sponsor?(_picture) object_class_name == 'sponsors' end + + def conference?(_picture) + object_class_name == 'conferences' + end end diff --git a/db/migrate/20171130172334_rebuild_conference_pictures.rb b/db/migrate/20171130172334_rebuild_conference_pictures.rb new file mode 100644 index 00000000..a8d74bce --- /dev/null +++ b/db/migrate/20171130172334_rebuild_conference_pictures.rb @@ -0,0 +1,9 @@ +class RebuildConferencePictures < ActiveRecord::Migration + def up + Conference.all.each do |conference| + conference.picture.recreate_versions! + end + end + + def down; end +end diff --git a/db/schema.rb b/db/schema.rb index de53720a..6df61a48 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171118113113) do +ActiveRecord::Schema.define(version: 20171130172334) do create_table "ahoy_events", force: :cascade do |t| t.integer "visit_id" diff --git a/spec/models/conference_spec.rb b/spec/models/conference_spec.rb index 26070134..0af13eed 100755 --- a/spec/models/conference_spec.rb +++ b/spec/models/conference_spec.rb @@ -1704,4 +1704,8 @@ describe Conference do it { is_expected.to eq [past_conference1, past_conference2] } end + + it 'should have a picture format for tickets' do + expect(create(:conference).picture.ticket.url) + end end From 710010cb7611466a51961ad9b746c5e94629b6f4 Mon Sep 17 00:00:00 2001 From: James Mason Date: Thu, 30 Nov 2017 10:40:02 -0800 Subject: [PATCH 04/56] Use a picture format for ticketing Instead of analyzing image size using the local file, rely on a processed image of the appropriate dimensions. Resolves #1828 --- app/pdfs/ticket_pdf.rb | 18 +++++++++++++----- app/uploaders/picture_uploader.rb | 4 ---- app/views/physical_tickets/show.html.haml | 7 +------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/pdfs/ticket_pdf.rb b/app/pdfs/ticket_pdf.rb index 9a09f9fe..d21a1e27 100644 --- a/app/pdfs/ticket_pdf.rb +++ b/app/pdfs/ticket_pdf.rb @@ -1,3 +1,5 @@ +require 'open-uri' + class TicketPdf < Prawn::Document def initialize(conference, user, physical_ticket, ticket_layout, file_name) super(page_layout: ticket_layout, page_size: 'A4', filename: file_name) @@ -43,11 +45,17 @@ class TicketPdf < Prawn::Document def draw_second_square move_up 150 if @conference.picture? - if 7 * @conference.picture.image[:width] > 12 * @conference.picture.image[:height] - image "#{Rails.root}/public#{@conference.picture_url}", at: [@mid_horizontal + 30, cursor], width: 120 - else - image "#{Rails.root}/public#{@conference.picture_url}", at: [@mid_horizontal + 30, cursor], height: 70 - end + conference_image = case @conference.picture.ticket.url[0, 4] + when 'http', 'ftp:' # CDNs + open(@conference.picture.ticket.url) + when '/sys' # local storage + open([ + Rails.root, + '/public', + @conference.picture.ticket.url + ].join) + end + image conference_image, at: [@mid_horizontal + 30, cursor] else image "#{Rails.root}/public/img/osem-logo.png", at: [@mid_horizontal + 30, cursor], height: 70 end diff --git a/app/uploaders/picture_uploader.rb b/app/uploaders/picture_uploader.rb index 76cf0708..41bcab7b 100644 --- a/app/uploaders/picture_uploader.rb +++ b/app/uploaders/picture_uploader.rb @@ -52,10 +52,6 @@ class PictureUploader < CarrierWave::Uploader::Base "system/#{object_class_name}/#{mounted_as}/#{model.id}" end - def image - @image ||= MiniMagick::Image.open(file.file) - end - # Create different versions of your uploaded files: version :large do process resize_to_fit: [300, 300] diff --git a/app/views/physical_tickets/show.html.haml b/app/views/physical_tickets/show.html.haml index 40513ae8..7dbc44da 100644 --- a/app/views/physical_tickets/show.html.haml +++ b/app/views/physical_tickets/show.html.haml @@ -31,12 +31,7 @@ = @user.email .col-md-5.col-md-offset-2.box.well - if @conference.picture? - - width = @conference.picture.image[:width] - - height = @conference.picture.image[:height] - - if 10 * width > 15 * height - = image_tag(@conference.picture_url, width: '150') - - else - = image_tag(@conference.picture_url, height: '100') + = image_tag(@conference.picture.ticket.url, class: 'img-responsive') - else = image_tag('/img/osem-logo.png', class: 'img-responsive') %p.text-left From d813470995fc3dea8a4981827a398eb4dba7b65f Mon Sep 17 00:00:00 2001 From: Sidharth Date: Fri, 8 Dec 2017 15:03:30 +0530 Subject: [PATCH 05/56] Contribution.md broken url The link to capybara was broken in CONTRIBUTION.md file Fixes #1862 --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5193725d..aa8bdbb2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,7 +82,7 @@ You can read through current enabled rules in `.rubocop.yml` file. Explanations Additionally you can read through the [ruby style-guide](https://github.com/bbatsov/ruby-style-guide) to better understand core principles. ### Test Suite -We are using [rspec](http://rspec.info/)+[capybara](http://jnicklas.github.io/capybara/)+[factory girl](https://github.com/thoughtbot/factory_girl) as a test suite. You can run it locally +We are using [rspec](http://rspec.info/)+[capybara](http://www.rubydoc.info/github/jnicklas/capybara)+[factory girl](https://github.com/thoughtbot/factory_girl) as a test suite. You can run it locally ```shell vagrant exec bundle exec rspec From b93613fcc586f6ae61f352414f9b7796a87a84ae Mon Sep 17 00:00:00 2001 From: Sidharth Bansal Date: Tue, 12 Dec 2017 11:45:23 +0530 Subject: [PATCH 06/56] Updated link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa8bdbb2..bef64aab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,7 +82,7 @@ You can read through current enabled rules in `.rubocop.yml` file. Explanations Additionally you can read through the [ruby style-guide](https://github.com/bbatsov/ruby-style-guide) to better understand core principles. ### Test Suite -We are using [rspec](http://rspec.info/)+[capybara](http://www.rubydoc.info/github/jnicklas/capybara)+[factory girl](https://github.com/thoughtbot/factory_girl) as a test suite. You can run it locally +We are using [rspec](http://rspec.info/)+[capybara](http://teamcapybara.github.io/capybara/)+[factory girl](https://github.com/thoughtbot/factory_girl) as a test suite. You can run it locally ```shell vagrant exec bundle exec rspec From 9608e2032a0a5ebb529fa74765322859683df3c4 Mon Sep 17 00:00:00 2001 From: Thaleia Tagaraki Date: Sat, 2 Dec 2017 16:23:56 +0200 Subject: [PATCH 07/56] Add autofocus in admin/tickets#new --- app/views/admin/tickets/_form.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/tickets/_form.html.haml b/app/views/admin/tickets/_form.html.haml index 319f7996..f66cea51 100644 --- a/app/views/admin/tickets/_form.html.haml +++ b/app/views/admin/tickets/_form.html.haml @@ -9,8 +9,8 @@ .row .col-md-8 = semantic_form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f| - = f.input :title - = f.input :description, input_html: { rows: 5, data: { provide: "markdown-editable" } } + = f.input :title, input_html: { autofocus: true } + = f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } } = f.input :price = f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], include_blank: false = f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.' From 6d7e1f4865a93962009746cfca5bddf664f64abc Mon Sep 17 00:00:00 2001 From: Adriano Vieira Date: Sat, 9 Dec 2017 12:00:50 -0200 Subject: [PATCH 08/56] autofill CFP end date - automatically setting the end date to the start date when creating CFP for UX reasons (fix #1872) --- app/assets/javascripts/osem-datepickers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/osem-datepickers.js b/app/assets/javascripts/osem-datepickers.js index 84533b49..6dc89f43 100644 --- a/app/assets/javascripts/osem-datepickers.js +++ b/app/assets/javascripts/osem-datepickers.js @@ -98,6 +98,9 @@ $(function () { $("#registration-period-start-datepicker").on("dp.change",function (e) { $('#registration-period-end-datepicker').data("DateTimePicker").setMinDate(e.date); + if (!$('#registration-period-end-datepicker').val()) { + $('#registration-period-end-datepicker').data("DateTimePicker").setDate(e.date); + } }); $("#registration-period-end-datepicker").on("dp.change",function (e) { $('#registration-period-start-datepicker').data("DateTimePicker").setMaxDate(e.date); From e5009f168c46155e7162d5c873f3cc691840f617 Mon Sep 17 00:00:00 2001 From: rishabhptr Date: Tue, 5 Dec 2017 17:03:44 +0530 Subject: [PATCH 09/56] Fixed email text overflow in proposal#show Email icon is used solve email text overflow. Fixes #1838 --- app/views/proposals/show.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/proposals/show.html.haml b/app/views/proposals/show.html.haml index 19f9371f..99f2d49e 100644 --- a/app/views/proposals/show.html.haml +++ b/app/views/proposals/show.html.haml @@ -36,8 +36,10 @@ .col-md-8 %h4 = link_to speaker.name, user_path(speaker.id) + %br - if speaker.email_public? - = "(#{speaker.email})" + = mail_to "#{ speaker.email }" do + %i.fa.fa-envelope-o.fa-2x - if speaker.affiliation? .text-muted from From ac8b187f1f855d339a62cd05e565bbd413a4d9cb Mon Sep 17 00:00:00 2001 From: Naman Gupta <01namangupta@gmail.com> Date: Thu, 23 Nov 2017 01:19:26 +0530 Subject: [PATCH 10/56] Speaker is also able to see the proposal and able to modify it --- app/models/user.rb | 2 +- spec/models/user_spec.rb | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 4510aece..9a44a6a6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -216,7 +216,7 @@ class User < ApplicationRecord end def proposals(conference) - events.where('program_id = ? AND event_users.event_role=?', conference.program.id, 'submitter') + events.where('program_id = ? AND (event_users.event_role=? OR event_users.event_role=?)', conference.program.id, 'submitter', 'speaker') end def proposal_count(conference) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index e742b993..b5b63089 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -345,24 +345,34 @@ describe User do end describe 'proposals methods' do - let(:submitter) { create(:submitter, user: user) } + let(:submitter) { create(:user) } + let(:speaker) { create(:user) } let(:event1) { create(:event, program: conference.program) } let(:event2) { create(:event, program: conference.program) } before do - event1.event_users << create(:event_user, user: user, event_role: 'submitter') - event2.event_users << create(:event_user, user: user, event_role: 'submitter') + event1.event_users << create(:event_user, user: submitter, event_role: 'submitter') + event2.event_users << create(:event_user, user: submitter, event_role: 'submitter') + event1.event_users << create(:event_user, user: speaker, event_role: 'speaker') end describe '#proposals' do it 'returns events submitted by user' do - expect(user.proposals(conference)).to match [event1, event2] + expect(submitter.proposals(conference)).to match [event1, event2] + end + + it 'returns events in which user is a speaker' do + expect(speaker.proposals(conference)).to match [event1] end end describe '#proposal_count' do it 'returns number of events submitted by user' do - expect(user.proposal_count(conference)).to eq 2 + expect(submitter.proposal_count(conference)).to eq 2 + end + + it 'returns number of events in which the user is a speaker' do + expect(speaker.proposal_count(conference)).to eq 1 end end end From 4409610a89f4848bd1c74f58242d9b06f72089a5 Mon Sep 17 00:00:00 2001 From: rishabh92 Date: Sun, 10 Dec 2017 21:08:55 -0600 Subject: [PATCH 11/56] Add database config examples for all supported databases Example for MySQL and PostgreSQL added. Fixes #1676 Update comments based on code review --- config/database.yml.example | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/config/database.yml.example b/config/database.yml.example index 51a4dd45..f47361d5 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -9,6 +9,35 @@ development: pool: 5 timeout: 5000 +## PostgreSQL +## gem install pg +## +## Ensure the postgres gem is defined in your Gemfile +## gem 'pg' +## Update with your database name and login credentials +# development: +# adapter: postgresql +# encoding: unicode +# database: database_name +# pool: 5 +# username: username +# password: password + +## MySQL +## gem install mysql2 +## +## Ensure the mysql gem is defined in your Gemfile +## gem 'mysql2' +## Update with your database name and login credentials +# development: +# adapter: mysql2 +# encoding: utf8 +# database: database_name +# pool: 5 +# username: username +# password: password +# socket: /tmp/mysql.sock + # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. From 4289f699ac8a812699d7a39e72eb9e7e08b6fda1 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Sun, 12 Feb 2017 17:57:55 +0200 Subject: [PATCH 12/56] Add enabled to event_schedules To show scheduled events that have been cancelled/withdrawn as 'cancelled', and consequently also show when an event is their replacement. admin/schedules#show does not show events that were scheduled and then cancelled/withdrawn, however a record in event_schedules exists for those events, but event_schedule.enabled = false --- app/controllers/admin/events_controller.rb | 9 +++++++++ app/controllers/proposals_controller.rb | 9 +++++++++ app/models/event.rb | 8 ++++++++ app/models/event_schedule.rb | 3 ++- .../20170212145523_add_enabled_to_event_schedules.rb | 5 +++++ db/schema.rb | 3 ++- 6 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20170212145523_add_enabled_to_event_schedules.rb diff --git a/app/controllers/admin/events_controller.rb b/app/controllers/admin/events_controller.rb index accfb281..164e0407 100644 --- a/app/controllers/admin/events_controller.rb +++ b/app/controllers/admin/events_controller.rb @@ -124,6 +124,15 @@ module Admin def cancel update_state(:cancel, 'Event canceled!') + selected_schedule = @event.program.selected_schedule + event_schedule = EventSchedule.unscoped.where(event: @event).find_by(schedule: selected_schedule) if selected_schedule + Rails.logger.debug "schedule: #{selected_schedule.inspect} and event_schedule #{event_schedule.inspect}" + if selected_schedule && event_schedule + event_schedule.enabled = false + event_schedule.save + else + @event.event_schedules.destroy_all + end end def reject diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index 66052310..7ea81dc0 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -91,6 +91,15 @@ class ProposalsController < ApplicationController begin @event.withdraw + selected_schedule = @event.program.selected_schedule + event_schedule = @event.event_schedules.find_by(schedule: selected_schedule) if selected_schedule + Rails.logger.debug "schedule: #{selected_schedule.inspect} and event_schedule #{event_schedule.inspect}" + if selected_schedule && event_schedule + event_schedule.enabled = false + event_schedule.save + else + @event.event_schedules.destroy_all + end rescue Transitions::InvalidTransition redirect_to :back, error: "Event can't be withdrawn" return diff --git a/app/models/event.rb b/app/models/event.rb index 34c217f3..943572eb 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -197,6 +197,14 @@ class Event < ApplicationRecord send(transition) end save + # If the event was previously scheduled, and then withdrawn or cancelled + # its event_schedule will have enabled set to false + # If the event is now confirmed again, we want it to be available for scheduling + Rails.logger.debug "transition is #{transition}" + if transition == :confirm + Rails.logger.debug "schedules #{EventSchedule.unscoped.where(event: self, enabled: false)}" + EventSchedule.unscoped.where(event: self, enabled: false).destroy_all + end rescue Transitions::InvalidTransition => e alert = "Update state failed. #{e.message}" end diff --git a/app/models/event_schedule.rb b/app/models/event_schedule.rb index cb5d1675..9d59713d 100644 --- a/app/models/event_schedule.rb +++ b/app/models/event_schedule.rb @@ -1,4 +1,5 @@ class EventSchedule < ApplicationRecord + default_scope { where(enabled: true) } belongs_to :schedule belongs_to :event belongs_to :room @@ -33,7 +34,7 @@ class EventSchedule < ApplicationRecord # Returns event schedules that are scheduled in the same room and start_time as event # def intersecting_event_schedules - room.event_schedules.where(start_time: start_time, schedule: schedule).where.not(id: id) + EventSchedule.unscoped.where(room: room, start_time: start_time, schedule: schedule).where.not(id: id) end def replacement? diff --git a/db/migrate/20170212145523_add_enabled_to_event_schedules.rb b/db/migrate/20170212145523_add_enabled_to_event_schedules.rb new file mode 100644 index 00000000..d89505fe --- /dev/null +++ b/db/migrate/20170212145523_add_enabled_to_event_schedules.rb @@ -0,0 +1,5 @@ +class AddEnabledToEventSchedules < ActiveRecord::Migration + def change + add_column :event_schedules, :enabled, :boolean, default: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 6df61a48..43602f9b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -217,6 +217,7 @@ ActiveRecord::Schema.define(version: 20171130172334) do t.datetime "start_time" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.boolean "enabled", default: true t.index ["event_id", "schedule_id"], name: "index_event_schedules_on_event_id_and_schedule_id", unique: true t.index ["event_id"], name: "index_event_schedules_on_event_id" t.index ["room_id"], name: "index_event_schedules_on_room_id" @@ -494,7 +495,7 @@ ActiveRecord::Schema.define(version: 20171130172334) do t.integer "user_id" t.integer "payment_id" t.integer "week" - t.float "amount_paid", default: 0.0 + t.float "amount_paid" end create_table "ticket_scannings", force: :cascade do |t| From 2df8adea699a7356ac52cf033262d4a21367bcc9 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 12 Dec 2017 11:49:20 +0100 Subject: [PATCH 13/56] Link to an existing video with embeddable content Otherwise the Commercial validation hits --- spec/factories/commercials.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/factories/commercials.rb b/spec/factories/commercials.rb index cf865348..7fa052a7 100644 --- a/spec/factories/commercials.rb +++ b/spec/factories/commercials.rb @@ -2,7 +2,7 @@ FactoryGirl.define do factory :commercial do - sequence(:url) { |n| "https://www.youtube.com/watch?v=BTTygyxuGj#{n}" } + sequence(:url) { |n| "https://www.youtube.com/watch?v=4VrhlyIgo3M&factory=#{n}" } factory :conference_commercial do association :commercialable, factory: :conference From 83053f4626a1a9ed26b4279ac286b7b5ff39e209 Mon Sep 17 00:00:00 2001 From: ViditChitkara Date: Sat, 21 Oct 2017 02:38:41 +0530 Subject: [PATCH 14/56] added email presence validation to openid closes #1658 added test for openid fixed robocup offences written tests for email presence validation minor changes shifted omniauth callback tests to rspec controllers fixed linting bug minor changes minor changes --- .../users/omniauth_callbacks_controller.rb | 5 +++ app/models/openid.rb | 2 +- .../omniauth_callbacks_controller_spec.rb | 31 +++++++++++++++++++ spec/factories/openid.rb | 10 ++++++ spec/models/openid.rb | 15 +++++++++ 5 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 spec/controllers/users/omniauth_callbacks_controller_spec.rb create mode 100644 spec/factories/openid.rb create mode 100644 spec/models/openid.rb diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index ed7ce011..1d0400cd 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -11,6 +11,11 @@ module Users def handle(provider) auth_hash = request.env['omniauth.auth'] + unless auth_hash.info.email.present? + flash[:error] = "Email field is missing in your #{provider} account" + redirect_to new_user_registration_path + return + end username = auth_hash.info.email.split('@')[0] openid = Openid.find_for_oauth(auth_hash) # Get or create openid # If openid exists and is associated with a user, sign in with associated user, diff --git a/app/models/openid.rb b/app/models/openid.rb index 2b954f8b..b0f45f0c 100644 --- a/app/models/openid.rb +++ b/app/models/openid.rb @@ -1,6 +1,6 @@ class Openid < ApplicationRecord belongs_to :user - validates :provider, :uid, presence: true + validates :provider, :uid, :email, presence: true # Searches for openid based on provider and uid. # Returns found openid or a new openid. diff --git a/spec/controllers/users/omniauth_callbacks_controller_spec.rb b/spec/controllers/users/omniauth_callbacks_controller_spec.rb new file mode 100644 index 00000000..c67e6ac9 --- /dev/null +++ b/spec/controllers/users/omniauth_callbacks_controller_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' + +describe Users::OmniauthCallbacksController do + context 'email is not there in auth hash' do + before do + stub_env_for_omniauth + get :google + end + + it { expect(flash[:error]).to eq('Email field is missing in your google account') } + end +end + +def stub_env_for_omniauth + request.env['devise.mapping'] = Devise.mappings[:user] + env = OmniAuth::AuthHash.new( + provider: 'google', + uid: 'google-test-uid-1', + info: { + name: 'google user', + email: nil, + username: 'user_google' + }, + credentials: { + token: 'google_mock_token', + secret: 'google_mock_secret' + } + ) + request.env['omniauth.auth'] = env + @controller.stub(:env).and_return(env) +end diff --git a/spec/factories/openid.rb b/spec/factories/openid.rb new file mode 100644 index 00000000..6950c718 --- /dev/null +++ b/spec/factories/openid.rb @@ -0,0 +1,10 @@ +# Read about factories at https://github.com/thoughtbot/factory_girl + +FactoryGirl.define do + factory :openid do + provider { Faker::Internet.domain_word } + email { Faker::Internet.email } + uid { SecureRandom.hex } + user + end +end diff --git a/spec/models/openid.rb b/spec/models/openid.rb new file mode 100644 index 00000000..42b6a74f --- /dev/null +++ b/spec/models/openid.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe Openid do + subject { create(:openid) } + + describe 'validation' do + it { is_expected.to validate_presence_of(:provider) } + it { is_expected.to validate_presence_of(:uid) } + it { is_expected.to validate_presence_of(:email) } + end + + describe 'association' do + it { is_expected.to belong_to(:user) } + end +end From 57e596c67e1ebd0330381600666080b7c56e578c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sede=C3=B1o?= Date: Tue, 12 Dec 2017 22:08:48 +0100 Subject: [PATCH 15/56] Use distinct instead of uniq because deprectation. --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 9a44a6a6..d062529a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -45,8 +45,8 @@ class User < ApplicationRecord attr_accessor :login has_many :event_users, dependent: :destroy - has_many :events, -> { uniq }, through: :event_users - has_many :presented_events, -> { joins(:event_users).where(event_users: {event_role: 'speaker'}).uniq }, through: :event_users, source: :event + has_many :events, -> { distinct }, through: :event_users + has_many :presented_events, -> { joins(:event_users).where(event_users: {event_role: 'speaker'}).distinct }, through: :event_users, source: :event has_many :registrations, dependent: :destroy do def for_conference conference where(conference: conference).first From 2180e6197c8772704d3d1fff72971c963fcf3824 Mon Sep 17 00:00:00 2001 From: Harry30897 Date: Mon, 27 Nov 2017 23:33:34 +0530 Subject: [PATCH 16/56] Conference name repeated in revision_history on adding commercial --- app/views/admin/versions/_object_desc_and_link.html.haml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/admin/versions/_object_desc_and_link.html.haml b/app/views/admin/versions/_object_desc_and_link.html.haml index 6b182c2f..0df93aa9 100644 --- a/app/views/admin/versions/_object_desc_and_link.html.haml +++ b/app/views/admin/versions/_object_desc_and_link.html.haml @@ -234,6 +234,12 @@ = link_to_organization(version.conference_id) - else (Organization Deleted) + - elsif version.item_type == 'Commercial' + - commercial = current_or_last_object_state(version.item_type, version.item_id) + - commercialable = current_or_last_object_state(commercial.commercialable_type, commercial.commercialable_id) + - unless commercial.commercialable_type == 'Conference' + in conference + = link_to_conference(version.conference_id) - else in conference = link_to_conference(version.conference_id) From 99ab06d117985dc03fae03e7464ec7524880d1b9 Mon Sep 17 00:00:00 2001 From: Akshit Ahluwalia Date: Mon, 11 Dec 2017 16:27:18 -0800 Subject: [PATCH 17/56] Add templates for github issues & pull requests re: #1763 based on: #1764 --- .github/ISSUE_TEMPLATE.md | 15 +++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..a3778efa --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,15 @@ +**I'm submitting a ..** +- [ ] Bug Report +- [ ] Feature Request + +**Current behavior:** + + +**Expected correct behavior:** + + +**Steps to reproduce:** + + +**Other information:** + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..501ce4df --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ +**Checklist** + +- [ ] I have read the [Contribution & Best practices Guide](https://github.com/openSUSE/osem/blob/master/CONTRIBUTING.md). +- [ ] My branch is up-to-date with the upstream `master` branch. +- [ ] The tests pass locally with my changes. +- [ ] I have added tests that prove my fix is effective or that my feature works(if appropriate). +- [ ] I have added necessary documentation (if appropriate). + +**Short description of what this resolves/which [issues](https://github.com/openSUSE/osem/issues) does this fix?:** + + + +- + +**Changes proposed in this pull request:** + + + +- From 505d9da3d4874636f47bd97f62989f8158638278 Mon Sep 17 00:00:00 2001 From: Ronaq13 Date: Sat, 9 Dec 2017 14:03:59 +0530 Subject: [PATCH 18/56] Fix Performance/HashEachMethods offenses values.each and keys.each methods are depreciated, so they have replaced by each_value and each_key respectively. This has done manually. Closes https://github.com/openSUSE/osem/issues/1825 --- .rubocop_todo.yml | 9 --------- app/controllers/admin/conferences_controller.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/views/schedules/show.xml.haml | 4 ++-- .../20140701123203_add_events_per_week_to_conference.rb | 2 +- spec/factories/event_users.rb | 2 +- 6 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7664f6c3..a576c435 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -376,15 +376,6 @@ Naming/VariableNumber: Exclude: - 'spec/models/ticket_purchase_spec.rb' -# Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect. -Performance/HashEachMethods: - Exclude: - - 'app/controllers/admin/conferences_controller.rb' - - 'app/helpers/application_helper.rb' - - 'db/migrate/20140701123203_add_events_per_week_to_conference.rb' - - 'spec/factories/event_users.rb' # Offense count: 1 # Cop supports --auto-correct. diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index 8f8f2959..921a23d1 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -155,7 +155,7 @@ module Admin # Set line color using a hash function @tickets = [] - @tickets_data.keys.each do |title| + @tickets_data.each_key do |title| @tickets.append(short_title: title, color: "\##{Digest::MD5.hexdigest(title)[0..5]}") end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b1e249ba..9497cb1c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -99,7 +99,7 @@ module ApplicationHelper end def normalize_array_length(hashmap, length) - hashmap.each do |_, value| + hashmap.each_value do |value| if value.length < length value.fill(value[-1], value.length...length) end diff --git a/app/views/schedules/show.xml.haml b/app/views/schedules/show.xml.haml index 541377ad..f42ad801 100644 --- a/app/views/schedules/show.xml.haml +++ b/app/views/schedules/show.xml.haml @@ -9,10 +9,10 @@ %timeslot_duration= length_timestamp(@conference.program.schedule_interval) - if @events_xml.any? - - @events_xml.keys.each.with_index(1) do |day, index| + - @events_xml.each_key.with_index(1) do |day, index| %day{ date: day, index: index } - events_in_rooms = @events_xml[day].group_by(&:room) - - events_in_rooms.keys.each do |room| + - events_in_rooms.each_key do |room| %room{ name: room.name } - events_in_rooms[room].each do |event| %event{ guid: event.guid, id: event.id } diff --git a/db/migrate/20140701123203_add_events_per_week_to_conference.rb b/db/migrate/20140701123203_add_events_per_week_to_conference.rb index 36bbf40d..2b4d3342 100644 --- a/db/migrate/20140701123203_add_events_per_week_to_conference.rb +++ b/db/migrate/20140701123203_add_events_per_week_to_conference.rb @@ -77,7 +77,7 @@ class AddEventsPerWeekToConference < ActiveRecord::Migration hash.each do |week, values| if previous - values.each do |state, _value| + values.each_key do |state| hash[week][state] += previous[state] end end diff --git a/spec/factories/event_users.rb b/spec/factories/event_users.rb index 78bcd10d..5d1574a9 100644 --- a/spec/factories/event_users.rb +++ b/spec/factories/event_users.rb @@ -4,7 +4,7 @@ FactoryGirl.define do factory :event_user do user - Hash[EventUser::ROLES].values.each do |role| + Hash[EventUser::ROLES].each_value do |role| factory role do event_role role end From 8f6eeaaf4524ccce9a642b24bbd9738781610448 Mon Sep 17 00:00:00 2001 From: rishabh92 Date: Sun, 17 Dec 2017 19:25:13 -0600 Subject: [PATCH 19/56] Fix commercials does not accept slideshare https url Updated ruby-oembed to latest version 0.12.0, issue was due to ruby-oembed version 0.8.14 not accepting https slideshare links. Fixes #1775 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 79bbdb3f..69e750d4 100644 --- a/Gemfile +++ b/Gemfile @@ -179,7 +179,7 @@ gem 'acts_as_list' gem 'bootstrap-switch-rails', '~> 3.0.0' # for parsing OEmbed data -gem 'ruby-oembed' +gem 'ruby-oembed', '~>0.12.0' # for uploading images to the cloud gem 'cloudinary' diff --git a/Gemfile.lock b/Gemfile.lock index 1023f255..17c25857 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -479,7 +479,7 @@ GEM rainbow (>= 2.2.2, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) - ruby-oembed (0.8.14) + ruby-oembed (0.12.0) ruby-openid (2.5.0) ruby-progressbar (1.9.0) ruby_dep (1.5.0) @@ -662,7 +662,7 @@ DEPENDENCIES rspec-activemodel-mocks rspec-rails (~> 3.5, >= 3.5.2) rubocop (~> 0.51.0) - ruby-oembed + ruby-oembed (~> 0.12.0) sass-rails (>= 4.0.2) selectize-rails shoulda-matchers From 6a1d757f43213a05f5517dfaf6aa836e65cf0673 Mon Sep 17 00:00:00 2001 From: foteinidd Date: Thu, 21 Dec 2017 18:48:19 +0200 Subject: [PATCH 20/56] Add check for rooms in tracks#edit --- app/views/admin/tracks/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/tracks/_form.html.haml b/app/views/admin/tracks/_form.html.haml index 9109e4f5..a621e1a4 100644 --- a/app/views/admin/tracks/_form.html.haml +++ b/app/views/admin/tracks/_form.html.haml @@ -14,7 +14,7 @@ = f.input :color, input_html: {size: 6, type: 'color'}, required: true = f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly', required: @track.self_organized_and_accepted_or_confirmed? } = f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly', required: @track.self_organized_and_accepted_or_confirmed? } - - if @conference.venue.try(:rooms) + - if @conference.venue.try(:rooms).present? = f.input :room, as: :select, collection: (@conference.venue.rooms).map {|room| ["#{room.name}", room.id]}, include_blank: true, label: 'Room', input_html: { class: 'select-help-toggle', required: @track.self_organized_and_accepted_or_confirmed? } - else %b From 6eb8c8d6aed64d5c7190c5914d2c1e5b6b106b6d Mon Sep 17 00:00:00 2001 From: Naman Gupta <01namangupta@gmail.com> Date: Fri, 17 Nov 2017 00:02:23 +0530 Subject: [PATCH 21/56] Added tests for program#any_event_for_this_date? --- app/models/program.rb | 2 +- spec/factories/conferences.rb | 2 +- spec/models/program_spec.rb | 50 ++++++++++++++++++++++++++++++++++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/app/models/program.rb b/app/models/program.rb index 4f0298f4..dab2f2b6 100644 --- a/app/models/program.rb +++ b/app/models/program.rb @@ -165,7 +165,7 @@ class Program < ApplicationRecord # * +False+ -> If there is not any event for the given date def any_event_for_this_date?(date) parsed_date = DateTime.parse("#{date} 00:00").utc - EventSchedule.where(schedule: selected_schedule).where(start_time: parsed_date..(parsed_date + 1)).any? + EventSchedule.where(schedule: selected_schedule).where(start_time: parsed_date..(parsed_date + 1.day)).any? end ## diff --git a/spec/factories/conferences.rb b/spec/factories/conferences.rb index 1e4d8551..31f72344 100644 --- a/spec/factories/conferences.rb +++ b/spec/factories/conferences.rb @@ -5,7 +5,7 @@ FactoryGirl.define do title { Faker::Book.title } short_title { SecureRandom.urlsafe_base64(4) } timezone { Faker::Address.time_zone } - start_date { Date.today } + start_date { Date.current } end_date { 6.days.from_now } start_hour 9 end_hour 20 diff --git a/spec/models/program_spec.rb b/spec/models/program_spec.rb index ccb1bfbc..a4b7e44f 100644 --- a/spec/models/program_spec.rb +++ b/spec/models/program_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Program do subject { create(:program) } - let!(:conference) { create(:conference, end_date: Date.today + 3) } + let!(:conference) { create(:conference, end_date: Date.current + 3) } let!(:program) { conference.program } describe 'association' do @@ -241,6 +241,54 @@ describe Program do end end + describe '#any_event_for_this_date?' do + + let(:event){ create(:event, program: program) } + + context 'when no schedule is selected for the conference' do + let(:schedule) { create(:schedule, program: program) } + let!(:event_schedule) { create(:event_schedule, event: event, schedule: schedule, start_time: DateTime.parse("#{Date.current + 1} 10:00").utc) } + + it 'returns false irrespective of any date' do + expect(program.any_event_for_this_date?(Date.current + 1)).to eq false + end + + it 'returns false if date passed is empty' do + expect(program.any_event_for_this_date?('')).to eq false + end + + it 'returns false if date passed is nil' do + expect(program.any_event_for_this_date?(nil)).to eq false + end + end + + context 'when schedule is selected for the conference' do + let(:schedule) { create(:schedule, program: program) } + let!(:event_schedule) { create(:event_schedule, event: event, schedule: schedule, start_time: DateTime.parse("#{Date.current + 1} 10:00").utc) } + + before :each do + program.selected_schedule = event_schedule.schedule + program.save! + end + + it 'returns true if there is any event for this date' do + expect(program.any_event_for_this_date?(Date.current + 1)).to eq true + end + + it 'returns false if there is no event for this date' do + expect(program.any_event_for_this_date?(Date.current + 2)).to eq false + end + + it 'returns false if date passed is empty' do + expect(program.any_event_for_this_date?('')).to eq false + end + + it 'returns false if date passed is nil' do + expect(program.any_event_for_this_date?(nil)).to eq false + end + end + end + describe '#cfp' do it 'returns the cfp for events' do create(:cfp, cfp_type: 'events', program: program, end_date: Date.current + 1) From 808625106ccd198c9c14ae8d89e44c3761005a12 Mon Sep 17 00:00:00 2001 From: Naman Gupta <01namangupta@gmail.com> Date: Wed, 20 Dec 2017 22:21:40 +0530 Subject: [PATCH 22/56] Removed Style/DateTime offences which occured due to the use of DateTime class in spec/models/program_spec.rb --- .rubocop_todo.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a576c435..a4542c19 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -413,6 +413,7 @@ Style/DateTime: - 'app/models/conference.rb' - 'app/models/program.rb' - 'spec/models/conference_spec.rb' + - 'spec/models/program_spec.rb' # Offense count: 488 Style/Documentation: From 2e89920954e0de8243c8660334043ed05a0a522d Mon Sep 17 00:00:00 2001 From: kostino Date: Mon, 4 Dec 2017 17:03:47 +0200 Subject: [PATCH 23/56] Add Button that links to /admin/organizations in _admin_sidebar_index partial file located in views/layouts --- app/views/layouts/_admin_sidebar_index.html.haml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/layouts/_admin_sidebar_index.html.haml b/app/views/layouts/_admin_sidebar_index.html.haml index 9a3d19f3..f828fe85 100644 --- a/app/views/layouts/_admin_sidebar_index.html.haml +++ b/app/views/layouts/_admin_sidebar_index.html.haml @@ -27,6 +27,11 @@ = link_to(admin_users_path) do %span.fa.fa-user Users + - if can? :index, Organization + %li + = link_to(admin_organizations_path) do + %span.fa.fa-users + Organizations - if can? :index, PaperTrail::Version %li = link_to(admin_revision_history_path) do From 29a640a2675310ef4c4d570bde50b302a1acf91b Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 24 Oct 2017 19:58:03 -0700 Subject: [PATCH 24/56] Remove overlap in breakpoints --- app/assets/stylesheets/breakpoints.css.scss | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/breakpoints.css.scss b/app/assets/stylesheets/breakpoints.css.scss index b2025e39..d3dbc799 100644 --- a/app/assets/stylesheets/breakpoints.css.scss +++ b/app/assets/stylesheets/breakpoints.css.scss @@ -2,20 +2,20 @@ @if $class == xs { @media (max-width: 767px) { @content; } } - + @else if $class == sm { - @media (min-width: 750px) { @content; } + @media (min-width: 768px) and (max-width: 991px) { @content; } } - + @else if $class == md { - @media (min-width: 992px) { @content; } + @media (min-width: 992px) and (max-width: 1199px) { @content; } } - + @else if $class == lg { @media (min-width: 1200px) { @content; } } - + @else { @warn "Breakpoint mixin supports: xs, sm, md, lg"; } -} \ No newline at end of file +} From 995176ffe59cd590626c5e26fd9f5e7416221d17 Mon Sep 17 00:00:00 2001 From: James Mason Date: Fri, 17 Nov 2017 19:34:26 -0800 Subject: [PATCH 25/56] Fewer queries for for Conference#show Reduces SQL wait times by >90% on splash pages. --- app/controllers/conferences_controller.rb | 41 +++++++++++--- app/helpers/application_helper.rb | 14 +---- app/models/conference.rb | 12 ++++- app/views/conferences/_booths.html.haml | 6 +-- .../conferences/_call_for_paper.html.haml | 34 ++++++------ .../conferences/_call_for_tracks.html.haml | 20 ++++--- app/views/conferences/_lodging.html.haml | 14 ++--- .../_schedule_splashpage.html.haml | 54 +++++++++---------- app/views/conferences/_sponsors.html.haml | 2 +- app/views/conferences/show.html.haml | 18 +++---- app/views/layouts/_user_menu.html.haml | 6 +-- 11 files changed, 122 insertions(+), 99 deletions(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index f141529d..e5626aa1 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -9,19 +9,44 @@ class ConferencesController < ApplicationController end def show - @conference = if params[:id] - Conference.find_by_short_title(params[:id]) - else - load_conference_by_domain - end + @conference = Conference.unscoped.eager_load( + :organization, + :splashpage, + :venue, + :registration_period, + :tickets, + :confirmed_tracks, + :call_for_events, + :event_types, + :program, + :call_for_tracks, + :lodgings, + :call_for_booths, + :confirmed_booths, + :sponsors, + :call_for_sponsors, + :contact, + highlighted_events: [:speakers], + sponsorship_levels: [:sponsors] + ).order( + 'sponsorship_levels.position ASC', + 'sponsors.name', + 'tracks.name', + 'booths.title', + 'lodgings.name', + 'tickets.price_cents' + ).find_by(conference_finder_conditions) authorize! :show, @conference - @program = @conference.program end private - def load_conference_by_domain - Conference.find_by(custom_domain: request.domain) + def conference_finder_conditions + if params[:id] + { short_title: params[:id] } + else + { custom_domain: request.domain } + end end def respond_to_options diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9497cb1c..77f4f85e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -56,17 +56,7 @@ module ApplicationHelper end def tracks(conference) - all = conference.program.tracks.confirmed.cfp_active.pluck(:name) - first = all[0...-1] - last = all[-1] - ts = '' - if all.length > 1 - ts << first.join(', ') - ts << " and #{last}" - else - ts = all.join - end - ts + conference.confirmed_tracks.collect(&:name).to_sentence end def difficulty_levels(conference) @@ -152,7 +142,7 @@ module ApplicationHelper end def event_types(conference) - conference.program.event_types.map { |et| et.title.pluralize }.to_sentence + conference.event_types.map { |et| et.title.pluralize }.to_sentence end def sign_in_path diff --git a/app/models/conference.rb b/app/models/conference.rb index b12137d8..cb319d32 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -33,6 +33,7 @@ class Conference < ApplicationRecord end has_many :resources, dependent: :destroy has_many :booths, dependent: :destroy + has_many :confirmed_booths, -> { where(state: 'confirmed') }, class_name: 'Booth' has_many :lodgings, dependent: :destroy has_many :registrations, dependent: :destroy @@ -45,7 +46,16 @@ class Conference < ApplicationRecord has_many :campaigns, dependent: :destroy has_many :commercials, as: :commercialable, dependent: :destroy has_many :subscriptions, dependent: :destroy - + has_one :call_for_sponsors, -> { where(cfp_type: 'sponsors') }, through: :program, source: :cfps + has_one :call_for_events, -> { where(cfp_type: 'events') }, through: :program, source: :cfps + has_one :call_for_booths, -> { where(cfp_type: 'booths') }, through: :program, source: :cfps + has_one :call_for_tracks, -> { where(cfp_type: 'tracks') }, through: :program, source: :cfps + has_many :confirmed_tracks, -> { where(state: 'confirmed') }, through: :program, source: :tracks + has_many :highlighted_events, + -> { where(state: :confirmed, is_highlight: true) }, + through: :program, + source: :events + has_many :event_types, through: :program accepts_nested_attributes_for :venue accepts_nested_attributes_for :tickets, allow_destroy: true accepts_nested_attributes_for :sponsorship_levels, allow_destroy: true diff --git a/app/views/conferences/_booths.html.haml b/app/views/conferences/_booths.html.haml index b40af9b8..39dc9253 100644 --- a/app/views/conferences/_booths.html.haml +++ b/app/views/conferences/_booths.html.haml @@ -6,7 +6,7 @@ .row .col-md-12.text-center %h2 Booths - - @conference.booths.confirmed.each_slice(3).with_index do |slice, index_for_row| + - @conference.confirmed_booths.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 @@ -18,7 +18,7 @@ %h3.text-center = booth.title %p.text-center.text-muted - = link_to "#show_descrition_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do + = link_to "#show_description_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do learn more - .collapse{ id: "show_descrition_#{index_for_row}_#{index_for_column}" } + .collapse{ id: "show_description_#{index_for_row}_#{index_for_column}" } = markdown(booth.description) diff --git a/app/views/conferences/_call_for_paper.html.haml b/app/views/conferences/_call_for_paper.html.haml index 289c3d9e..2dbd2ecd 100644 --- a/app/views/conferences/_call_for_paper.html.haml +++ b/app/views/conferences/_call_for_paper.html.haml @@ -12,32 +12,34 @@ .row .col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1 %p - - if @conference.program.event_types.any? + - if @conference.event_types.any? You can submit proposals for %span.notranslate = "#{event_types(@conference)}." - - if @conference.program.tracks.any? + - if @conference.confirmed_tracks.any? Proposals should fit in one of the %span.notranslate - = "#{pluralize(@conference.program.tracks.count, 'track')}:" + = "#{pluralize(@conference.confirmed_tracks.length, 'track')}:" = "#{tracks(@conference)}." - The submission period has begun - %em.notranslate - = @conference.program.cfp.start_date.strftime('%A, %B %-d. %Y') - and closes - %em.notranslate - = @conference.program.cfp.end_date.strftime('%A, %B %-d. %Y.') - - if @conference.program.cfp_open? - That means you have only - %b.notranslate= pluralize(@conference.program.cfp.remaining_days, 'day') - left! + - if @conference.call_for_events.try(:open?) + The submission period is open + %em.notranslate + = "#{date_string(@conference.call_for_events.start_date, + @conference.call_for_events.end_date)}." + %b + You have + = pluralize(@conference.call_for_events.remaining_days, 'day') + left! Remember %span.notranslate - = @conference.short_title - will only be as good as the sessions you present. Submit early, submit often! + = @conference.title + will only be as good as the sessions you present. + Submit early, submit often! - else The submission period is closed. .row .col-md-12.text-center %p.cta-button - = link_to "Submit your paper now", conference_program_proposals_path(@conference.short_title), class: 'btn btn-success btn-lg text-center' + = link_to "Submit your paper now", + conference_program_proposals_path(@conference.short_title), + class: 'btn btn-success btn-lg text-center' diff --git a/app/views/conferences/_call_for_tracks.html.haml b/app/views/conferences/_call_for_tracks.html.haml index 1abeb956..c457880d 100644 --- a/app/views/conferences/_call_for_tracks.html.haml +++ b/app/views/conferences/_call_for_tracks.html.haml @@ -12,19 +12,17 @@ .row .col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1 %p - The submission period for track requests has begun + The submission period for track requests is open %em.notranslate - = @conference.program.cfps.for_tracks.start_date.strftime('%A, %B %-d. %Y') - and closes - %em.notranslate - = @conference.program.cfps.for_tracks.end_date.strftime('%A, %B %-d. %Y.') - - if @conference.program.cfps.for_tracks.try(:open?) - That means you have only - %b.notranslate= pluralize(@conference.program.cfps.for_tracks.remaining_days, 'day') + = "#{date_string(@conference.call_for_tracks.start_date, + @conference.call_for_tracks.end_date)}." + %b + You have + = pluralize(@conference.call_for_tracks.remaining_days, 'day') left! - - else - The submission period for track requests is closed. .row .col-md-12.text-center %p.cta-button - = link_to "Submit your request for track", conference_program_tracks_path(@conference.short_title), class: 'btn btn-success btn-lg text-center' + = link_to("Submit your request for track", + conference_program_tracks_path(@conference.short_title), + class: 'btn btn-success btn-lg text-center') diff --git a/app/views/conferences/_lodging.html.haml b/app/views/conferences/_lodging.html.haml index 561e2421..a9754190 100644 --- a/app/views/conferences/_lodging.html.haml +++ b/app/views/conferences/_lodging.html.haml @@ -13,9 +13,9 @@ %p.lead We recommend these affordable lodging accommodations for your visit. - .row.row-centered{ style:"display: flex; flex-wrap: wrap" } + .row.row-centered - @conference.lodgings.each do |lodging| - .col-md-4.col-sm-4.col-centered.col-top{ style:"display:flex;" } + .col-md-4.col-sm-4.col-centered.col-top .thumbnail - if lodging.picture? -if lodging.website_link.present? @@ -30,8 +30,8 @@ %i.fa.fa-home.fa-5x - else %i.fa.fa-home.fa-5x - .caption - %h3.text-center - = lodging.name - -if lodging.description.present? - = markdown(lodging.description) + .caption + %h3.text-center + = lodging.name + -if lodging.description.present? + = markdown(lodging.description) diff --git a/app/views/conferences/_schedule_splashpage.html.haml b/app/views/conferences/_schedule_splashpage.html.haml index 790582cb..10584bcb 100644 --- a/app/views/conferences/_schedule_splashpage.html.haml +++ b/app/views/conferences/_schedule_splashpage.html.haml @@ -1,3 +1,8 @@ += content_for :splash_nav do + %li + =link_to('#program', class: 'smoothscroll') do + Program + .container .row .col-md-12 @@ -5,43 +10,41 @@ Program %p.lead.text-center %span.notranslate - = @conference.short_title + = @conference.title has the most awesome program ever! - - if @conference.splashpage and @conference.program.tracks.any? and @conference.splashpage.include_tracks + - if @conference.splashpage.include_tracks && @conference.confirmed_tracks.any? See rock-star speakers cover the topics of - - if @conference.splashpage and @conference.splashpage.include_tracks - - @conference.program.tracks.confirmed.each_slice(3) do |slice| - .row.row-centered - - slice.each do |track| - .col-md-4.col-sm-4.col-centered.col-top.track - %h4.text-center - = track.name - = markdown(track.description) - - if track.start_date - %br - From: #{track.start_date.strftime('%A, %B %-d. %Y')} - - if track.end_date - %br - To: #{track.end_date.strftime('%A, %B %-d. %Y')} - - if track.room - %br - In: #{track.room.name} + - @conference.confirmed_tracks.each_slice(3) do |slice| + .row.row-centered + - slice.each do |track| + .col-md-4.col-sm-4.col-centered.col-top.track + %h4.text-center + = track.name + = markdown(track.description) + - if track.start_date + %br + From: #{track.start_date.strftime('%A, %B %-d. %Y')} + - if track.end_date + %br + To: #{track.end_date.strftime('%A, %B %-d. %Y')} + - if track.room + %br + In: #{track.room.name} - - if @conference.program and @conference.program.schedule_public + - if @conference.program.try(: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 - %h3.text-center Don't miss out! %br - - if @conference.program.events.highlights.any? + - if @conference.highlighted_events.any? .row .col-md-12 - - @conference.program.events.highlights.each_slice(2) do |slice| + - @conference.highlighted_events.each_slice(2) do |slice| .row.row-centered - slice.each do |event| .col-md-6.col-centered.col-top.highlights @@ -50,8 +53,3 @@ %h5.text-center = markdown truncate(event.abstract, length: 500, separator: ' ') = link_to "Read More", conference_program_proposal_path(@conference.short_title, event) - - = content_for :splash_nav do - %li - =link_to('#program', class: 'smoothscroll') do - Program diff --git a/app/views/conferences/_sponsors.html.haml b/app/views/conferences/_sponsors.html.haml index aa7921b5..94da9940 100644 --- a/app/views/conferences/_sponsors.html.haml +++ b/app/views/conferences/_sponsors.html.haml @@ -31,7 +31,7 @@ = sponsor.description .modal-footer = link_to nil, "#{sponsor.website_url}", target: '_blank' - -if @conference.contact and !@conference.contact.sponsor_email.blank? + - if @conference.call_for_sponsors.try(:open?) .row .col-md-12 %p.text-muted.text-center diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index dd6b2d62..8fa4bf5f 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -37,7 +37,7 @@ %h3.text-center = markdown(@conference.description) - - if @conference.registration_open? and @conference.splashpage.include_registrations + - if @conference.splashpage.include_registrations && @conference.registration_open? %section#registration = render 'registration' @@ -45,35 +45,35 @@ %section#program = render 'schedule_splashpage' - - if @conference.program.cfp_open? and @conference.splashpage.include_cfp + - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) %section#callforpapers = render 'call_for_paper' - - if @conference.program.cfps.for_tracks.try(:open?) && @conference.splashpage.include_cfp + - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) %section#callfortracks = render 'call_for_tracks' - - if @conference.venue and @conference.splashpage.include_venue + - if @conference.splashpage.include_venue && @conference.venue %section#venue = render 'venue' - - if @conference.lodgings.any? and @conference.splashpage.include_lodgings + - if @conference.splashpage.include_lodgings && @conference.lodgings.any? %section#lodging = render 'lodging' - - if @conference.tickets.any? and @conference.splashpage.include_tickets and @conference.pending? + - if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending? %section#tickets = render 'tickets' - - if @conference.booths.confirmed.any? and @conference.splashpage.include_booths + - if @conference.splashpage.include_booths && @conference.confirmed_booths.any? %section#booths = render 'booths' - - if @conference.sponsors.any? and @conference.splashpage.include_sponsors + - if @conference.splashpage.include_sponsors && @conference.sponsors.any? %section#sponsors = render 'sponsors' - - if @conference.contact.has_social_media? and @conference.splashpage.include_social_media + - if @conference.splashpage.include_social_media && @conference.contact.has_social_media? %section#social-media = render 'social_media' diff --git a/app/views/layouts/_user_menu.html.haml b/app/views/layouts/_user_menu.html.haml index 10d4c386..dc645a11 100644 --- a/app/views/layouts/_user_menu.html.haml +++ b/app/views/layouts/_user_menu.html.haml @@ -7,7 +7,7 @@ = link_to(edit_user_path(current_user.id)) do %span.fa.fa-user Edit Profile --if @conference and @conference.program +-if @conference && @conference.program %li = link_to(conference_program_proposals_path(@conference.short_title)) do %span.fa.fa-comment @@ -16,7 +16,7 @@ = link_to(conference_program_tracks_path(@conference.short_title)) do %span.fa.fa-road My Tracks --if @conference && @conference.program && (@conference.program.cfps.for_booths.try(:open?) || current_user.booths.where(conference_id: @conference.id).count > 0) +-if @conference && (@conference.call_for_booths.try(:open?) || current_user.booths.where(conference_id: @conference.id).count > 0) %li = link_to (conference_booths_path(@conference.short_title)) do %span.fa.fa-shopping-bag @@ -41,7 +41,7 @@ =link_to(new_admin_conference_path) do %span.fa.fa-plus New Conference - -if @conference and @conference.id and can? :show, @conference + -if @conference && @conference.id && can?(:show, @conference) %li = link_to(admin_conference_path(@conference.short_title)) do %span.fa.fa-cog From e60dc8c09d7a719cf999730e2c49ad9d0e3018e7 Mon Sep 17 00:00:00 2001 From: James Mason Date: Mon, 20 Nov 2017 19:46:12 -0800 Subject: [PATCH 26/56] Logic for showing splashpage is not the views' concern That's the responsibility of ConferenceController & cancancan, and they handle it fine. --- app/views/conferences/show.html.haml | 109 +++++++++++++-------------- 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index 8fa4bf5f..c6a7fd54 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -11,74 +11,73 @@ = @conference.title #splash - - if @conference.splashpage - #banner + #banner + .container + .row + .col-md-8.col-md-offset-2#header + .row + .col-md-4 + = image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture? + .col-md-8 + %h1 + = @conference.title + %p.lead + - if @conference.venue + = "#{@conference.venue.city} / #{@conference.venue.country_name}" + - if @conference.start_date && @conference.end_date + %br + = date_string(@conference.start_date, @conference.end_date) + + - unless @conference.description.blank? + %section#about .container .row - .col-md-8.col-md-offset-2#header - .row - .col-md-4 - = image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture? - .col-md-8 - %h1 - = @conference.title - %p.lead - - if @conference.venue - = "#{@conference.venue.city} / #{@conference.venue.country_name}" - - if @conference.start_date && @conference.end_date - %br - = date_string(@conference.start_date, @conference.end_date) + .col-md-8.col-md-offset-2 + %h3.text-center + = markdown(@conference.description) - - unless @conference.description.blank? - %section#about - .container - .row - .col-md-8.col-md-offset-2 - %h3.text-center - = markdown(@conference.description) + - if @conference.splashpage.include_registrations && @conference.registration_open? + %section#registration + = render 'registration' - - if @conference.splashpage.include_registrations && @conference.registration_open? - %section#registration - = render 'registration' + - if @conference.splashpage.include_program + %section#program + = render 'schedule_splashpage' - - if @conference.splashpage.include_program - %section#program - = render 'schedule_splashpage' + - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) + %section#callforpapers + = render 'call_for_paper' - - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) - %section#callforpapers - = render 'call_for_paper' + - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) + %section#callfortracks + = render 'call_for_tracks' - - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) - %section#callfortracks - = render 'call_for_tracks' + - if @conference.splashpage.include_venue && @conference.venue + %section#venue + = render 'venue' - - if @conference.splashpage.include_venue && @conference.venue - %section#venue - = render 'venue' + - if @conference.splashpage.include_lodgings && @conference.lodgings.any? + %section#lodging + = render 'lodging' - - if @conference.splashpage.include_lodgings && @conference.lodgings.any? - %section#lodging - = render 'lodging' + - if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending? + %section#tickets + = render 'tickets' - - if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending? - %section#tickets - = render 'tickets' + - if @conference.splashpage.include_booths && @conference.confirmed_booths.any? + %section#booths + = render 'booths' - - if @conference.splashpage.include_booths && @conference.confirmed_booths.any? - %section#booths - = render 'booths' + - if @conference.splashpage.include_sponsors && @conference.sponsors.any? + %section#sponsors + = render 'sponsors' - - if @conference.splashpage.include_sponsors && @conference.sponsors.any? - %section#sponsors - = render 'sponsors' + - if @conference.splashpage.include_social_media && @conference.contact.has_social_media? + %section#social-media + = render 'social_media' - - if @conference.splashpage.include_social_media && @conference.contact.has_social_media? - %section#social-media - = render 'social_media' - - // grmbl - = render 'footer' + // grmbl + = render 'footer' - content_for :script_head do :javascript From 7f2346650fbaca6213864c5aaaae60e7d34d3807 Mon Sep 17 00:00:00 2001 From: James Mason Date: Fri, 17 Nov 2017 18:32:08 -0800 Subject: [PATCH 27/56] Configure cache stores rely on RAM caching for devel, and optionally a memcached server in production --- Gemfile | 3 +++ Gemfile.lock | 2 ++ config/environments/development.rb | 2 ++ config/environments/production.rb | 8 ++++++++ 4 files changed, 15 insertions(+) diff --git a/Gemfile b/Gemfile index 69e750d4..e624a1f7 100644 --- a/Gemfile +++ b/Gemfile @@ -214,6 +214,9 @@ gem 'selectize-rails' # CVE-2017-9049, CVE-2017-9050 gem 'nokogiri', '>= 1.8.1' +# memcached binary connector +gem 'dalli' + # Use guard and spring for testing in development group :development do # to launch specs when files are modified diff --git a/Gemfile.lock b/Gemfile.lock index 17c25857..1645c8be 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -145,6 +145,7 @@ GEM safe_yaml (~> 1.0.0) currencies (0.4.2) daemons (1.1.9) + dalli (2.7.6) dante (0.2.0) database_cleaner (1.3.0) debug_inspector (0.0.3) @@ -597,6 +598,7 @@ DEPENDENCIES country_select coveralls daemons + dalli database_cleaner delayed_job_active_record devise diff --git a/config/environments/development.rb b/config/environments/development.rb index 2557e892..4bff137e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -12,6 +12,8 @@ Osem::Application.configure do # since you don't have to restart the web server when you make code changes. config.cache_classes = false + config.cache_store = :memory_store, { size: 64.megabytes } + # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false diff --git a/config/environments/production.rb b/config/environments/production.rb index cf598a16..11a8c06b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,6 +46,14 @@ Osem::Application.configure do # Use a different cache store in production # config.cache_store = :mem_cache_store + if ENV["MEMCACHEDCLOUD_SERVERS"] + config.cache_store = :dalli_store, ENV["MEMCACHEDCLOUD_SERVERS"].split(','), { + username: ENV["MEMCACHEDCLOUD_USERNAME"], + password: ENV["MEMCACHEDCLOUD_PASSWORD"] + } + else + config.cache_store = :memory_store, { size: 64.megabytes } + end # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" From f4b869c1297652ced7f8258cd51a754febec7b9e Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 21 Nov 2017 09:54:27 -0800 Subject: [PATCH 28/56] Use fragment caching on the splashpage --- app/views/conferences/_booths.html.haml | 42 +++---- .../conferences/_call_for_paper.html.haml | 5 +- .../conferences/_call_for_tracks.html.haml | 50 +++++---- app/views/conferences/_lodging.html.haml | 64 ++++++----- app/views/conferences/_registration.html.haml | 52 ++++----- .../_schedule_splashpage.html.haml | 100 +++++++++-------- app/views/conferences/_social_media.html.haml | 38 ++++--- app/views/conferences/_sponsors.html.haml | 75 +++++++------ app/views/conferences/_tickets.html.haml | 53 +++++---- app/views/conferences/_venue.html.haml | 67 +++++------ app/views/conferences/show.html.haml | 106 ++++++++---------- 11 files changed, 335 insertions(+), 317 deletions(-) diff --git a/app/views/conferences/_booths.html.haml b/app/views/conferences/_booths.html.haml index 39dc9253..fd9db04f 100644 --- a/app/views/conferences/_booths.html.haml +++ b/app/views/conferences/_booths.html.haml @@ -2,23 +2,25 @@ %li %a.smoothscroll{ href: '#booths' } Booths -.container - .row - .col-md-12.text-center - %h2 Booths - - @conference.confirmed_booths.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_description_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do - learn more - .collapse{ id: "show_description_#{index_for_row}_#{index_for_column}" } - = markdown(booth.description) +- cache [@conference.confirmed_booths, '#splash#booths'] do + %section#booths + .container + .row + .col-md-12.text-center + %h2 Booths + - @conference.confirmed_booths.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_description_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do + learn more + .collapse{ id: "show_description_#{index_for_row}_#{index_for_column}" } + = markdown(booth.description) diff --git a/app/views/conferences/_call_for_paper.html.haml b/app/views/conferences/_call_for_paper.html.haml index 2dbd2ecd..9d8188fa 100644 --- a/app/views/conferences/_call_for_paper.html.haml +++ b/app/views/conferences/_call_for_paper.html.haml @@ -2,7 +2,10 @@ %li %a.smoothscroll{ href: '#callforpapers' } Call For Papers -.container +- cache [@conference, @conference.call_for_events, @conference.confirmed_tracks, + '#splash#callforpapers'] do + %section#callforpapers + .container .row .col-md-12.text-center %h2 diff --git a/app/views/conferences/_call_for_tracks.html.haml b/app/views/conferences/_call_for_tracks.html.haml index c457880d..e627fca8 100644 --- a/app/views/conferences/_call_for_tracks.html.haml +++ b/app/views/conferences/_call_for_tracks.html.haml @@ -2,27 +2,29 @@ %li %a.smoothscroll{ href: '#callfortracks' } Call For Tracks -.container - .row - .col-md-12.text-center - %h2 - Call for Tracks - %p.lead - We are ready to accept requests for tracks! - .row - .col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1 - %p - The submission period for track requests is open - %em.notranslate - = "#{date_string(@conference.call_for_tracks.start_date, - @conference.call_for_tracks.end_date)}." - %b - You have - = pluralize(@conference.call_for_tracks.remaining_days, 'day') - left! - .row - .col-md-12.text-center - %p.cta-button - = link_to("Submit your request for track", - conference_program_tracks_path(@conference.short_title), - class: 'btn btn-success btn-lg text-center') +- cache [@conference, @conference.call_for_tracks, '#splash#callfortracks'] do + %section#callfortracks + .container + .row + .col-md-12.text-center + %h2 + Call for Tracks + %p.lead + We are ready to accept requests for tracks! + .row + .col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1 + %p + The submission period for track requests is open + %em.notranslate + = "#{date_string(@conference.call_for_tracks.start_date, + @conference.call_for_tracks.end_date)}." + %b + You have + = pluralize(@conference.call_for_tracks.remaining_days, 'day') + left! + .row + .col-md-12.text-center + %p.cta-button + = link_to("Submit your request for track", + conference_program_tracks_path(@conference.short_title), + class: 'btn btn-success btn-lg text-center') diff --git a/app/views/conferences/_lodging.html.haml b/app/views/conferences/_lodging.html.haml index a9754190..006978d3 100644 --- a/app/views/conferences/_lodging.html.haml +++ b/app/views/conferences/_lodging.html.haml @@ -2,36 +2,38 @@ %li %a.smoothscroll{ href: '#lodging' } Lodging -.container - .row - .col-md-12.text-center - %h2 - Where to stay - - if @conference.venue - in - = @conference.venue.city - %p.lead - We recommend these affordable lodging accommodations for your visit. +- cache [@conference.venue, @conference.lodgings, '#splash#lodging'] do + %section#lodging + .container + .row + .col-md-12.text-centers + %h2 + Where to stay + - if @conference.venue + in + = @conference.venue.city + %p.lead + We recommend these affordable lodging accommodations for your visit. - .row.row-centered - - @conference.lodgings.each do |lodging| - .col-md-4.col-sm-4.col-centered.col-top - .thumbnail - - if lodging.picture? - -if lodging.website_link.present? - = link_to(lodging.website_link, class: 'thumbnail') do - = image_tag lodging.picture.large.url, class: 'img-responsive img-lodging' - - else - = image_tag lodging.picture.large.url, class: 'img-responsive img-lodging' - - else - %p.text-center - -if lodging.website_link.present? - = link_to(lodging.website_link, class: 'thumbnail') do - %i.fa.fa-home.fa-5x + .row.row-centered + - @conference.lodgings.each do |lodging| + .col-md-4.col-sm-4.col-centered.col-top + .thumbnail + - if lodging.picture? + -if lodging.website_link.present? + = link_to(lodging.website_link, class: 'thumbnail') do + = image_tag lodging.picture.large.url, class: 'img-responsive img-lodging' + - else + = image_tag lodging.picture.large.url, class: 'img-responsive img-lodging' - else - %i.fa.fa-home.fa-5x - .caption - %h3.text-center - = lodging.name - -if lodging.description.present? - = markdown(lodging.description) + %p.text-center + -if lodging.website_link.present? + = link_to(lodging.website_link, class: 'thumbnail') do + %i.fa.fa-home.fa-5x + - else + %i.fa.fa-home.fa-5x + .caption + %h3.text-center + = lodging.name + -if lodging.description.present? + = markdown(lodging.description) diff --git a/app/views/conferences/_registration.html.haml b/app/views/conferences/_registration.html.haml index 5614bdba..9db1f280 100644 --- a/app/views/conferences/_registration.html.haml +++ b/app/views/conferences/_registration.html.haml @@ -2,29 +2,31 @@ %li %a.smoothscroll{ href: '#registration' } Registration -.container - .row - .col-md-12.text-center - %h1 Registration +- cache [@conference.registration_period, @conference.tickets, '#splash#registration'] do + %section#registration + .container + .row + .col-md-12.text-center + %h1 Registration - - if @conference.registration_limit_exceeded? - %p - Sorry, the conference registration limit has exceeded - - else - - if @conference.tickets.empty? - %p.lead - Going to - = @conference.short_title - 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 - - else - %p - The registration period ends on - = @conference.registration_period.end_date.strftime('%A, %B %-d. %Y') - %p.cta-button - = link_to(new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-lg btn-success') do - Register Now + - if @conference.registration_limit_exceeded? + %p + Sorry, the conference registration limit has exceeded + - else + - if @conference.tickets.empty? + %p.lead + Going to + = @conference.short_title + 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 + - else + %p + The registration period ends on + = @conference.registration_period.end_date.strftime('%A, %B %-d. %Y') + %p.cta-button + = link_to(new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-lg btn-success') do + Register Now diff --git a/app/views/conferences/_schedule_splashpage.html.haml b/app/views/conferences/_schedule_splashpage.html.haml index 10584bcb..cccbe929 100644 --- a/app/views/conferences/_schedule_splashpage.html.haml +++ b/app/views/conferences/_schedule_splashpage.html.haml @@ -3,53 +3,55 @@ =link_to('#program', class: 'smoothscroll') do Program -.container - .row - .col-md-12 - %h2.text-center - Program - %p.lead.text-center - %span.notranslate - = @conference.title - has the most awesome program ever! - - if @conference.splashpage.include_tracks && @conference.confirmed_tracks.any? - See rock-star speakers cover the topics of - - @conference.confirmed_tracks.each_slice(3) do |slice| +- cache [@confererence, @conference.confirmed_tracks, '#splash#program'] do + %section#program + .container + .row + .col-md-12 + %h2.text-center + Program + %p.lead.text-center + %span.notranslate + = @conference.title + has the most awesome program ever! + - if @conference.splashpage.include_tracks && @conference.confirmed_tracks.any? + See rock-star speakers cover the topics of + - @conference.confirmed_tracks.each_slice(3) do |slice| + .row.row-centered + - slice.each do |track| + .col-md-4.col-sm-4.col-centered.col-top.track + %h4.text-center + = track.name + = markdown(track.description) + - if track.start_date + %br + From: #{track.start_date.strftime('%A, %B %-d. %Y')} + - if track.end_date + %br + To: #{track.end_date.strftime('%A, %B %-d. %Y')} + - if track.room + %br + In: #{track.room.name} + + - if @conference.program.try(: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 + + %h3.text-center + Don't miss out! + %br + - if @conference.highlighted_events.any? + .row + .col-md-12 + - @conference.highlighted_events.each_slice(2) do |slice| .row.row-centered - - slice.each do |track| - .col-md-4.col-sm-4.col-centered.col-top.track - %h4.text-center - = track.name - = markdown(track.description) - - if track.start_date - %br - From: #{track.start_date.strftime('%A, %B %-d. %Y')} - - if track.end_date - %br - To: #{track.end_date.strftime('%A, %B %-d. %Y')} - - if track.room - %br - In: #{track.room.name} - - - if @conference.program.try(: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 - - %h3.text-center - Don't miss out! - %br - - if @conference.highlighted_events.any? - .row - .col-md-12 - - @conference.highlighted_events.each_slice(2) do |slice| - .row.row-centered - - slice.each do |event| - .col-md-6.col-centered.col-top.highlights - %p.text-center - %b= event.title - %h5.text-center - = markdown truncate(event.abstract, length: 500, separator: ' ') - = link_to "Read More", conference_program_proposal_path(@conference.short_title, event) + - slice.each do |event| + .col-md-6.col-centered.col-top.highlights + %p.text-center + %b= event.title + %h5.text-center + = markdown truncate(event.abstract, length: 500, separator: ' ') + = link_to "Read More", conference_program_proposal_path(@conference.short_title, event) diff --git a/app/views/conferences/_social_media.html.haml b/app/views/conferences/_social_media.html.haml index b072423f..4d3a5c4f 100644 --- a/app/views/conferences/_social_media.html.haml +++ b/app/views/conferences/_social_media.html.haml @@ -1,18 +1,20 @@ -.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? - = link_to "#{ @conference.contact.twitter }" do - %i.fa.fa-twitter.fa-4x - - unless @conference.contact.instagram.blank? - = link_to "#{ @conference.contact.instagram }" do - %i.fa.fa-instagram.fa-4x - - unless @conference.contact.googleplus.blank? - = link_to "#{ @conference.contact.googleplus }" do - %i.fa.fa-google-plus-square.fa-4x - - unless @conference.contact.email.blank? - = mail_to "#{ @conference.contact.email }" do - %i.fa.fa-envelope-o.fa-4x +- cache [@conference.contact, '#splash#social'] do + %section#social-media + .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? + = link_to "#{ @conference.contact.twitter }" do + %i.fa.fa-twitter.fa-4x + - unless @conference.contact.instagram.blank? + = link_to "#{ @conference.contact.instagram }" do + %i.fa.fa-instagram.fa-4x + - unless @conference.contact.googleplus.blank? + = link_to "#{ @conference.contact.googleplus }" do + %i.fa.fa-google-plus-square.fa-4x + - unless @conference.contact.email.blank? + = mail_to "#{ @conference.contact.email }" do + %i.fa.fa-envelope-o.fa-4x diff --git a/app/views/conferences/_sponsors.html.haml b/app/views/conferences/_sponsors.html.haml index 94da9940..5f961acd 100644 --- a/app/views/conferences/_sponsors.html.haml +++ b/app/views/conferences/_sponsors.html.haml @@ -2,40 +2,43 @@ %li %a.smoothscroll{ href: '#sponsors' } Sponsors -.container - .row - .col-md-12.text-center - %h2 Sponsors - - @conference.sponsorship_levels.each do |sponsorship_level| - -if sponsorship_level.sponsors.any? - - sponsorship_level.sponsors.each_slice(3) do |slice| - .row.row-centered - - slice.each do |sponsor| - .col-md-4.col-sm-4.col-centered.col-top - %a{ href: '#', data: { toggle: 'modal', target: "#modal_#{sponsor.id}" } } - = image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}" +- cache [@conference, @conference.sponsors, @conference.sponsorship_levels, + @conference.try(:call_for_sponsors), '#splash#sponsors'] do + %section#sponsors + .container + .row + .col-md-12.text-center + %h2 Sponsors + - @conference.sponsorship_levels.each do |sponsorship_level| + -if sponsorship_level.sponsors.any? + - sponsorship_level.sponsors.each_slice(3) do |slice| + .row.row-centered + - slice.each do |sponsor| + .col-md-4.col-sm-4.col-centered.col-top + %a{ href: '#', data: { toggle: 'modal', target: "#modal_#{sponsor.id}" } } + = image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}" - .modal.fade{ id: "modal_#{sponsor.id}" } - .modal-dialog - .modal-content - .modal-header - %button.close{ data: { dismiss: 'modal' } } - x - .modal-title - = sponsor.name - .modal-body.text-center - .logo - = link_to sponsor.website_url, target: '_blank' do - = image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}" - .description - = sponsor.description - .modal-footer - = link_to nil, "#{sponsor.website_url}", target: '_blank' - - if @conference.call_for_sponsors.try(:open?) - .row - .col-md-12 - %p.text-muted.text-center - %small - Want to sponsor #{@conference.short_title}? - = link_to("mailto: #{@conference.contact.sponsor_email}?subject=#{@conference.short_title}%20Sponsorship") do - Please contact us! + .modal.fade{ id: "modal_#{sponsor.id}" } + .modal-dialog + .modal-content + .modal-header + %button.close{ data: { dismiss: 'modal' } } + x + .modal-title + = sponsor.name + .modal-body.text-center + .logo + = link_to sponsor.website_url, target: '_blank' do + = image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}" + .description + = sponsor.description + .modal-footer + = link_to nil, "#{sponsor.website_url}", target: '_blank' + - if @conference.call_for_sponsors.try(:open?) + .row + .col-md-12 + %p.text-muted.text-center + %small + Want to sponsor #{@conference.short_title}? + = link_to("mailto: #{@conference.contact.sponsor_email}?subject=#{@conference.short_title}%20Sponsorship") do + Please contact us! diff --git a/app/views/conferences/_tickets.html.haml b/app/views/conferences/_tickets.html.haml index 8a202295..d06218ce 100644 --- a/app/views/conferences/_tickets.html.haml +++ b/app/views/conferences/_tickets.html.haml @@ -1,25 +1,30 @@ -.container - .row - .col-md-12.text-center - %h2 - Support - =@conference.short_title - %p.lead - To support our event you can get these tickets - - @conference.tickets.each_slice(4) do |slice| - .row.row-centered - - slice.each do |ticket| - .col-md-3.col-centered.col-top.col-sm-3 - .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 - Get Ticket - = humanized_money_with_symbol ticket.price += content_for :splash_nav do + %li + %a.smoothscroll{ href: '#tickets' } Tickets +- cache [@conference, @conference.tickets, '#splash#tickets'] do + %section#tickets + .container + .row + .col-md-12.text-center + %h2 + Support + =@conference.short_title + %p.lead + To support our event you can get these tickets + - @conference.tickets.each_slice(4) do |slice| + .row.row-centered + - slice.each do |ticket| + .col-md-3.col-centered.col-top.col-sm-3 + .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 + Get Ticket + = humanized_money_with_symbol ticket.price diff --git a/app/views/conferences/_venue.html.haml b/app/views/conferences/_venue.html.haml index 4436b0fe..0c7ef254 100644 --- a/app/views/conferences/_venue.html.haml +++ b/app/views/conferences/_venue.html.haml @@ -1,35 +1,38 @@ = content_for :splash_nav do %li %a.smoothscroll{ href: '#venue' } Venue --if @conference.venue.location? - = render '/conferences/venue_map' --else - .container - .row - .col-md-6 - .thumbnail#venue-pic - - if @conference.venue.commercial.present? and @conference.venue.commercial.persisted? - .flexvideo{ id: "resource-content-#{@conference.venue.commercial.id}"} - = render partial: 'shared/media_item', locals: { commercial: @conference.venue.commercial } - - elsif @conference.venue.picture? - = image_tag @conference.venue.picture.url, alt: @conference.venue.name, class:"img-responsive" - - else - %p.text-center - %span.fa.fa-university.fa-5x - .caption - %h3.text-center - = @conference.venue.name - - unless @conference.venue.description.blank? - = markdown(@conference.venue.description) - .col-md-6 - %h2 - = "#{@conference.venue.city} / #{@conference.venue.country_name}" - %address - = @conference.venue.street - %br - = "#{@conference.venue.postalcode}, #{@conference.venue.city}" - %br - = @conference.venue.country_name - - if @conference.venue.website - %br - =link_to(h(@conference.venue.website), h(@conference.venue.website)).html_safe + +- cache [@conference.venue, @conference.venue.commercial, '#splash#venue'] do + %section#venue + -if @conference.venue.location? + = render '/conferences/venue_map' + -else + .container + .row + .col-md-6 + .thumbnail#venue-pic + - if @conference.venue.commercial.present? and @conference.venue.commercial.persisted? + .flexvideo{ id: "resource-content-#{@conference.venue.commercial.id}"} + = render partial: 'shared/media_item', locals: { commercial: @conference.venue.commercial } + - elsif @conference.venue.picture? + = image_tag @conference.venue.picture.url, alt: @conference.venue.name, class:"img-responsive" + - else + %p.text-center + %span.fa.fa-university.fa-5x + .caption + %h3.text-center + = @conference.venue.name + - unless @conference.venue.description.blank? + = markdown(@conference.venue.description) + .col-md-6 + %h2 + = "#{@conference.venue.city} / #{@conference.venue.country_name}" + %address + = @conference.venue.street + %br + = "#{@conference.venue.postalcode}, #{@conference.venue.city}" + %br + = @conference.venue.country_name + - if @conference.venue.website + %br + =link_to(h(@conference.venue.website), h(@conference.venue.website)).html_safe diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index c6a7fd54..65a3b629 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -11,87 +11,79 @@ = @conference.title #splash - #banner - .container - .row - .col-md-8.col-md-offset-2#header - .row - .col-md-4 - = image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture? - .col-md-8 - %h1 - = @conference.title - %p.lead - - if @conference.venue - = "#{@conference.venue.city} / #{@conference.venue.country_name}" - - if @conference.start_date && @conference.end_date - %br - = date_string(@conference.start_date, @conference.end_date) - - - unless @conference.description.blank? - %section#about + - cache [@conference, @conference.venue, '#splash#header'] do + #banner .container .row - .col-md-8.col-md-offset-2 - %h3.text-center - = markdown(@conference.description) + .col-md-8.col-md-offset-2#header + .row + .col-md-4 + = image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture? + .col-md-8 + %h1 + = @conference.title + %p.lead + - if @conference.venue + = "#{@conference.venue.city} / #{@conference.venue.country_name}" + - if @conference.start_date && @conference.end_date + %br + = date_string(@conference.start_date, @conference.end_date) + + - unless @conference.description.blank? + %section#about + .container + .row + .col-md-8.col-md-offset-2 + %h3.text-center + = markdown(@conference.description) - if @conference.splashpage.include_registrations && @conference.registration_open? - %section#registration - = render 'registration' + = render 'registration' - if @conference.splashpage.include_program - %section#program - = render 'schedule_splashpage' + = render 'schedule_splashpage' - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) - %section#callforpapers - = render 'call_for_paper' + = render 'call_for_paper' - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) - %section#callfortracks - = render 'call_for_tracks' + = render 'call_for_tracks' - if @conference.splashpage.include_venue && @conference.venue - %section#venue - = render 'venue' + = render 'venue' - if @conference.splashpage.include_lodgings && @conference.lodgings.any? - %section#lodging - = render 'lodging' + = render 'lodging' - if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending? - %section#tickets - = render 'tickets' + = render 'tickets' - if @conference.splashpage.include_booths && @conference.confirmed_booths.any? - %section#booths - = render 'booths' + = render 'booths' - if @conference.splashpage.include_sponsors && @conference.sponsors.any? - %section#sponsors - = render 'sponsors' + = render 'sponsors' - if @conference.splashpage.include_social_media && @conference.contact.has_social_media? - %section#social-media - = render 'social_media' + = render 'social_media' // grmbl = render 'footer' -- content_for :script_head do - :javascript - var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic(); - var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); }); - $(function () { - $(document).ready(function() { - var triangle_width = document.body.clientWidth; - var triangle_height = ($( "#banner" ).height() + 200 ); - var pattern = Trianglify({ width: triangle_width, - height: triangle_height, - cell_size: 100, - x_colors: triangle_colors - }); - $('#banner').css('background-image', 'url("' + pattern.png() + '")'); +- cache [@conference.color, '#splash#inlinejs'] do + - content_for :script_head do + :javascript + var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic(); + var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); }); + $(function () { + $(document).ready(function() { + var triangle_width = document.body.clientWidth; + var triangle_height = ($( "#banner" ).height() + 200 ); + var pattern = Trianglify({ width: triangle_width, + height: triangle_height, + cell_size: 100, + x_colors: triangle_colors + }); + $('#banner').css('background-image', 'url("' + pattern.png() + '")'); + }); }); - }); From 3cdef86d6425f71615129b042f4136ce510b4dbc Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 21 Nov 2017 10:06:58 -0800 Subject: [PATCH 29/56] Redesign & move splashpage header into a partial ... this allows conferences/show to consistently just show layout. --- app/views/conferences/_header.haml | 32 ++++++++++++++++++++++++++++ app/views/conferences/show.html.haml | 26 +--------------------- 2 files changed, 33 insertions(+), 25 deletions(-) create mode 100644 app/views/conferences/_header.haml diff --git a/app/views/conferences/_header.haml b/app/views/conferences/_header.haml new file mode 100644 index 00000000..3d68ff17 --- /dev/null +++ b/app/views/conferences/_header.haml @@ -0,0 +1,32 @@ +- cache [@conference, @conference.venue, '#splash#header'] do + #banner + .container + .row + .col-md-8.col-md-offset-2#header + .row + .col-md-4 + = image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture? + .col-md-8 + %h1 + = @conference.title + %h3 + - if @conference.start_date && @conference.end_date + %span.date.text-nowrap + = date_string(@conference.start_date, @conference.end_date) + - if @conference.venue + %span.venue.text-nowrap + - if @conference.venue.website + = sanitize link_to(@conference.venue.name, @conference.venue.website) + - else + = @conference.venue.city + - if @conference.venue.country_name != 'US' + • + = @conference.venue.country_name + + - unless @conference.description.blank? + %section#about + .container + .row + .col-md-8.col-md-offset-2 + %h3.text-center + = markdown(@conference.description) diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index 65a3b629..f82235ce 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -11,31 +11,7 @@ = @conference.title #splash - - cache [@conference, @conference.venue, '#splash#header'] do - #banner - .container - .row - .col-md-8.col-md-offset-2#header - .row - .col-md-4 - = image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture? - .col-md-8 - %h1 - = @conference.title - %p.lead - - if @conference.venue - = "#{@conference.venue.city} / #{@conference.venue.country_name}" - - if @conference.start_date && @conference.end_date - %br - = date_string(@conference.start_date, @conference.end_date) - - - unless @conference.description.blank? - %section#about - .container - .row - .col-md-8.col-md-offset-2 - %h3.text-center - = markdown(@conference.description) + = render 'header' - if @conference.splashpage.include_registrations && @conference.registration_open? = render 'registration' From 92927a4f8844142f0054d5120fc74cfb2c760e32 Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 21 Nov 2017 10:14:54 -0800 Subject: [PATCH 30/56] Reorder splashpage sections Grouping common things, trying to keep things making sense. I'd like to see this become customizable at some point. --- app/views/conferences/show.html.haml | 37 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index f82235ce..e6e2fe00 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -11,39 +11,38 @@ = @conference.title #splash + // header/description = render 'header' + // attendance/registration - if @conference.splashpage.include_registrations && @conference.registration_open? = render 'registration' - - - if @conference.splashpage.include_program - = render 'schedule_splashpage' - - - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) - = render 'call_for_paper' - - - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) - = render 'call_for_tracks' - - - if @conference.splashpage.include_venue && @conference.venue - = render 'venue' - - - if @conference.splashpage.include_lodgings && @conference.lodgings.any? - = render 'lodging' - - if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending? = render 'tickets' + // calls for content - or - program + - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) + = render 'call_for_paper' + - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) + = render 'call_for_tracks' + - if @conference.splashpage.include_program + = render 'schedule_splashpage' - if @conference.splashpage.include_booths && @conference.confirmed_booths.any? = render 'booths' - - if @conference.splashpage.include_sponsors && @conference.sponsors.any? + // geo + - if @conference.splashpage.include_venue && @conference.venue + = render 'venue' + - if @conference.splashpage.include_lodgings && @conference.lodgings.any? + = render 'lodging' + + // sponsorship + - if @conference.splashpage.include_sponsors = render 'sponsors' + // footer - if @conference.splashpage.include_social_media && @conference.contact.has_social_media? = render 'social_media' - - // grmbl = render 'footer' - cache [@conference.color, '#splash#inlinejs'] do From 394448dc36bf7883c774a2a0a5443cdd8a94a971 Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 21 Nov 2017 10:26:19 -0800 Subject: [PATCH 31/56] Fold booths into the schedule section of splashpage --- app/views/conferences/_booths.html.haml | 4 ---- app/views/conferences/_schedule_splashpage.html.haml | 9 ++++++--- app/views/conferences/show.html.haml | 4 +--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/views/conferences/_booths.html.haml b/app/views/conferences/_booths.html.haml index fd9db04f..5bff5a70 100644 --- a/app/views/conferences/_booths.html.haml +++ b/app/views/conferences/_booths.html.haml @@ -1,7 +1,3 @@ -= content_for :splash_nav do - %li - %a.smoothscroll{ href: '#booths' } Booths - - cache [@conference.confirmed_booths, '#splash#booths'] do %section#booths .container diff --git a/app/views/conferences/_schedule_splashpage.html.haml b/app/views/conferences/_schedule_splashpage.html.haml index cccbe929..90803430 100644 --- a/app/views/conferences/_schedule_splashpage.html.haml +++ b/app/views/conferences/_schedule_splashpage.html.haml @@ -1,9 +1,9 @@ = content_for :splash_nav do %li - =link_to('#program', class: 'smoothscroll') do - Program + %a.smoothscroll{ href: '#program' } Program -- cache [@confererence, @conference.confirmed_tracks, '#splash#program'] do +- cache [@confererence, @conference.confirmed_tracks, + @conference.confirmed_booths,'#splash#schedule'] do %section#program .container .row @@ -55,3 +55,6 @@ %h5.text-center = markdown truncate(event.abstract, length: 500, separator: ' ') = link_to "Read More", conference_program_proposal_path(@conference.short_title, event) + +- if @conference.splashpage.include_booths && @conference.confirmed_booths.any? + = render 'booths' diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index e6e2fe00..95d82ca0 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -20,15 +20,13 @@ - if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending? = render 'tickets' - // calls for content - or - program + // calls for content, or program - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) = render 'call_for_paper' - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) = render 'call_for_tracks' - if @conference.splashpage.include_program = render 'schedule_splashpage' - - if @conference.splashpage.include_booths && @conference.confirmed_booths.any? - = render 'booths' // geo - if @conference.splashpage.include_venue && @conference.venue From f0c3fc357b5a46b73ab63e5914a3ced573b37dac Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 21 Nov 2017 10:56:46 -0800 Subject: [PATCH 32/56] Fold call for papers & call for tracks into one splashpage section --- Gemfile.lock | 2 +- app/views/admin/splashpages/_form.html.haml | 2 +- app/views/admin/splashpages/show.html.haml | 2 +- app/views/conferences/_call_for_content.haml | 14 ++++ .../conferences/_call_for_paper.html.haml | 81 ++++++++----------- .../conferences/_call_for_tracks.html.haml | 47 +++++------ app/views/conferences/show.html.haml | 6 +- spec/features/versions_spec.rb | 2 +- 8 files changed, 73 insertions(+), 83 deletions(-) create mode 100644 app/views/conferences/_call_for_content.haml diff --git a/Gemfile.lock b/Gemfile.lock index 1645c8be..0f64b0e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -293,7 +293,7 @@ GEM multi_json (1.12.1) multi_xml (0.5.5) multipart-post (2.0.0) - mysql2 (0.4.9) + mysql2 (0.4.10) nenv (0.3.0) netrc (0.11.0) nio4r (2.1.0) diff --git a/app/views/admin/splashpages/_form.html.haml b/app/views/admin/splashpages/_form.html.haml index c1897745..96a1a300 100644 --- a/app/views/admin/splashpages/_form.html.haml +++ b/app/views/admin/splashpages/_form.html.haml @@ -8,7 +8,7 @@ = f.inputs name: 'Components' do = f.input :include_tracks, label: 'Display tracks', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tracks) } = f.input :include_program, label: 'Display program', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_program) } - = f.input :include_cfp, label: 'Display call for papers information on splashpage, while cfp is open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) } + = f.input :include_cfp, label: 'Display call for papers and call for tracks information on splashpage, while open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) } = f.input :include_venue, label: 'Display venue', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_venue) } = f.input :include_registrations, label: 'Display the registration period', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_registrations) } = f.input :include_tickets, label: 'Display tickets', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tickets) } diff --git a/app/views/admin/splashpages/show.html.haml b/app/views/admin/splashpages/show.html.haml index c185b119..8d799eda 100644 --- a/app/views/admin/splashpages/show.html.haml +++ b/app/views/admin/splashpages/show.html.haml @@ -25,7 +25,7 @@ - else No %dt - Include CFP: + Include Calls for Content: %dd - if @splashpage.include_cfp Yes diff --git a/app/views/conferences/_call_for_content.haml b/app/views/conferences/_call_for_content.haml new file mode 100644 index 00000000..7f8703c4 --- /dev/null +++ b/app/views/conferences/_call_for_content.haml @@ -0,0 +1,14 @@ += content_for :splash_nav do + %li + %a.smoothscroll{ href: '#call' } Call For Content + +%section#call + .container + .row + - if @conference.call_for_events.try(:open?) ^ @conference.call_for_tracks.try(:open?) + .col-md-3.col-sm-3.hidden-xs   + - if @conference.call_for_events.try(:open?) + = render 'call_for_paper' + .col-md-2.col-sm-2   + - if @conference.call_for_tracks.try(:open?) + = render 'call_for_tracks' diff --git a/app/views/conferences/_call_for_paper.html.haml b/app/views/conferences/_call_for_paper.html.haml index 9d8188fa..d173356c 100644 --- a/app/views/conferences/_call_for_paper.html.haml +++ b/app/views/conferences/_call_for_paper.html.haml @@ -1,48 +1,37 @@ -= content_for :splash_nav do - %li - %a.smoothscroll{ href: '#callforpapers' } Call For Papers - - cache [@conference, @conference.call_for_events, @conference.confirmed_tracks, '#splash#callforpapers'] do - %section#callforpapers - .container - .row - .col-md-12.text-center - %h2 - Call for Papers - %p.lead - We are ready to accept your proposals for sessions! - .row - .col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1 - %p - - if @conference.event_types.any? - You can submit proposals for - %span.notranslate - = "#{event_types(@conference)}." - - if @conference.confirmed_tracks.any? - Proposals should fit in one of the - %span.notranslate - = "#{pluralize(@conference.confirmed_tracks.length, 'track')}:" - = "#{tracks(@conference)}." - - if @conference.call_for_events.try(:open?) - The submission period is open - %em.notranslate - = "#{date_string(@conference.call_for_events.start_date, - @conference.call_for_events.end_date)}." - %b - You have - = pluralize(@conference.call_for_events.remaining_days, 'day') - left! - Remember - %span.notranslate - = @conference.title - will only be as good as the sessions you present. - Submit early, submit often! - - else - The submission period is closed. - .row - .col-md-12.text-center - %p.cta-button - = link_to "Submit your paper now", - conference_program_proposals_path(@conference.short_title), - class: 'btn btn-success btn-lg text-center' + .col-md-5.col-sm-5.text-center + %h2 + Call for Papers + %p.lead + We are ready to accept your proposals for sessions! + %p + - if @conference.event_types.any? + You can submit proposals for + %span.notranslate + = "#{event_types(@conference)}." + - if @conference.confirmed_tracks.any? + Proposals should fit in one of the + %span.notranslate + = "#{pluralize(@conference.confirmed_tracks.length, 'track')}:" + = "#{tracks(@conference)}." + - if @conference.call_for_events.try(:open?) + The submission period is open + %em.notranslate + = "#{date_string(@conference.call_for_events.start_date, + @conference.call_for_events.end_date)}." + %b + You have + = pluralize(@conference.call_for_events.remaining_days, 'day') + left! + Remember + %span.notranslate + = @conference.title + will only be as good as the sessions you present. + Submit early, submit often! + - else + The submission period is closed. + %p.cta-button + = link_to "Submit your paper now", + conference_program_proposals_path(@conference.short_title), + class: 'btn btn-success btn-lg text-center' diff --git a/app/views/conferences/_call_for_tracks.html.haml b/app/views/conferences/_call_for_tracks.html.haml index e627fca8..d1851a12 100644 --- a/app/views/conferences/_call_for_tracks.html.haml +++ b/app/views/conferences/_call_for_tracks.html.haml @@ -1,30 +1,19 @@ -= content_for :splash_nav do - %li - %a.smoothscroll{ href: '#callfortracks' } Call For Tracks - - cache [@conference, @conference.call_for_tracks, '#splash#callfortracks'] do - %section#callfortracks - .container - .row - .col-md-12.text-center - %h2 - Call for Tracks - %p.lead - We are ready to accept requests for tracks! - .row - .col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1 - %p - The submission period for track requests is open - %em.notranslate - = "#{date_string(@conference.call_for_tracks.start_date, - @conference.call_for_tracks.end_date)}." - %b - You have - = pluralize(@conference.call_for_tracks.remaining_days, 'day') - left! - .row - .col-md-12.text-center - %p.cta-button - = link_to("Submit your request for track", - conference_program_tracks_path(@conference.short_title), - class: 'btn btn-success btn-lg text-center') + .col-md-5.col-sm-5.text-center + %h2 + Call for Tracks + %p.lead + We are ready to accept requests for tracks! + %p + The submission period for track requests is open + %em.notranslate + = "#{date_string(@conference.call_for_tracks.start_date, + @conference.call_for_tracks.end_date)}." + %b + You have + = pluralize(@conference.call_for_tracks.remaining_days, 'day') + left! + %p.cta-button + = link_to("Submit your request for track", + conference_program_tracks_path(@conference.short_title), + class: 'btn btn-success btn-lg text-center') diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index 95d82ca0..86254efd 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -21,10 +21,8 @@ = render 'tickets' // calls for content, or program - - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) - = render 'call_for_paper' - - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) - = render 'call_for_tracks' + - if @conference.splashpage.include_cfp + = render 'call_for_content' - if @conference.splashpage.include_program = render 'schedule_splashpage' diff --git a/spec/features/versions_spec.rb b/spec/features/versions_spec.rb index 37ad4e15..1451b907 100644 --- a/spec/features/versions_spec.rb +++ b/spec/features/versions_spec.rb @@ -237,7 +237,7 @@ feature 'Version' do click_link 'Edit' uncheck('Display program') - uncheck('Display call for papers information on splashpage, while cfp is open') + uncheck('Display call for papers and call for tracks information on splashpage, while open') uncheck('Display venue') uncheck('Display tickets') uncheck('Display the lodgings') From aee1f58607d7d2c9653e077d2588b1f41db6867e Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 21 Nov 2017 18:31:14 -0800 Subject: [PATCH 33/56] Consistent design and code cleanup of splashpage elements. * get rid of unnecessary slice() * center up small groups of elements * consistent text use FIXME: extract out strings * consistent date strings * simplified views for easier theming --- app/views/conferences/_booths.html.haml | 34 +++++++++------- .../conferences/_call_for_paper.html.haml | 11 +---- .../conferences/_call_for_tracks.html.haml | 3 +- app/views/conferences/_lodging.html.haml | 10 +++-- app/views/conferences/_program.html.haml | 40 ------------------- app/views/conferences/_registration.html.haml | 9 +++-- app/views/conferences/_tickets.html.haml | 33 +++++++-------- 7 files changed, 48 insertions(+), 92 deletions(-) delete mode 100644 app/views/conferences/_program.html.haml diff --git a/app/views/conferences/_booths.html.haml b/app/views/conferences/_booths.html.haml index 5bff5a70..cc48fead 100644 --- a/app/views/conferences/_booths.html.haml +++ b/app/views/conferences/_booths.html.haml @@ -4,19 +4,23 @@ .row .col-md-12.text-center %h2 Booths - - @conference.confirmed_booths.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 + .row.row-centered + - @conference.confirmed_booths.each do |booth| + .col-md-4.col-sm-4.col-centered.col-top + .thumbnail.text-center + - if booth.picture? + = link_to booth.website_url, + class: 'thumbnail', target: '_blank' do + = image_tag booth.picture.large.url, alt: booth.title, + class: 'img-rounded' + .caption + %h3.text-center + - if booth.logo_link + = link_to booth.title, booth.website_url, target: '_blank' + -else = booth.title - %p.text-center.text-muted - = link_to "#show_description_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do - learn more - .collapse{ id: "show_description_#{index_for_row}_#{index_for_column}" } - = markdown(booth.description) + = link_to '', "#booth-detail-#{booth.id}", + data: {toggle: 'collapse'}, class: 'caret', + title: 'more info' + .collapse{ id: "booth-detail-#{booth.id}" } + = markdown(booth.description) diff --git a/app/views/conferences/_call_for_paper.html.haml b/app/views/conferences/_call_for_paper.html.haml index d173356c..09203e75 100644 --- a/app/views/conferences/_call_for_paper.html.haml +++ b/app/views/conferences/_call_for_paper.html.haml @@ -4,7 +4,7 @@ %h2 Call for Papers %p.lead - We are ready to accept your proposals for sessions! + We are now accepting proposals for sessions! %p - if @conference.event_types.any? You can submit proposals for @@ -24,14 +24,7 @@ You have = pluralize(@conference.call_for_events.remaining_days, 'day') left! - Remember - %span.notranslate - = @conference.title - will only be as good as the sessions you present. - Submit early, submit often! - - else - The submission period is closed. %p.cta-button - = link_to "Submit your paper now", + = link_to "Submit your proposal now", conference_program_proposals_path(@conference.short_title), class: 'btn btn-success btn-lg text-center' diff --git a/app/views/conferences/_call_for_tracks.html.haml b/app/views/conferences/_call_for_tracks.html.haml index d1851a12..092c2740 100644 --- a/app/views/conferences/_call_for_tracks.html.haml +++ b/app/views/conferences/_call_for_tracks.html.haml @@ -3,8 +3,9 @@ %h2 Call for Tracks %p.lead - We are ready to accept requests for tracks! + We are now accepting custom track requests! %p + Would you like to host a mini-summit, sub-conference, or hack space? The submission period for track requests is open %em.notranslate = "#{date_string(@conference.call_for_tracks.start_date, diff --git a/app/views/conferences/_lodging.html.haml b/app/views/conferences/_lodging.html.haml index 006978d3..4859b8f5 100644 --- a/app/views/conferences/_lodging.html.haml +++ b/app/views/conferences/_lodging.html.haml @@ -6,14 +6,14 @@ %section#lodging .container .row - .col-md-12.text-centers + .col-md-12.text-center %h2 Where to stay - if @conference.venue in = @conference.venue.city %p.lead - We recommend these affordable lodging accommodations for your visit. + We recommend the following accommodations for your visit. .row.row-centered - @conference.lodgings.each do |lodging| @@ -22,9 +22,11 @@ - if lodging.picture? -if lodging.website_link.present? = link_to(lodging.website_link, class: 'thumbnail') do - = image_tag lodging.picture.large.url, class: 'img-responsive img-lodging' + = image_tag lodging.picture.large.url, + class: 'img-responsive img-lodging' - else - = image_tag lodging.picture.large.url, class: 'img-responsive img-lodging' + = image_tag lodging.picture.large.url, + class: 'img-responsive img-lodging' - else %p.text-center -if lodging.website_link.present? diff --git a/app/views/conferences/_program.html.haml b/app/views/conferences/_program.html.haml deleted file mode 100644 index f07816a4..00000000 --- a/app/views/conferences/_program.html.haml +++ /dev/null @@ -1,40 +0,0 @@ -= content_for :splash_nav do - %li - %a.smoothscroll{ href: '#callforpapers' } Call For Papers - -.container - .row - .col-md-12.text-center - %h2 - Call for Papers - %p.lead - We are ready to accept your proposals for sessions! - .row - .col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1 - %p - - if @conference.program.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 - = @program.cfp.start_date.strftime('%A, %B %-d. %Y') - and closes - %em - = @program.cfp.end_date.strftime('%A, %B %-d. %Y.') - - if @conference.cfp_open? - That means you have only - %b= pluralize(@program.cfp.remaining_days, 'day') - left! - Remember - = @conference.short_title - will only be as good as the sessions you present. Submit early, submit often! - - else - The submission period is closed. - .row - .col-md-12.text-center - %p.cta-button - = link_to "Submit your paper now", conference_proposals_path(@conference.short_title), class: 'btn btn-success btn-lg text-center' diff --git a/app/views/conferences/_registration.html.haml b/app/views/conferences/_registration.html.haml index 9db1f280..b9b27f08 100644 --- a/app/views/conferences/_registration.html.haml +++ b/app/views/conferences/_registration.html.haml @@ -19,14 +19,15 @@ = @conference.short_title is free of charge. %p - We only ask you to register yourself until - = @conference.registration_period.end_date.strftime('%A, %B %-d. %Y') + We only ask you to register yourself before + = date_string(@conference.registration_period.end_date) so we can plan for the right amount of people. %p.cta-button - else %p The registration period ends on - = @conference.registration_period.end_date.strftime('%A, %B %-d. %Y') + = date_string(@conference.registration_period.end_date) %p.cta-button - = link_to(new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-lg btn-success') do + = link_to(new_conference_conference_registration_path(@conference.short_title), + class: 'btn btn-lg btn-success') do Register Now diff --git a/app/views/conferences/_tickets.html.haml b/app/views/conferences/_tickets.html.haml index d06218ce..6f612a6a 100644 --- a/app/views/conferences/_tickets.html.haml +++ b/app/views/conferences/_tickets.html.haml @@ -9,22 +9,17 @@ .col-md-12.text-center %h2 Support - =@conference.short_title - %p.lead - To support our event you can get these tickets - - @conference.tickets.each_slice(4) do |slice| - .row.row-centered - - slice.each do |ticket| - .col-md-3.col-centered.col-top.col-sm-3 - .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 - Get Ticket - = humanized_money_with_symbol ticket.price + =@conference.title + .row.row-centered + - @conference.tickets.each do |ticket| + .col-md-3.col-sm-3.col-centered.col-top + %h3.text-center + = ticket.title + %h3.text-center + %i.fa.fa-ticket.fa-3x + = markdown(ticket.description) + %p.text-center + = link_to conference_tickets_path(@conference.short_title), + class: 'btn btn-success' do + Get Ticket + = humanized_money_with_symbol ticket.price From b2e1eb5fa9d874e5e2d379eed4fdd032daf9b5ba Mon Sep 17 00:00:00 2001 From: James Mason Date: Sun, 26 Nov 2017 20:34:27 -0800 Subject: [PATCH 34/56] Generalize get_logo helper for all classes --- app/helpers/application_helper.rb | 15 +++++++++ app/helpers/sponsors_helper.rb | 12 ------- spec/helpers/application_helper_spec.rb | 44 ++++++++++++++++++++++++- spec/helpers/sponsor_helper_spec.rb | 40 ---------------------- 4 files changed, 58 insertions(+), 53 deletions(-) delete mode 100644 app/helpers/sponsors_helper.rb delete mode 100644 spec/helpers/sponsor_helper_spec.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 77f4f85e..1fd0b6db 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -181,4 +181,19 @@ module ApplicationHelper title: 'Open Source Event Manager' ) end + + # returns the url to be used for logo on basis of sponsorship level position + def get_logo(object) + if object.try(:sponsorship_level) + if object.sponsorship_level.position == 1 + object.picture.first.url + elsif object.sponsorship_level.position == 2 + object.picture.second.url + else + object.picture.others.url + end + else + object.picture.large.url + end + end end diff --git a/app/helpers/sponsors_helper.rb b/app/helpers/sponsors_helper.rb deleted file mode 100644 index 4a21c9cd..00000000 --- a/app/helpers/sponsors_helper.rb +++ /dev/null @@ -1,12 +0,0 @@ -module SponsorsHelper - # returns the url to be used for logo on basis of sponsorship level position - def get_logo(sponsor) - if sponsor.sponsorship_level.position == 1 - sponsor.picture.first.url - elsif sponsor.sponsorship_level.position == 2 - sponsor.picture.second.url - else - sponsor.picture.others.url - end - end -end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 6626ed87..ff0fbfa2 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -1,8 +1,9 @@ require 'spec_helper' describe ApplicationHelper, type: :helper do - let(:conference) { create(:conference) } + let(:conference) { create(:full_conference) } let(:event) { create(:event, program: conference.program) } + let(:sponsor) { create(:sponsor) } describe '#date_string' do it 'when conference lasts 1 day' do @@ -75,4 +76,45 @@ describe ApplicationHelper, type: :helper do end end end + + describe '#get_logo' do + context 'first sponsorship_level' do + before do + first_sponsorship_level = create(:sponsorship_level, position: 1) + sponsor.update_attributes(sponsorship_level: first_sponsorship_level) + end + + it 'returns correct url' do + expect(get_logo(sponsor)).to match %r{.*(\bfirst/#{sponsor.logo_file_name}\b)} + end + end + + context 'second sponsorship_level' do + before do + second_sponsorship_level = create(:sponsorship_level, position: 2) + sponsor.update_attributes(sponsorship_level: second_sponsorship_level) + end + + it 'returns correct url' do + expect(get_logo(sponsor)).to match %r{.*(\bsecond/#{sponsor.logo_file_name}\b)} + end + end + + context 'other sponsorship_level' do + before do + other_sponsorship_level = create(:sponsorship_level, position: 3) + sponsor.update_attributes(sponsorship_level: other_sponsorship_level) + end + + it 'returns correct url' do + expect(get_logo(sponsor)).to match %r{.*(\bothers/#{sponsor.logo_file_name}\b)} + end + end + + context 'non-sponsor' do + it 'returns correct url' do + expect(get_logo(conference)).to match %r{.*(\blarge/#{conference.logo_file_name}\b)} + end + end + end end diff --git a/spec/helpers/sponsor_helper_spec.rb b/spec/helpers/sponsor_helper_spec.rb deleted file mode 100644 index c6ce08ce..00000000 --- a/spec/helpers/sponsor_helper_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'spec_helper' - -describe SponsorsHelper, type: :helper do - let(:sponsor) { create(:sponsor) } - - describe '#get_logo' do - context 'first sponsorship_level' do - before do - first_sponsorship_level = create(:sponsorship_level, position: 1) - sponsor.update_attributes(sponsorship_level: first_sponsorship_level) - end - - it 'returns correct url' do - expect(get_logo(sponsor)).to match %r{.*(\bfirst/#{sponsor.logo_file_name}\b)} - end - end - - context 'second sponsorship_level' do - before do - second_sponsorship_level = create(:sponsorship_level, position: 2) - sponsor.update_attributes(sponsorship_level: second_sponsorship_level) - end - - it 'returns correct url' do - expect(get_logo(sponsor)).to match %r{.*(\bsecond/#{sponsor.logo_file_name}\b)} - end - end - - context 'other sponsorship_level' do - before do - other_sponsorship_level = create(:sponsorship_level, position: 3) - sponsor.update_attributes(sponsorship_level: other_sponsorship_level) - end - - it 'returns correct url' do - expect(get_logo(sponsor)).to match %r{.*(\bothers/#{sponsor.logo_file_name}\b)} - end - end - end -end From 20e2b4b76b57360ab89dccb01b7ad1a1f125d805 Mon Sep 17 00:00:00 2001 From: James Mason Date: Sun, 26 Nov 2017 20:37:02 -0800 Subject: [PATCH 35/56] Move sponsor modal to a generic partial & redesign. ... use for booths also. --- app/views/conferences/_booths.html.haml | 28 +++++-------- app/views/conferences/_modal_description.haml | 21 ++++++++++ app/views/conferences/_sponsors.html.haml | 40 +++++++------------ app/views/conferences/_tickets.html.haml | 19 +++++---- app/views/conferences/show.html.haml | 2 + 5 files changed, 58 insertions(+), 52 deletions(-) create mode 100644 app/views/conferences/_modal_description.haml diff --git a/app/views/conferences/_booths.html.haml b/app/views/conferences/_booths.html.haml index cc48fead..9e37ac95 100644 --- a/app/views/conferences/_booths.html.haml +++ b/app/views/conferences/_booths.html.haml @@ -6,21 +6,15 @@ %h2 Booths .row.row-centered - @conference.confirmed_booths.each do |booth| - .col-md-4.col-sm-4.col-centered.col-top - .thumbnail.text-center + .col-md-2.col-sm-2.col-centered.col-top + %a.thumbnail{ href: '#', + data: { toggle: 'modal', target: "#modal-booth-#{booth.id}" } } - if booth.picture? - = link_to booth.website_url, - class: 'thumbnail', target: '_blank' do - = image_tag booth.picture.large.url, alt: booth.title, - class: 'img-rounded' - .caption - %h3.text-center - - if booth.logo_link - = link_to booth.title, booth.website_url, target: '_blank' - -else - = booth.title - = link_to '', "#booth-detail-#{booth.id}", - data: {toggle: 'collapse'}, class: 'caret', - title: 'more info' - .collapse{ id: "booth-detail-#{booth.id}" } - = markdown(booth.description) + = image_tag get_logo(booth), + class: ['img-responsive', 'img-rounded'], + title: booth.title + - else + .caption + %h3.text-center= booth.title + - content_for :modals do + = render 'modal_description', object: booth diff --git a/app/views/conferences/_modal_description.haml b/app/views/conferences/_modal_description.haml new file mode 100644 index 00000000..a8d1b1d2 --- /dev/null +++ b/app/views/conferences/_modal_description.haml @@ -0,0 +1,21 @@ +- content_for :modals do + .modal.fade{ id: "modal-#{object.class.name.downcase}-#{object.id}" } + .modal-dialog + .modal-content + .modal-header + %button.close{ data: { dismiss: 'modal' } } + %i.fa.fa-close + %h3.modal-title + = object.try(:title) || object.try(:name) + .modal-body + %p.logo + = link_to object.website_url || '#', target: '_blank' do + - img_classes = ['img-responsive center-block'] + - if object.is_a? Sponsor + - img_classes << ['img-sponsor', + "img-sponsor-#{object.sponsorship_level.position}"] + = image_tag get_logo(object), class: img_classes + %p.description + = object.description + .modal-footer + = link_to nil, object.website_url, target: '_blank' diff --git a/app/views/conferences/_sponsors.html.haml b/app/views/conferences/_sponsors.html.haml index 5f961acd..aa15ab5a 100644 --- a/app/views/conferences/_sponsors.html.haml +++ b/app/views/conferences/_sponsors.html.haml @@ -6,34 +6,24 @@ @conference.try(:call_for_sponsors), '#splash#sponsors'] do %section#sponsors .container - .row - .col-md-12.text-center - %h2 Sponsors - @conference.sponsorship_levels.each do |sponsorship_level| -if sponsorship_level.sponsors.any? - - sponsorship_level.sponsors.each_slice(3) do |slice| - .row.row-centered - - slice.each do |sponsor| - .col-md-4.col-sm-4.col-centered.col-top - %a{ href: '#', data: { toggle: 'modal', target: "#modal_#{sponsor.id}" } } - = image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}" + .row.text-center + %h3 + = sponsorship_level.title + = 'Sponsor'.pluralize(sponsorship_level.sponsors.length) + .row.row-centered + - sponsorship_level.sponsors.each do |sponsor| + .col-md-4.col-sm-4.col-centered.col-top + %a{ href: '#', + data: { toggle: 'modal', target: "#modal-sponsor-#{sponsor.id}" } } + = image_tag get_logo(sponsor), + class: ['img-responsive', 'img-sponsor', + "img-sponsor-#{sponsorship_level.position}"], + title: sponsor.name + - content_for :modals do + = render 'modal_description', object: sponsor - .modal.fade{ id: "modal_#{sponsor.id}" } - .modal-dialog - .modal-content - .modal-header - %button.close{ data: { dismiss: 'modal' } } - x - .modal-title - = sponsor.name - .modal-body.text-center - .logo - = link_to sponsor.website_url, target: '_blank' do - = image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}" - .description - = sponsor.description - .modal-footer - = link_to nil, "#{sponsor.website_url}", target: '_blank' - if @conference.call_for_sponsors.try(:open?) .row .col-md-12 diff --git a/app/views/conferences/_tickets.html.haml b/app/views/conferences/_tickets.html.haml index 6f612a6a..a01ad676 100644 --- a/app/views/conferences/_tickets.html.haml +++ b/app/views/conferences/_tickets.html.haml @@ -13,13 +13,12 @@ .row.row-centered - @conference.tickets.each do |ticket| .col-md-3.col-sm-3.col-centered.col-top - %h3.text-center - = ticket.title - %h3.text-center - %i.fa.fa-ticket.fa-3x - = markdown(ticket.description) - %p.text-center - = link_to conference_tickets_path(@conference.short_title), - class: 'btn btn-success' do - Get Ticket - = humanized_money_with_symbol ticket.price + = link_to(conference_tickets_path(@conference.short_title), + class: 'thumbnail') do + .caption + %h3.text-center + = ticket.title + = markdown(ticket.description) + %button.btn-block.btn.btn-lg.btn-success + %i.fa.fa-ticket.fa-fw + = humanized_money_with_symbol(ticket.price) diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index 86254efd..3905b3a4 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -41,6 +41,8 @@ = render 'social_media' = render 'footer' + = yield :modals + - cache [@conference.color, '#splash#inlinejs'] do - content_for :script_head do :javascript From 494a1b32a42307106b9d8cd78840ca25837b217a Mon Sep 17 00:00:00 2001 From: James Mason Date: Sun, 26 Nov 2017 20:53:03 -0800 Subject: [PATCH 36/56] Offset venue map to center up marker --- app/views/conferences/_venue_map.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/conferences/_venue_map.html.haml b/app/views/conferences/_venue_map.html.haml index 9f34117f..708d5e46 100644 --- a/app/views/conferences/_venue_map.html.haml +++ b/app/views/conferences/_venue_map.html.haml @@ -2,7 +2,7 @@ - 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([#{h(@conference.venue.latitude)}, #{h(@conference.venue.longitude)}], 11); + var map = L.map('map', { scrollWheelZoom: false }).setView([#{@conference.venue.latitude.to_f + 0.05}, #{h(@conference.venue.longitude)}], 11); // add an OpenStreetMap tile layer L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox', From 8f43da79b5eabb4c54e40fcb21217ac6bd60f151 Mon Sep 17 00:00:00 2001 From: James Mason Date: Mon, 27 Nov 2017 18:26:34 -0800 Subject: [PATCH 37/56] Redesign splashpage program section & split out partials --- app/views/conferences/_booths.html.haml | 37 +++++----- app/views/conferences/_highlights.haml | 18 +++++ .../_schedule_splashpage.html.haml | 71 ++++++------------- app/views/conferences/_tracks.haml | 17 +++++ 4 files changed, 73 insertions(+), 70 deletions(-) create mode 100644 app/views/conferences/_highlights.haml create mode 100644 app/views/conferences/_tracks.haml diff --git a/app/views/conferences/_booths.html.haml b/app/views/conferences/_booths.html.haml index 9e37ac95..92bfbaae 100644 --- a/app/views/conferences/_booths.html.haml +++ b/app/views/conferences/_booths.html.haml @@ -1,20 +1,17 @@ -- cache [@conference.confirmed_booths, '#splash#booths'] do - %section#booths - .container - .row - .col-md-12.text-center - %h2 Booths - .row.row-centered - - @conference.confirmed_booths.each do |booth| - .col-md-2.col-sm-2.col-centered.col-top - %a.thumbnail{ href: '#', - data: { toggle: 'modal', target: "#modal-booth-#{booth.id}" } } - - if booth.picture? - = image_tag get_logo(booth), - class: ['img-responsive', 'img-rounded'], - title: booth.title - - else - .caption - %h3.text-center= booth.title - - content_for :modals do - = render 'modal_description', object: booth +.row + .col-md-12.text-center + %h2 Booths +.row.row-centered + - @conference.confirmed_booths.each do |booth| + .col-md-2.col-sm-2.col-centered.col-top.booth + %a.thumbnail{ href: '#', + data: { toggle: 'modal', target: "#modal-booth-#{booth.id}" } } + - if booth.picture? + = image_tag get_logo(booth), + class: ['img-responsive', 'img-rounded'], + title: booth.title + - else + .caption + %h3.text-center= booth.title + - content_for :modals do + = render 'modal_description', object: booth diff --git a/app/views/conferences/_highlights.haml b/app/views/conferences/_highlights.haml new file mode 100644 index 00000000..0ea1eb99 --- /dev/null +++ b/app/views/conferences/_highlights.haml @@ -0,0 +1,18 @@ +.row + .col-md-12 + %h3.text-center + Program Highlights +.row + .col-md-12 + .row.row-centered + - @conference.highlighted_events.each do |event| + - speaker = event.speakers_ordered.first + .col-md-3.col-sm-3.col-centered.col-top.highlights + = link_to conference_program_proposal_path(@conference.short_title, event), + class: 'thumbnail' do + = image_tag speaker.gravatar_url(size: 300), + class: ['img-responsive', 'img-circle'], + title: speaker.name + .caption + %h3.text-center= speaker.name + %h4.text-center= event.title diff --git a/app/views/conferences/_schedule_splashpage.html.haml b/app/views/conferences/_schedule_splashpage.html.haml index 90803430..08958c94 100644 --- a/app/views/conferences/_schedule_splashpage.html.haml +++ b/app/views/conferences/_schedule_splashpage.html.haml @@ -3,58 +3,29 @@ %a.smoothscroll{ href: '#program' } Program - cache [@confererence, @conference.confirmed_tracks, - @conference.confirmed_booths,'#splash#schedule'] do + @conference.confirmed_booths,'#splash#program'] do %section#program - .container - .row - .col-md-12 - %h2.text-center - Program - %p.lead.text-center - %span.notranslate - = @conference.title - has the most awesome program ever! - - if @conference.splashpage.include_tracks && @conference.confirmed_tracks.any? - See rock-star speakers cover the topics of - - @conference.confirmed_tracks.each_slice(3) do |slice| - .row.row-centered - - slice.each do |track| - .col-md-4.col-sm-4.col-centered.col-top.track - %h4.text-center - = track.name - = markdown(track.description) - - if track.start_date - %br - From: #{track.start_date.strftime('%A, %B %-d. %Y')} - - if track.end_date - %br - To: #{track.end_date.strftime('%A, %B %-d. %Y')} - - if track.room - %br - In: #{track.room.name} - - - if @conference.program.try(:schedule_public?) + .container .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 + %p.lead.text-center + %span.notranslate + = @conference.title + has the most awesome program ever! - %h3.text-center - Don't miss out! - %br - - if @conference.highlighted_events.any? - .row - .col-md-12 - - @conference.highlighted_events.each_slice(2) do |slice| - .row.row-centered - - slice.each do |event| - .col-md-6.col-centered.col-top.highlights - %p.text-center - %b= event.title - %h5.text-center - = markdown truncate(event.abstract, length: 500, separator: ' ') - = link_to "Read More", conference_program_proposal_path(@conference.short_title, event) + - if @conference.highlighted_events.any? + = render 'highlights' -- if @conference.splashpage.include_booths && @conference.confirmed_booths.any? - = render 'booths' + - if @conference.splashpage.include_tracks && @conference.confirmed_tracks.any? + = render 'tracks' + + - if @conference.splashpage.include_booths && @conference.confirmed_booths.any? + = render 'booths' + + - if @conference.program.try(:schedule_public?) + .row + .col-md-12 + %p.cta-button.text-center + = link_to(conference_schedule_path(@conference.short_title), + class: 'btn btn-success btn-lg') do + Full Schedule diff --git a/app/views/conferences/_tracks.haml b/app/views/conferences/_tracks.haml new file mode 100644 index 00000000..1938ab0f --- /dev/null +++ b/app/views/conferences/_tracks.haml @@ -0,0 +1,17 @@ +.row + .col-md-12 + %h3.text-center + Tracks +.row.row-centered + - @conference.confirmed_tracks.to_a.sort_by!(&:name).each do |track| + .col-md-3.col-sm-3.col-centered.col-top.track + .thumbnail + .caption + %h3.text-center + = track.name + %p.text-center + - if track.start_date && track.end_date + = date_string(track.start_date, track.end_date) + - if track.room + In #{track.room.name} + = markdown truncate(track.description, length: 200, separator: ' ') From 27f6d8ad73e7bf3559057e6305ba2a4d905fcb29 Mon Sep 17 00:00:00 2001 From: James Mason Date: Mon, 27 Nov 2017 20:04:54 -0800 Subject: [PATCH 38/56] Let's get serious about linting, folks. --- .haml-lint_todo.yml | 11 --- app/helpers/conference_helper.rb | 18 +++++ .../{_booths.html.haml => _booths.haml} | 6 +- app/views/conferences/_call_for_content.haml | 10 +-- .../conferences/_call_for_paper.html.haml | 30 -------- app/views/conferences/_call_for_papers.haml | 30 ++++++++ ...tracks.html.haml => _call_for_tracks.haml} | 12 ++-- .../{_footer.html.haml => _footer.haml} | 0 app/views/conferences/_header.haml | 30 ++++---- app/views/conferences/_highlights.haml | 7 +- .../{_lodging.html.haml => _lodging.haml} | 14 ++-- app/views/conferences/_program.haml | 33 +++++++++ app/views/conferences/_registration.haml | 34 +++++++++ app/views/conferences/_registration.html.haml | 33 --------- .../_schedule_splashpage.html.haml | 31 --------- app/views/conferences/_social_media.haml | 20 ++++++ app/views/conferences/_social_media.html.haml | 20 ------ .../{_sponsors.html.haml => _sponsors.haml} | 18 ++--- .../{_tickets.html.haml => _tickets.haml} | 8 +-- app/views/conferences/_tracks.haml | 5 +- app/views/conferences/_venue.haml | 44 ++++++++++++ app/views/conferences/_venue.html.haml | 38 ---------- .../{_venue_map.html.haml => _venue_map.haml} | 25 +++++-- ...arker.html.haml => _venue_map_marker.haml} | 0 app/views/conferences/show.html.haml | 30 ++++---- spec/helpers/conference_helper_spec.rb | 69 +++++++++++++++++++ 26 files changed, 341 insertions(+), 235 deletions(-) create mode 100644 app/helpers/conference_helper.rb rename app/views/conferences/{_booths.html.haml => _booths.haml} (81%) delete mode 100644 app/views/conferences/_call_for_paper.html.haml create mode 100644 app/views/conferences/_call_for_papers.haml rename app/views/conferences/{_call_for_tracks.html.haml => _call_for_tracks.haml} (54%) rename app/views/conferences/{_footer.html.haml => _footer.haml} (100%) rename app/views/conferences/{_lodging.html.haml => _lodging.haml} (76%) create mode 100644 app/views/conferences/_program.haml create mode 100644 app/views/conferences/_registration.haml delete mode 100644 app/views/conferences/_registration.html.haml delete mode 100644 app/views/conferences/_schedule_splashpage.html.haml create mode 100644 app/views/conferences/_social_media.haml delete mode 100644 app/views/conferences/_social_media.html.haml rename app/views/conferences/{_sponsors.html.haml => _sponsors.haml} (58%) rename app/views/conferences/{_tickets.html.haml => _tickets.haml} (73%) create mode 100644 app/views/conferences/_venue.haml delete mode 100644 app/views/conferences/_venue.html.haml rename app/views/conferences/{_venue_map.html.haml => _venue_map.haml} (53%) rename app/views/conferences/{_venue_map_marker.html.haml => _venue_map_marker.haml} (100%) create mode 100644 spec/helpers/conference_helper_spec.rb diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index b79ddc17..54b6d85d 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -121,20 +121,9 @@ 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" - - "app/views/conferences/_lodging.html.haml" - - "app/views/conferences/_program.html.haml" - - "app/views/conferences/_registration.html.haml" - - "app/views/conferences/_schedule_splashpage.html.haml" - - "app/views/conferences/_sponsors.html.haml" - - "app/views/conferences/_tickets.html.haml" - - "app/views/conferences/_venue.html.haml" - - "app/views/conferences/_venue_map.html.haml" - "app/views/conferences/index.html.haml" - - "app/views/conferences/show.html.haml" - "app/views/devise/confirmations/new.html.haml" - "app/views/devise/ichain_sessions/new.html.haml" - "app/views/devise/ichain_sessions/new_test.html.haml" diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb new file mode 100644 index 00000000..3909ce92 --- /dev/null +++ b/app/helpers/conference_helper.rb @@ -0,0 +1,18 @@ +module ConferenceHelper + # Return true if only call_for_papers or call_for_tracks is open + def one_call_open(conference) + conference.call_for_events.try(:open?) ^ + conference.call_for_tracks.try(:open?) + end + + # URL for sponsorship emails + def sponsorship_mailto(conference) + [ + 'mailto:', + conference.contact.sponsor_email, + '?subject=', + url_encode(conference.short_title), + '%20Sponsorship' + ].join + end +end diff --git a/app/views/conferences/_booths.html.haml b/app/views/conferences/_booths.haml similarity index 81% rename from app/views/conferences/_booths.html.haml rename to app/views/conferences/_booths.haml index 92bfbaae..87c6cac5 100644 --- a/app/views/conferences/_booths.html.haml +++ b/app/views/conferences/_booths.haml @@ -1,8 +1,8 @@ .row - .col-md-12.text-center - %h2 Booths + .col-md-12 + %h3.text-center Booths .row.row-centered - - @conference.confirmed_booths.each do |booth| + - conference.confirmed_booths.to_a.sort_by!(&:title).each do |booth| .col-md-2.col-sm-2.col-centered.col-top.booth %a.thumbnail{ href: '#', data: { toggle: 'modal', target: "#modal-booth-#{booth.id}" } } diff --git a/app/views/conferences/_call_for_content.haml b/app/views/conferences/_call_for_content.haml index 7f8703c4..4ad6c855 100644 --- a/app/views/conferences/_call_for_content.haml +++ b/app/views/conferences/_call_for_content.haml @@ -5,10 +5,10 @@ %section#call .container .row - - if @conference.call_for_events.try(:open?) ^ @conference.call_for_tracks.try(:open?) + - if one_call_open(conference) .col-md-3.col-sm-3.hidden-xs   - - if @conference.call_for_events.try(:open?) - = render 'call_for_paper' + - if conference.call_for_events.try(:open?) + = render 'call_for_papers', conference: conference .col-md-2.col-sm-2   - - if @conference.call_for_tracks.try(:open?) - = render 'call_for_tracks' + - if conference.call_for_tracks.try(:open?) + = render 'call_for_tracks', conference: conference diff --git a/app/views/conferences/_call_for_paper.html.haml b/app/views/conferences/_call_for_paper.html.haml deleted file mode 100644 index 09203e75..00000000 --- a/app/views/conferences/_call_for_paper.html.haml +++ /dev/null @@ -1,30 +0,0 @@ -- cache [@conference, @conference.call_for_events, @conference.confirmed_tracks, - '#splash#callforpapers'] do - .col-md-5.col-sm-5.text-center - %h2 - Call for Papers - %p.lead - We are now accepting proposals for sessions! - %p - - if @conference.event_types.any? - You can submit proposals for - %span.notranslate - = "#{event_types(@conference)}." - - if @conference.confirmed_tracks.any? - Proposals should fit in one of the - %span.notranslate - = "#{pluralize(@conference.confirmed_tracks.length, 'track')}:" - = "#{tracks(@conference)}." - - if @conference.call_for_events.try(:open?) - The submission period is open - %em.notranslate - = "#{date_string(@conference.call_for_events.start_date, - @conference.call_for_events.end_date)}." - %b - You have - = pluralize(@conference.call_for_events.remaining_days, 'day') - left! - %p.cta-button - = link_to "Submit your proposal now", - conference_program_proposals_path(@conference.short_title), - class: 'btn btn-success btn-lg text-center' diff --git a/app/views/conferences/_call_for_papers.haml b/app/views/conferences/_call_for_papers.haml new file mode 100644 index 00000000..8499f4ac --- /dev/null +++ b/app/views/conferences/_call_for_papers.haml @@ -0,0 +1,30 @@ +- cache [conference, conference.call_for_events, conference.confirmed_tracks, + '#splash#callforpapers'] do + .col-md-5.col-sm-5.text-center + %h2 + Call for Papers + %p.lead + We are now accepting proposals for sessions! + %p + - if conference.event_types.any? + You can submit proposals for + %span.notranslate + = event_types(conference) + '.' + - if conference.confirmed_tracks.any? + Proposals should fit in one of the + %span.notranslate + = pluralize(conference.confirmed_tracks.length, 'track') + ':' + = tracks(conference) + '.' + - if conference.call_for_events.try(:open?) + The submission period is open + %em.notranslate + = date_string(conference.call_for_events.start_date, + conference.call_for_events.end_date) + '.' + %b + You have + = pluralize(conference.call_for_events.remaining_days, 'day') + left! + %p.cta-button + = link_to "Submit your proposal now", + conference_program_proposals_path(conference.short_title), + class: 'btn btn-success btn-lg text-center' diff --git a/app/views/conferences/_call_for_tracks.html.haml b/app/views/conferences/_call_for_tracks.haml similarity index 54% rename from app/views/conferences/_call_for_tracks.html.haml rename to app/views/conferences/_call_for_tracks.haml index 092c2740..59681f71 100644 --- a/app/views/conferences/_call_for_tracks.html.haml +++ b/app/views/conferences/_call_for_tracks.haml @@ -1,4 +1,4 @@ -- cache [@conference, @conference.call_for_tracks, '#splash#callfortracks'] do +- cache [conference, conference.call_for_tracks, '#splash#callfortracks'] do .col-md-5.col-sm-5.text-center %h2 Call for Tracks @@ -7,14 +7,14 @@ %p Would you like to host a mini-summit, sub-conference, or hack space? The submission period for track requests is open - %em.notranslate - = "#{date_string(@conference.call_for_tracks.start_date, - @conference.call_for_tracks.end_date)}." + %em + = date_string(conference.call_for_tracks.start_date, + conference.call_for_tracks.end_date) + '.' %b You have - = pluralize(@conference.call_for_tracks.remaining_days, 'day') + = pluralize(conference.call_for_tracks.remaining_days, 'day') left! %p.cta-button = link_to("Submit your request for track", - conference_program_tracks_path(@conference.short_title), + conference_program_tracks_path(conference.short_title), class: 'btn btn-success btn-lg text-center') diff --git a/app/views/conferences/_footer.html.haml b/app/views/conferences/_footer.haml similarity index 100% rename from app/views/conferences/_footer.html.haml rename to app/views/conferences/_footer.haml diff --git a/app/views/conferences/_header.haml b/app/views/conferences/_header.haml index 3d68ff17..7a635ae7 100644 --- a/app/views/conferences/_header.haml +++ b/app/views/conferences/_header.haml @@ -1,32 +1,36 @@ -- cache [@conference, @conference.venue, '#splash#header'] do +- cache [conference, conference.venue, '#splash#header'] do #banner .container .row .col-md-8.col-md-offset-2#header .row .col-md-4 - = image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture? + - if conference.picture? + = image_tag(conference.picture_url, + class: 'img-responsive img-center', + id: 'splash-logo') .col-md-8 %h1 - = @conference.title + = conference.title %h3 - - if @conference.start_date && @conference.end_date + - if conference.start_date && conference.end_date %span.date.text-nowrap - = date_string(@conference.start_date, @conference.end_date) - - if @conference.venue + = date_string(conference.start_date, conference.end_date) + - if conference.venue %span.venue.text-nowrap - - if @conference.venue.website - = sanitize link_to(@conference.venue.name, @conference.venue.website) + - if conference.venue.website + = sanitize link_to(conference.venue.name, + conference.venue.website) - else - = @conference.venue.city - - if @conference.venue.country_name != 'US' + = conference.venue.city + - if conference.venue.country_name != 'US' • - = @conference.venue.country_name + = conference.venue.country_name - - unless @conference.description.blank? + - unless conference.description.blank? %section#about .container .row .col-md-8.col-md-offset-2 %h3.text-center - = markdown(@conference.description) + = markdown(conference.description) diff --git a/app/views/conferences/_highlights.haml b/app/views/conferences/_highlights.haml index 0ea1eb99..6e610370 100644 --- a/app/views/conferences/_highlights.haml +++ b/app/views/conferences/_highlights.haml @@ -5,11 +5,12 @@ .row .col-md-12 .row.row-centered - - @conference.highlighted_events.each do |event| + - conference.highlighted_events.each do |event| - speaker = event.speakers_ordered.first .col-md-3.col-sm-3.col-centered.col-top.highlights - = link_to conference_program_proposal_path(@conference.short_title, event), - class: 'thumbnail' do + = link_to(conference_program_proposal_path(conference.short_title, + event), + class: 'thumbnail') do = image_tag speaker.gravatar_url(size: 300), class: ['img-responsive', 'img-circle'], title: speaker.name diff --git a/app/views/conferences/_lodging.html.haml b/app/views/conferences/_lodging.haml similarity index 76% rename from app/views/conferences/_lodging.html.haml rename to app/views/conferences/_lodging.haml index 4859b8f5..301dd142 100644 --- a/app/views/conferences/_lodging.html.haml +++ b/app/views/conferences/_lodging.haml @@ -2,25 +2,25 @@ %li %a.smoothscroll{ href: '#lodging' } Lodging -- cache [@conference.venue, @conference.lodgings, '#splash#lodging'] do +- cache [conference.venue, conference.lodgings, '#splash#lodging'] do %section#lodging .container .row .col-md-12.text-center %h2 Where to stay - - if @conference.venue + - if conference.venue in - = @conference.venue.city + = conference.venue.city %p.lead We recommend the following accommodations for your visit. .row.row-centered - - @conference.lodgings.each do |lodging| + - conference.lodgings.each do |lodging| .col-md-4.col-sm-4.col-centered.col-top .thumbnail - if lodging.picture? - -if lodging.website_link.present? + - if lodging.website_link.present? = link_to(lodging.website_link, class: 'thumbnail') do = image_tag lodging.picture.large.url, class: 'img-responsive img-lodging' @@ -29,7 +29,7 @@ class: 'img-responsive img-lodging' - else %p.text-center - -if lodging.website_link.present? + - if lodging.website_link.present? = link_to(lodging.website_link, class: 'thumbnail') do %i.fa.fa-home.fa-5x - else @@ -37,5 +37,5 @@ .caption %h3.text-center = lodging.name - -if lodging.description.present? + - if lodging.description.present? = markdown(lodging.description) diff --git a/app/views/conferences/_program.haml b/app/views/conferences/_program.haml new file mode 100644 index 00000000..67e058c7 --- /dev/null +++ b/app/views/conferences/_program.haml @@ -0,0 +1,33 @@ += content_for :splash_nav do + %li + %a.smoothscroll{ href: '#program' } Program + +- cache [@confererence, @conference.confirmed_tracks, + @conference.confirmed_booths,'#splash#program'] do + %section#program + .container + .row + .col-md-12 + %p.lead.text-center + %span.notranslate + = conference.title + has the most awesome program ever! + + - if conference.highlighted_events.any? + = render 'highlights', conference: conference + + - if conference.splashpage.include_tracks + - if conference.confirmed_tracks.any? + = render 'tracks', conference: conference + + - if conference.splashpage.include_booths + - if conference.confirmed_booths.any? + = render 'booths', conference: conference + + - if conference.program.try(:schedule_public?) + .row + .col-md-12 + %p.cta-button.text-center + = link_to(conference_schedule_path(conference.short_title), + class: 'btn btn-success btn-lg') do + Full Schedule diff --git a/app/views/conferences/_registration.haml b/app/views/conferences/_registration.haml new file mode 100644 index 00000000..f327344b --- /dev/null +++ b/app/views/conferences/_registration.haml @@ -0,0 +1,34 @@ += content_for :splash_nav do + %li + %a.smoothscroll{ href: '#registration' } Registration + +- cache [conference.registration_period, conference.tickets, + '#splash#registration'] do + %section#registration + .container + .row + .col-md-12.text-center + %h1 Registration + - if conference.registration_limit_exceeded? + %p + Sorry, the conference registration limit has exceeded + - elsif conference.tickets.empty? + %p.lead + Going to + = conference.short_title + is free of charge. + %p + We only ask you to register yourself before + = date_string(conference.registration_period.end_date) + so we can plan for the right amount of people. + %p.cta-button + - else + %p + The registration period is open + = date_string(conference.registration_period.start_date, + conference.registration_period.end_date) + - if conference.registration_open? + %p.cta-button + = link_to('Register Now', + new_conference_conference_registration_path(conference.short_title), + class: 'btn btn-lg btn-success') diff --git a/app/views/conferences/_registration.html.haml b/app/views/conferences/_registration.html.haml deleted file mode 100644 index b9b27f08..00000000 --- a/app/views/conferences/_registration.html.haml +++ /dev/null @@ -1,33 +0,0 @@ -= content_for :splash_nav do - %li - %a.smoothscroll{ href: '#registration' } Registration - -- cache [@conference.registration_period, @conference.tickets, '#splash#registration'] do - %section#registration - .container - .row - .col-md-12.text-center - %h1 Registration - - - if @conference.registration_limit_exceeded? - %p - Sorry, the conference registration limit has exceeded - - else - - if @conference.tickets.empty? - %p.lead - Going to - = @conference.short_title - is free of charge. - %p - We only ask you to register yourself before - = date_string(@conference.registration_period.end_date) - so we can plan for the right amount of people. - %p.cta-button - - else - %p - The registration period ends on - = date_string(@conference.registration_period.end_date) - %p.cta-button - = link_to(new_conference_conference_registration_path(@conference.short_title), - class: 'btn btn-lg btn-success') do - Register Now diff --git a/app/views/conferences/_schedule_splashpage.html.haml b/app/views/conferences/_schedule_splashpage.html.haml deleted file mode 100644 index 08958c94..00000000 --- a/app/views/conferences/_schedule_splashpage.html.haml +++ /dev/null @@ -1,31 +0,0 @@ -= content_for :splash_nav do - %li - %a.smoothscroll{ href: '#program' } Program - -- cache [@confererence, @conference.confirmed_tracks, - @conference.confirmed_booths,'#splash#program'] do - %section#program - .container - .row - .col-md-12 - %p.lead.text-center - %span.notranslate - = @conference.title - has the most awesome program ever! - - - if @conference.highlighted_events.any? - = render 'highlights' - - - if @conference.splashpage.include_tracks && @conference.confirmed_tracks.any? - = render 'tracks' - - - if @conference.splashpage.include_booths && @conference.confirmed_booths.any? - = render 'booths' - - - if @conference.program.try(:schedule_public?) - .row - .col-md-12 - %p.cta-button.text-center - = link_to(conference_schedule_path(@conference.short_title), - class: 'btn btn-success btn-lg') do - Full Schedule diff --git a/app/views/conferences/_social_media.haml b/app/views/conferences/_social_media.haml new file mode 100644 index 00000000..d227c54a --- /dev/null +++ b/app/views/conferences/_social_media.haml @@ -0,0 +1,20 @@ +- cache [conference.contact, '#splash#social'] do + %section#social-media + .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? + = link_to "#{ conference.contact.twitter }" do + %i.fa.fa-twitter.fa-4x + - unless conference.contact.instagram.blank? + = link_to "#{ conference.contact.instagram }" do + %i.fa.fa-instagram.fa-4x + - unless conference.contact.googleplus.blank? + = link_to "#{ conference.contact.googleplus }" do + %i.fa.fa-google-plus-square.fa-4x + - unless conference.contact.email.blank? + = mail_to "#{ conference.contact.email }" do + %i.fa.fa-envelope-o.fa-4x diff --git a/app/views/conferences/_social_media.html.haml b/app/views/conferences/_social_media.html.haml deleted file mode 100644 index 4d3a5c4f..00000000 --- a/app/views/conferences/_social_media.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -- cache [@conference.contact, '#splash#social'] do - %section#social-media - .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? - = link_to "#{ @conference.contact.twitter }" do - %i.fa.fa-twitter.fa-4x - - unless @conference.contact.instagram.blank? - = link_to "#{ @conference.contact.instagram }" do - %i.fa.fa-instagram.fa-4x - - unless @conference.contact.googleplus.blank? - = link_to "#{ @conference.contact.googleplus }" do - %i.fa.fa-google-plus-square.fa-4x - - unless @conference.contact.email.blank? - = mail_to "#{ @conference.contact.email }" do - %i.fa.fa-envelope-o.fa-4x diff --git a/app/views/conferences/_sponsors.html.haml b/app/views/conferences/_sponsors.haml similarity index 58% rename from app/views/conferences/_sponsors.html.haml rename to app/views/conferences/_sponsors.haml index aa15ab5a..f75939f6 100644 --- a/app/views/conferences/_sponsors.html.haml +++ b/app/views/conferences/_sponsors.haml @@ -2,12 +2,12 @@ %li %a.smoothscroll{ href: '#sponsors' } Sponsors -- cache [@conference, @conference.sponsors, @conference.sponsorship_levels, - @conference.try(:call_for_sponsors), '#splash#sponsors'] do +- cache [conference, conference.sponsors, conference.sponsorship_levels, + conference.try(:call_for_sponsors), '#splash#sponsors'] do %section#sponsors .container - - @conference.sponsorship_levels.each do |sponsorship_level| - -if sponsorship_level.sponsors.any? + - conference.sponsorship_levels.each do |sponsorship_level| + - if sponsorship_level.sponsors.any? .row.text-center %h3 = sponsorship_level.title @@ -15,8 +15,8 @@ .row.row-centered - sponsorship_level.sponsors.each do |sponsor| .col-md-4.col-sm-4.col-centered.col-top - %a{ href: '#', - data: { toggle: 'modal', target: "#modal-sponsor-#{sponsor.id}" } } + %a{ href: '#', data: { toggle: 'modal', + target: "#modal-sponsor-#{sponsor.id}" } } = image_tag get_logo(sponsor), class: ['img-responsive', 'img-sponsor', "img-sponsor-#{sponsorship_level.position}"], @@ -24,11 +24,11 @@ - content_for :modals do = render 'modal_description', object: sponsor - - if @conference.call_for_sponsors.try(:open?) + - if conference.call_for_sponsors.try(:open?) .row .col-md-12 %p.text-muted.text-center %small - Want to sponsor #{@conference.short_title}? - = link_to("mailto: #{@conference.contact.sponsor_email}?subject=#{@conference.short_title}%20Sponsorship") do + Want to sponsor #{conference.short_title}? + = link_to(sponsorship_mailto(conference)) do Please contact us! diff --git a/app/views/conferences/_tickets.html.haml b/app/views/conferences/_tickets.haml similarity index 73% rename from app/views/conferences/_tickets.html.haml rename to app/views/conferences/_tickets.haml index a01ad676..ce4ca802 100644 --- a/app/views/conferences/_tickets.html.haml +++ b/app/views/conferences/_tickets.haml @@ -2,18 +2,18 @@ %li %a.smoothscroll{ href: '#tickets' } Tickets -- cache [@conference, @conference.tickets, '#splash#tickets'] do +- cache [conference, conference.tickets, '#splash#tickets'] do %section#tickets .container .row .col-md-12.text-center %h2 Support - =@conference.title + = conference.title .row.row-centered - - @conference.tickets.each do |ticket| + - conference.tickets.each do |ticket| .col-md-3.col-sm-3.col-centered.col-top - = link_to(conference_tickets_path(@conference.short_title), + = link_to(conference_tickets_path(conference.short_title), class: 'thumbnail') do .caption %h3.text-center diff --git a/app/views/conferences/_tracks.haml b/app/views/conferences/_tracks.haml index 1938ab0f..3dd8e628 100644 --- a/app/views/conferences/_tracks.haml +++ b/app/views/conferences/_tracks.haml @@ -1,9 +1,8 @@ .row .col-md-12 - %h3.text-center - Tracks + %h3.text-center Tracks .row.row-centered - - @conference.confirmed_tracks.to_a.sort_by!(&:name).each do |track| + - conference.confirmed_tracks.to_a.sort_by!(&:name).each do |track| .col-md-3.col-sm-3.col-centered.col-top.track .thumbnail .caption diff --git a/app/views/conferences/_venue.haml b/app/views/conferences/_venue.haml new file mode 100644 index 00000000..c88695ac --- /dev/null +++ b/app/views/conferences/_venue.haml @@ -0,0 +1,44 @@ += content_for :splash_nav do + %li + %a.smoothscroll{ href: '#venue' } Venue + +- cache [conference.venue, conference.venue.commercial, '#splash#venue'] do + %section#venue + - if conference.venue.location? + = render '/conferences/venue_map', conference: conference + - else + .container + .row + .col-md-6 + .thumbnail#venue-pic + - if commercial = conference.venue.commercial + .flexvideo{ id: "resource-content-#{commercial.id}" } + = render 'shared/media_item', + commercial: commercial + - elsif conference.venue.picture? + = image_tag conference.venue.picture.url, + title: conference.venue.name, class: "img-responsive" + - else + %p.text-center + %span.fa.fa-university.fa-5x + .caption + %h3.text-center + = conference.venue.name + - unless conference.venue.description.blank? + = markdown(conference.venue.description) + .col-md-6 + %h2 + = conference.venue.city + \/ + = conference.venue.country_name + %address + = conference.venue.street + %br + = conference.venue.postalcode + ',' + = conference.venue.city + %br + = conference.venue.country_name + - if conference.venue.website + %br + = sanitize link_to(h(conference.venue.website), + h(conference.venue.website)) diff --git a/app/views/conferences/_venue.html.haml b/app/views/conferences/_venue.html.haml deleted file mode 100644 index 0c7ef254..00000000 --- a/app/views/conferences/_venue.html.haml +++ /dev/null @@ -1,38 +0,0 @@ -= content_for :splash_nav do - %li - %a.smoothscroll{ href: '#venue' } Venue - -- cache [@conference.venue, @conference.venue.commercial, '#splash#venue'] do - %section#venue - -if @conference.venue.location? - = render '/conferences/venue_map' - -else - .container - .row - .col-md-6 - .thumbnail#venue-pic - - if @conference.venue.commercial.present? and @conference.venue.commercial.persisted? - .flexvideo{ id: "resource-content-#{@conference.venue.commercial.id}"} - = render partial: 'shared/media_item', locals: { commercial: @conference.venue.commercial } - - elsif @conference.venue.picture? - = image_tag @conference.venue.picture.url, alt: @conference.venue.name, class:"img-responsive" - - else - %p.text-center - %span.fa.fa-university.fa-5x - .caption - %h3.text-center - = @conference.venue.name - - unless @conference.venue.description.blank? - = markdown(@conference.venue.description) - .col-md-6 - %h2 - = "#{@conference.venue.city} / #{@conference.venue.country_name}" - %address - = @conference.venue.street - %br - = "#{@conference.venue.postalcode}, #{@conference.venue.city}" - %br - = @conference.venue.country_name - - if @conference.venue.website - %br - =link_to(h(@conference.venue.website), h(@conference.venue.website)).html_safe diff --git a/app/views/conferences/_venue_map.html.haml b/app/views/conferences/_venue_map.haml similarity index 53% rename from app/views/conferences/_venue_map.html.haml rename to app/views/conferences/_venue_map.haml index 708d5e46..e4e56ea3 100644 --- a/app/views/conferences/_venue_map.html.haml +++ b/app/views/conferences/_venue_map.haml @@ -1,16 +1,29 @@ -#map{style: "height: 500px;" } +#map{ style: "height: 500px;" } - content_for(:script_body) do + - marker = escape_javascript(render '/conferences/venue_map_marker', + venue: conference.venue) :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.latitude.to_f + 0.05}, #{h(@conference.venue.longitude)}], 11); + var map = L.map('map', { scrollWheelZoom: false }).setView( + [ + #{conference.venue.latitude.to_f + 0.05}, + #{h(conference.venue.longitude)} + ], 11); // add an OpenStreetMap tile layer L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { - attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox', + attribution: 'Map data © \ + OpenStreetMap contributors, \ + CC-BY-SA, \ + Imagery © Mapbox', maxZoom: 18 }).addTo(map); - // add a marker in the given location, attach some popup content to it and open the popup - L.marker([#{h @conference.venue.latitude}, #{h @conference.venue.longitude}]).addTo(map) - .bindPopup("#{escape_javascript(render '/conferences/venue_map_marker', venue: @conference.venue)}") + // add a marker in the given location, attach some popup content to it + // and open the popup + L.marker([ + #{h conference.venue.latitude}, + #{h conference.venue.longitude} + ]).addTo(map) + .bindPopup("#{marker}") .openPopup(); // Turn scrollwheel on when user clicks map.on('focus', function(e) { diff --git a/app/views/conferences/_venue_map_marker.html.haml b/app/views/conferences/_venue_map_marker.haml similarity index 100% rename from app/views/conferences/_venue_map_marker.html.haml rename to app/views/conferences/_venue_map_marker.haml diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index 3905b3a4..ac0fc854 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -12,33 +12,35 @@ #splash // header/description - = render 'header' + = render 'header', conference: @conference // attendance/registration - - if @conference.splashpage.include_registrations && @conference.registration_open? - = render 'registration' - - if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending? - = render 'tickets' + - if @conference.splashpage.include_registrations + - if @conference.registration_open? + = render 'registration', conference: @conference + - if @conference.splashpage.include_tickets && @conference.tickets.any? + = render 'tickets', conference: @conference // calls for content, or program - if @conference.splashpage.include_cfp - = render 'call_for_content' + = render 'call_for_content', conference: @conference - if @conference.splashpage.include_program - = render 'schedule_splashpage' + = render 'program', conference: @conference // geo - if @conference.splashpage.include_venue && @conference.venue - = render 'venue' + = render 'venue', conference: @conference - if @conference.splashpage.include_lodgings && @conference.lodgings.any? - = render 'lodging' + = render 'lodging', conference: @conference // sponsorship - if @conference.splashpage.include_sponsors - = render 'sponsors' + = render 'sponsors', conference: @conference // footer - - if @conference.splashpage.include_social_media && @conference.contact.has_social_media? - = render 'social_media' + - if @conference.splashpage.include_social_media + - if @conference.contact.has_social_media? + = render 'social_media', conference: @conference = render 'footer' = yield :modals @@ -47,7 +49,9 @@ - content_for :script_head do :javascript var triangle_tcs = tinycolor("#{h(@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 triangle_width = document.body.clientWidth; diff --git a/spec/helpers/conference_helper_spec.rb b/spec/helpers/conference_helper_spec.rb new file mode 100644 index 00000000..2ed5517e --- /dev/null +++ b/spec/helpers/conference_helper_spec.rb @@ -0,0 +1,69 @@ +require 'spec_helper' + +describe ConferenceHelper, type: :helper do + let!(:conference) { create(:conference) } + let!(:contact) { create(:contact, conference: conference) } + + describe '#one_call_open' do + it 'is falsey if neither call is open' do + expect(one_call_open(conference)).to be_falsey + end + + it 'is truthy if call_for_papers is open' do + create( + :cfp, + program: conference.program, + cfp_type: 'events', + start_date: conference.start_date, + end_date: conference.end_date + ) + + expect(one_call_open(conference)).to be_truthy + end + + it 'is truthy if call_for_tracks is open' do + create( + :cfp, + program: conference.program, + cfp_type: 'tracks', + start_date: conference.start_date, + end_date: conference.end_date + ) + + expect(one_call_open(conference)).to be_truthy + end + + it 'is falsey if both calls are open' do + create( + :cfp, + program: conference.program, + cfp_type: 'events', + start_date: conference.start_date, + end_date: conference.end_date + ) + create( + :cfp, + program: conference.program, + cfp_type: 'tracks', + start_date: conference.start_date, + end_date: conference.end_date + ) + + expect(one_call_open(conference)).to be_falsey + end + end + + describe '#sponsorship_mailto' do + it 'constructs a mailto URL' do + expect(sponsorship_mailto(conference)).to match 'mailto:' + end + + it 'points to the conference sponsor address' do + expect(sponsorship_mailto(conference)).to match contact.sponsor_email + end + + it 'includes a conference identifier' do + expect(sponsorship_mailto(conference)).to match conference.short_title + end + end +end From 245a312c1bf376faf7b7921ffdd8b3ab4e9f1ae6 Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 28 Nov 2017 17:46:12 -0800 Subject: [PATCH 39/56] Add emphasis to call for sponsors --- app/views/conferences/_sponsors.haml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/conferences/_sponsors.haml b/app/views/conferences/_sponsors.haml index f75939f6..95856d72 100644 --- a/app/views/conferences/_sponsors.haml +++ b/app/views/conferences/_sponsors.haml @@ -27,8 +27,7 @@ - if conference.call_for_sponsors.try(:open?) .row .col-md-12 - %p.text-muted.text-center - %small - Want to sponsor #{conference.short_title}? - = link_to(sponsorship_mailto(conference)) do - Please contact us! + %h3.text-center + Want to sponsor? + = link_to(sponsorship_mailto(conference)) do + Contact us! From 5fb09f398a84aaf40615217a5605f7a4e9b73d13 Mon Sep 17 00:00:00 2001 From: James Mason Date: Wed, 29 Nov 2017 09:15:42 -0800 Subject: [PATCH 40/56] FIXUP: Reorder splashpage & align form * Per PR comments, place program above registration/tickets * Reorder splashpage admin form based on splashpage order --- app/views/admin/splashpages/_form.html.haml | 55 ++++++--- app/views/admin/splashpages/show.html.haml | 123 +++++++------------- app/views/conferences/show.html.haml | 22 ++-- 3 files changed, 90 insertions(+), 110 deletions(-) diff --git a/app/views/admin/splashpages/_form.html.haml b/app/views/admin/splashpages/_form.html.haml index 96a1a300..1d15b38c 100644 --- a/app/views/admin/splashpages/_form.html.haml +++ b/app/views/admin/splashpages/_form.html.haml @@ -2,21 +2,46 @@ .col-md-12 .page-header %h1 Splashpage -.row - .col-md-8 - = semantic_form_for(@splashpage, url: admin_conference_splashpage_path(@conference.short_title)) do |f| + += semantic_form_for(@splashpage, url: admin_conference_splashpage_path(@conference.short_title)) do |f| + .row + .col-md-12 = f.inputs name: 'Components' do - = f.input :include_tracks, label: 'Display tracks', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tracks) } - = f.input :include_program, label: 'Display program', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_program) } - = f.input :include_cfp, label: 'Display call for papers and call for tracks information on splashpage, while open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) } - = f.input :include_venue, label: 'Display venue', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_venue) } - = f.input :include_registrations, label: 'Display the registration period', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_registrations) } - = 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) } + %ul.fa-ul + %li + = f.input :include_cfp, label: 'Display call for papers and call for tracks, while open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) } + %li + = f.input :include_program, label: 'Display the program', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_program) } + + %ul.fa-ul + %li + = f.input :include_tracks, label: 'Include confirmed tracks', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tracks) } + %li + = f.input :include_booths, label: 'Include confirmed booths', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_booths) } + + %li + = f.input :include_registrations, label: 'Display the registration period', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_registrations) } + + %li + = f.input :include_tickets, label: 'Display tickets', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tickets) } + + %li + = f.input :include_venue, label: 'Display the venue', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_venue) } + + %li + = f.input :include_lodgings, label: 'Display the lodgings', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_lodgings) } + + %li + = f.input :include_sponsors, label: 'Display sponsors', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_sponsors) } + + %li + = f.input :include_social_media, label: 'Display social media links', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_social_media) } + = f.inputs name: 'Access' do - = f.input :public, label: 'Make splash page public?' + %ul.fa-ul + %li + = f.input :public, label: 'Make splash page public?' + .row + .col-md-12 %p.text-right - = f.submit 'Save Splashpage', class: 'btn btn-primary' + = f.submit 'Save Changes', class: 'btn btn-primary' diff --git a/app/views/admin/splashpages/show.html.haml b/app/views/admin/splashpages/show.html.haml index 8d799eda..ec625385 100644 --- a/app/views/admin/splashpages/show.html.haml +++ b/app/views/admin/splashpages/show.html.haml @@ -8,92 +8,47 @@ with all the information for your conference - if @splashpage .row - .col-md-8 - %dl.dl-horizontal - %dt - Include Tracks: - %dd - - if @splashpage.include_tracks - Yes - - else - No - %dt - Include Program: - %dd - - if @splashpage.include_program - Yes - - else - No - %dt - Include Calls for Content: - %dd - - if @splashpage.include_cfp - Yes - - else - No - %dt - Include Venue: - %dd - -if @splashpage.include_venue - Yes - -else - No - %dt - Include Registrations: - %dd - - if @splashpage.include_registrations - Yes - - else - No - %dt - Include Tickets: - %dd - - if @splashpage.include_tickets - Yes - - else - No - %dt - Include Lodgins - %dd - -if @splashpage.include_lodgings - Yes - -else - No - %dt - Include Sponsors: - %dd - - if @splashpage.include_sponsors - Yes - - else - No - %dt - Include Booths - %dd - - if @splashpage.include_booths - Yes - - else - No - %dt - Include Social Media: - %dd - - if @splashpage.include_social_media - Yes - - else - No - %dt - Public - %dd - - if @splashpage.public - Yes - - else - No + .col-md-12 + %ul.fa-ul + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_cfp?}" } + Display call for papers and call for tracks, while open + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_program?}" } + Display the program + %ul.fa-ul + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_program?}" } + Include confirmed tracks + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_booths?}" } + Include confirmed booths + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_registrations?}" } + Display the registration period + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_tickets?}" } + Display tickets + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_venue?}" } + Display the venue + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_lodgings?}" } + Display the lodgings + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_sponsors?}" } + Display sponsors + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_social_media?}" } + Display social media links + .row .col-md-12 - - if can? :update, @splashpage - = link_to 'Edit', edit_admin_conference_splashpage_path, class: 'btn btn-primary' - - if can? :destroy, @splashpage - = link_to 'Delete', admin_conference_splashpage_path, - method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' + - if can? :update, @splashpage + = link_to 'Edit', edit_admin_conference_splashpage_path, class: 'btn btn-primary' + - if can? :destroy, @splashpage + = link_to 'Delete', admin_conference_splashpage_path, + method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' - else .row .col-md-12.text-right diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index ac0fc854..e5da32e6 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -11,33 +11,33 @@ = @conference.title #splash - // header/description + -# header/description = render 'header', conference: @conference - // attendance/registration + -# calls for content, or program + - if @conference.splashpage.include_cfp + = render 'call_for_content', conference: @conference + - if @conference.splashpage.include_program + = render 'program', conference: @conference + + -# attendance/registration - if @conference.splashpage.include_registrations - if @conference.registration_open? = render 'registration', conference: @conference - if @conference.splashpage.include_tickets && @conference.tickets.any? = render 'tickets', conference: @conference - // calls for content, or program - - if @conference.splashpage.include_cfp - = render 'call_for_content', conference: @conference - - if @conference.splashpage.include_program - = render 'program', conference: @conference - - // geo + -# geo - if @conference.splashpage.include_venue && @conference.venue = render 'venue', conference: @conference - if @conference.splashpage.include_lodgings && @conference.lodgings.any? = render 'lodging', conference: @conference - // sponsorship + -# sponsorship - if @conference.splashpage.include_sponsors = render 'sponsors', conference: @conference - // footer + -# footer - if @conference.splashpage.include_social_media - if @conference.contact.has_social_media? = render 'social_media', conference: @conference From 754d201b0141387ed56cdfe37be2fc7beb32cfec Mon Sep 17 00:00:00 2001 From: James Mason Date: Wed, 29 Nov 2017 15:29:06 -0800 Subject: [PATCH 41/56] FIXUP fragment caching issues --- app/controllers/conferences_controller.rb | 2 +- app/views/conferences/_booths.haml | 2 - app/views/conferences/_modal_description.haml | 41 ++++++++++--------- app/views/conferences/_program.haml | 4 ++ app/views/conferences/_sponsors.haml | 6 ++- app/views/conferences/_venue.haml | 10 ++--- app/views/layouts/application.html.haml | 2 +- 7 files changed, 36 insertions(+), 31 deletions(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index e5626aa1..9bd0a4df 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -12,7 +12,6 @@ class ConferencesController < ApplicationController @conference = Conference.unscoped.eager_load( :organization, :splashpage, - :venue, :registration_period, :tickets, :confirmed_tracks, @@ -26,6 +25,7 @@ class ConferencesController < ApplicationController :sponsors, :call_for_sponsors, :contact, + venue: [:commercial], highlighted_events: [:speakers], sponsorship_levels: [:sponsors] ).order( diff --git a/app/views/conferences/_booths.haml b/app/views/conferences/_booths.haml index 87c6cac5..a6b09251 100644 --- a/app/views/conferences/_booths.haml +++ b/app/views/conferences/_booths.haml @@ -13,5 +13,3 @@ - else .caption %h3.text-center= booth.title - - content_for :modals do - = render 'modal_description', object: booth diff --git a/app/views/conferences/_modal_description.haml b/app/views/conferences/_modal_description.haml index a8d1b1d2..eb6f2b69 100644 --- a/app/views/conferences/_modal_description.haml +++ b/app/views/conferences/_modal_description.haml @@ -1,21 +1,22 @@ - content_for :modals do - .modal.fade{ id: "modal-#{object.class.name.downcase}-#{object.id}" } - .modal-dialog - .modal-content - .modal-header - %button.close{ data: { dismiss: 'modal' } } - %i.fa.fa-close - %h3.modal-title - = object.try(:title) || object.try(:name) - .modal-body - %p.logo - = link_to object.website_url || '#', target: '_blank' do - - img_classes = ['img-responsive center-block'] - - if object.is_a? Sponsor - - img_classes << ['img-sponsor', - "img-sponsor-#{object.sponsorship_level.position}"] - = image_tag get_logo(object), class: img_classes - %p.description - = object.description - .modal-footer - = link_to nil, object.website_url, target: '_blank' + - cache [object, '#modal'] do + .modal.fade{ id: "modal-#{object.class.name.downcase}-#{object.id}" } + .modal-dialog + .modal-content + .modal-header + %button.close{ data: { dismiss: 'modal' } } + %i.fa.fa-close + %h3.modal-title + = object.try(:title) || object.try(:name) + .modal-body + %p.logo + = link_to object.website_url || '#', target: '_blank' do + - img_classes = ['img-responsive center-block'] + - if object.is_a? Sponsor + - img_classes << ['img-sponsor', + "img-sponsor-#{object.sponsorship_level.position}"] + = image_tag get_logo(object), class: img_classes + %p.description + = object.description + .modal-footer + = link_to nil, object.website_url, target: '_blank' diff --git a/app/views/conferences/_program.haml b/app/views/conferences/_program.haml index 67e058c7..eba300a1 100644 --- a/app/views/conferences/_program.haml +++ b/app/views/conferences/_program.haml @@ -31,3 +31,7 @@ = link_to(conference_schedule_path(conference.short_title), class: 'btn btn-success btn-lg') do Full Schedule + +- conference.confirmed_booths.each do |booth| + - content_for :modals do + = render 'modal_description', object: booth diff --git a/app/views/conferences/_sponsors.haml b/app/views/conferences/_sponsors.haml index 95856d72..e6cda589 100644 --- a/app/views/conferences/_sponsors.haml +++ b/app/views/conferences/_sponsors.haml @@ -21,8 +21,6 @@ class: ['img-responsive', 'img-sponsor', "img-sponsor-#{sponsorship_level.position}"], title: sponsor.name - - content_for :modals do - = render 'modal_description', object: sponsor - if conference.call_for_sponsors.try(:open?) .row @@ -31,3 +29,7 @@ Want to sponsor? = link_to(sponsorship_mailto(conference)) do Contact us! + +- conference.sponsors.each do |sponsor| + - content_for :modals do + = render 'modal_description', object: sponsor diff --git a/app/views/conferences/_venue.haml b/app/views/conferences/_venue.haml index c88695ac..2225341b 100644 --- a/app/views/conferences/_venue.haml +++ b/app/views/conferences/_venue.haml @@ -2,11 +2,11 @@ %li %a.smoothscroll{ href: '#venue' } Venue -- cache [conference.venue, conference.venue.commercial, '#splash#venue'] do - %section#venue - - if conference.venue.location? - = render '/conferences/venue_map', conference: conference - - else +%section#venue + - if conference.venue.location? + = render '/conferences/venue_map', conference: conference + - else + - cache [conference.venue, conference.venue.commercial, '#splash#venue'] do .container .row .col-md-6 diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ee88a24c..aa155bcb 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -43,5 +43,5 @@ You can run, copy, distribute, study, change and improve it. The source code and the developers are on =link_to "github.", "https://github.com/openSUSE/osem" - = content_for(:script_body) + = yield :script_body = piwik_tracking_tag From fa552241632c73f93b3b589df8a806385a15ab95 Mon Sep 17 00:00:00 2001 From: James Mason Date: Thu, 21 Dec 2017 19:06:36 -0800 Subject: [PATCH 42/56] Break up the one-query-of-doom The single query was producing a tremendously large ActiveRecord allocation. While this isn't nearly as cool as one query, it's still a significant reduction in SQL trips, and now has the bonus of only loading what is actually going to be displayed. --- app/controllers/conferences_controller.rb | 60 ++++++++++++------- app/helpers/application_helper.rb | 2 +- app/helpers/conference_helper.rb | 5 +- app/models/conference.rb | 1 - app/views/admin/cfps/_events_cfp.html.haml | 2 +- app/views/admin/programs/show.html.haml | 2 +- app/views/conferences/_booths.haml | 2 +- app/views/conferences/_call_for_content.haml | 12 ++-- app/views/conferences/_call_for_papers.haml | 31 +++++----- app/views/conferences/_call_for_tracks.haml | 9 ++- app/views/conferences/_header.haml | 13 ++-- app/views/conferences/_highlights.haml | 4 +- app/views/conferences/_lodging.haml | 8 +-- app/views/conferences/_program.haml | 23 +++---- app/views/conferences/_registration.haml | 13 ++-- app/views/conferences/_social_media.haml | 22 +++---- app/views/conferences/_sponsors.haml | 31 +++++----- app/views/conferences/_tickets.haml | 4 +- app/views/conferences/_tracks.haml | 2 +- app/views/conferences/_venue.haml | 37 ++++++------ app/views/conferences/_venue_map.haml | 10 ++-- app/views/conferences/show.html.haml | 26 +++++--- .../proposals/_encouragement_text.html.haml | 2 +- spec/features/splashpage_spec.rb | 4 +- spec/features/versions_spec.rb | 12 ++-- spec/helpers/conference_helper_spec.rb | 9 ++- 26 files changed, 181 insertions(+), 165 deletions(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index 9bd0a4df..4b01ca29 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -9,34 +9,48 @@ class ConferencesController < ApplicationController end def show + # load conference with header content @conference = Conference.unscoped.eager_load( - :organization, :splashpage, - :registration_period, - :tickets, - :confirmed_tracks, - :call_for_events, - :event_types, :program, - :call_for_tracks, - :lodgings, - :call_for_booths, - :confirmed_booths, - :sponsors, - :call_for_sponsors, + :registration_period, :contact, - venue: [:commercial], - highlighted_events: [:speakers], - sponsorship_levels: [:sponsors] - ).order( - 'sponsorship_levels.position ASC', - 'sponsors.name', - 'tracks.name', - 'booths.title', - 'lodgings.name', - 'tickets.price_cents' + venue: :commercial ).find_by(conference_finder_conditions) - authorize! :show, @conference + authorize! :show, @conference # TODO: reduce the 10 queries performed here + + splashpage = @conference.splashpage + if splashpage.include_cfp + cfps = @conference.program.cfps + @call_for_events = cfps.find { |call| call.cfp_type == 'events' } + if @call_for_events.try(:open?) + @event_types = @conference.event_types.pluck(:title) + @track_names = @conference.confirmed_tracks.pluck(:name).sort + end + @call_for_tracks = cfps.find { |call| call.cfp_type == 'tracks' } + end + if splashpage.include_program + @highlights = @conference.highlighted_events.eager_load(:speakers) + if splashpage.include_tracks + @tracks = @conference.confirmed_tracks.eager_load( + :room + ).order('tracks.name') + end + if splashpage.include_booths + @booths = @conference.confirmed_booths.order('title') + end + end + if splashpage.include_registrations || splashpage.include_tickets + @tickets = @conference.tickets.order('price_cents') + end + if splashpage.include_lodgings + @lodgings = @conference.lodgings.order('name') + end + if splashpage.include_sponsors + @sponsorship_levels = @conference.sponsorship_levels.eager_load( + :sponsors + ).order('sponsorship_levels.position ASC', 'sponsors.name') + end end private diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1fd0b6db..f0311c7a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -141,7 +141,7 @@ module ApplicationHelper hint: 'The people responsible for the booth. You can only select existing users.' end - def event_types(conference) + def event_types_sentence(conference) conference.event_types.map { |et| et.title.pluralize }.to_sentence end diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb index 3909ce92..481461dc 100644 --- a/app/helpers/conference_helper.rb +++ b/app/helpers/conference_helper.rb @@ -1,8 +1,7 @@ module ConferenceHelper # Return true if only call_for_papers or call_for_tracks is open - def one_call_open(conference) - conference.call_for_events.try(:open?) ^ - conference.call_for_tracks.try(:open?) + def one_call_open(*calls) + calls.one? { |call| call.try(:open?) } end # URL for sponsorship emails diff --git a/app/models/conference.rb b/app/models/conference.rb index cb319d32..7f821cdc 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -46,7 +46,6 @@ class Conference < ApplicationRecord has_many :campaigns, dependent: :destroy has_many :commercials, as: :commercialable, dependent: :destroy has_many :subscriptions, dependent: :destroy - has_one :call_for_sponsors, -> { where(cfp_type: 'sponsors') }, through: :program, source: :cfps has_one :call_for_events, -> { where(cfp_type: 'events') }, through: :program, source: :cfps has_one :call_for_booths, -> { where(cfp_type: 'booths') }, through: :program, source: :cfps has_one :call_for_tracks, -> { where(cfp_type: 'tracks') }, through: :program, source: :cfps diff --git a/app/views/admin/cfps/_events_cfp.html.haml b/app/views/admin/cfps/_events_cfp.html.haml index f4557bb4..686f292e 100644 --- a/app/views/admin/cfps/_events_cfp.html.haml +++ b/app/views/admin/cfps/_events_cfp.html.haml @@ -21,7 +21,7 @@ %dt Event types: %dd - = event_types(@conference) + = event_types_sentence(@conference) %dt Tracks: %dd diff --git a/app/views/admin/programs/show.html.haml b/app/views/admin/programs/show.html.haml index 47e50fb6..eceb21c5 100644 --- a/app/views/admin/programs/show.html.haml +++ b/app/views/admin/programs/show.html.haml @@ -22,7 +22,7 @@ %dt Event types: %dd - = event_types(@conference) + = event_types_sentence(@conference) %dt Tracks: %dd diff --git a/app/views/conferences/_booths.haml b/app/views/conferences/_booths.haml index a6b09251..da14526e 100644 --- a/app/views/conferences/_booths.haml +++ b/app/views/conferences/_booths.haml @@ -2,7 +2,7 @@ .col-md-12 %h3.text-center Booths .row.row-centered - - conference.confirmed_booths.to_a.sort_by!(&:title).each do |booth| + - booths.each do |booth| .col-md-2.col-sm-2.col-centered.col-top.booth %a.thumbnail{ href: '#', data: { toggle: 'modal', target: "#modal-booth-#{booth.id}" } } diff --git a/app/views/conferences/_call_for_content.haml b/app/views/conferences/_call_for_content.haml index 4ad6c855..ab24f407 100644 --- a/app/views/conferences/_call_for_content.haml +++ b/app/views/conferences/_call_for_content.haml @@ -5,10 +5,12 @@ %section#call .container .row - - if one_call_open(conference) + - if one_call_open(call_for_events, call_for_tracks) .col-md-3.col-sm-3.hidden-xs   - - if conference.call_for_events.try(:open?) - = render 'call_for_papers', conference: conference + - if call_for_events.try(:open?) + = render 'call_for_papers', conference_id: conference.short_title, + call: call_for_events, event_types: event_types, tracks: tracks .col-md-2.col-sm-2   - - if conference.call_for_tracks.try(:open?) - = render 'call_for_tracks', conference: conference + - if call_for_tracks.try(:open?) + = render 'call_for_tracks', conference_id: conference.short_title, + call: call_for_tracks diff --git a/app/views/conferences/_call_for_papers.haml b/app/views/conferences/_call_for_papers.haml index 8499f4ac..3bf0f295 100644 --- a/app/views/conferences/_call_for_papers.haml +++ b/app/views/conferences/_call_for_papers.haml @@ -1,30 +1,27 @@ -- cache [conference, conference.call_for_events, conference.confirmed_tracks, - '#splash#callforpapers'] do +- cache [conference_id, call, event_types, tracks, '#splash#callforpapers'] do .col-md-5.col-sm-5.text-center %h2 Call for Papers %p.lead We are now accepting proposals for sessions! %p - - if conference.event_types.any? + - if event_types.any? You can submit proposals for %span.notranslate - = event_types(conference) + '.' - - if conference.confirmed_tracks.any? + = event_types.map(&:pluralize).to_sentence + '.' + - if tracks.any? Proposals should fit in one of the %span.notranslate - = pluralize(conference.confirmed_tracks.length, 'track') + ':' - = tracks(conference) + '.' - - if conference.call_for_events.try(:open?) - The submission period is open - %em.notranslate - = date_string(conference.call_for_events.start_date, - conference.call_for_events.end_date) + '.' - %b - You have - = pluralize(conference.call_for_events.remaining_days, 'day') - left! + = pluralize(tracks.length, 'track') + ':' + = tracks.to_sentence + '.' + The submission period is open + %em.notranslate + = date_string(call.start_date, call.end_date) + '.' + %b + You have + = pluralize(call.remaining_days, 'day') + left! %p.cta-button = link_to "Submit your proposal now", - conference_program_proposals_path(conference.short_title), + conference_program_proposals_path(conference_id), class: 'btn btn-success btn-lg text-center' diff --git a/app/views/conferences/_call_for_tracks.haml b/app/views/conferences/_call_for_tracks.haml index 59681f71..7eb80fa6 100644 --- a/app/views/conferences/_call_for_tracks.haml +++ b/app/views/conferences/_call_for_tracks.haml @@ -1,4 +1,4 @@ -- cache [conference, conference.call_for_tracks, '#splash#callfortracks'] do +- cache [conference_id, call, '#splash#callfortracks'] do .col-md-5.col-sm-5.text-center %h2 Call for Tracks @@ -8,13 +8,12 @@ Would you like to host a mini-summit, sub-conference, or hack space? The submission period for track requests is open %em - = date_string(conference.call_for_tracks.start_date, - conference.call_for_tracks.end_date) + '.' + = date_string(call.start_date, call.end_date) + '.' %b You have - = pluralize(conference.call_for_tracks.remaining_days, 'day') + = pluralize(call.remaining_days, 'day') left! %p.cta-button = link_to("Submit your request for track", - conference_program_tracks_path(conference.short_title), + conference_program_tracks_path(conference_id), class: 'btn btn-success btn-lg text-center') diff --git a/app/views/conferences/_header.haml b/app/views/conferences/_header.haml index 7a635ae7..08ad1e94 100644 --- a/app/views/conferences/_header.haml +++ b/app/views/conferences/_header.haml @@ -1,4 +1,4 @@ -- cache [conference, conference.venue, '#splash#header'] do +- cache [conference, venue, '#splash#header'] do #banner .container .row @@ -18,14 +18,13 @@ = date_string(conference.start_date, conference.end_date) - if conference.venue %span.venue.text-nowrap - - if conference.venue.website - = sanitize link_to(conference.venue.name, - conference.venue.website) + - if venue.website + = sanitize link_to(venue.name, venue.website) - else - = conference.venue.city - - if conference.venue.country_name != 'US' + = venue.city + - if venue.country_name != 'US' • - = conference.venue.country_name + = venue.country_name - unless conference.description.blank? %section#about diff --git a/app/views/conferences/_highlights.haml b/app/views/conferences/_highlights.haml index 6e610370..1949f4a2 100644 --- a/app/views/conferences/_highlights.haml +++ b/app/views/conferences/_highlights.haml @@ -5,10 +5,10 @@ .row .col-md-12 .row.row-centered - - conference.highlighted_events.each do |event| + - highlights.each do |event| - speaker = event.speakers_ordered.first .col-md-3.col-sm-3.col-centered.col-top.highlights - = link_to(conference_program_proposal_path(conference.short_title, + = link_to(conference_program_proposal_path(conference_id, event), class: 'thumbnail') do = image_tag speaker.gravatar_url(size: 300), diff --git a/app/views/conferences/_lodging.haml b/app/views/conferences/_lodging.haml index 301dd142..724e78ca 100644 --- a/app/views/conferences/_lodging.haml +++ b/app/views/conferences/_lodging.haml @@ -2,21 +2,21 @@ %li %a.smoothscroll{ href: '#lodging' } Lodging -- cache [conference.venue, conference.lodgings, '#splash#lodging'] do +- cache [venue, lodgings, '#splash#lodging'] do %section#lodging .container .row .col-md-12.text-center %h2 Where to stay - - if conference.venue + - if venue in - = conference.venue.city + = venue.city %p.lead We recommend the following accommodations for your visit. .row.row-centered - - conference.lodgings.each do |lodging| + - lodgings.each do |lodging| .col-md-4.col-sm-4.col-centered.col-top .thumbnail - if lodging.picture? diff --git a/app/views/conferences/_program.haml b/app/views/conferences/_program.haml index eba300a1..2ab2ef70 100644 --- a/app/views/conferences/_program.haml +++ b/app/views/conferences/_program.haml @@ -2,8 +2,7 @@ %li %a.smoothscroll{ href: '#program' } Program -- cache [@confererence, @conference.confirmed_tracks, - @conference.confirmed_booths,'#splash#program'] do +- cache [conference, highlights, tracks, booths, '#splash#program'] do %section#program .container .row @@ -13,16 +12,17 @@ = conference.title has the most awesome program ever! - - if conference.highlighted_events.any? - = render 'highlights', conference: conference + - unless highlights.blank? + = render 'highlights', conference_id: conference.short_title, + highlights: highlights - if conference.splashpage.include_tracks - - if conference.confirmed_tracks.any? - = render 'tracks', conference: conference + - unless tracks.blank? + = render 'tracks', tracks: tracks - if conference.splashpage.include_booths - - if conference.confirmed_booths.any? - = render 'booths', conference: conference + - unless booths.blank? + = render 'booths', booths: booths - if conference.program.try(:schedule_public?) .row @@ -32,6 +32,7 @@ class: 'btn btn-success btn-lg') do Full Schedule -- conference.confirmed_booths.each do |booth| - - content_for :modals do - = render 'modal_description', object: booth +- unless booths.blank? + - booths.each do |booth| + - content_for :modals do + = render 'modal_description', object: booth diff --git a/app/views/conferences/_registration.haml b/app/views/conferences/_registration.haml index f327344b..d789cbf2 100644 --- a/app/views/conferences/_registration.haml +++ b/app/views/conferences/_registration.haml @@ -2,8 +2,7 @@ %li %a.smoothscroll{ href: '#registration' } Registration -- cache [conference.registration_period, conference.tickets, - '#splash#registration'] do +- cache [conference, registration_period, tickets, '#splash#registration'] do %section#registration .container .row @@ -12,23 +11,23 @@ - if conference.registration_limit_exceeded? %p Sorry, the conference registration limit has exceeded - - elsif conference.tickets.empty? + - elsif tickets.empty? %p.lead Going to = conference.short_title is free of charge. %p We only ask you to register yourself before - = date_string(conference.registration_period.end_date) + = date_string(registration_period.end_date) so we can plan for the right amount of people. %p.cta-button - else %p The registration period is open - = date_string(conference.registration_period.start_date, - conference.registration_period.end_date) + = date_string(registration_period.start_date, + registration_period.end_date) - if conference.registration_open? %p.cta-button = link_to('Register Now', - new_conference_conference_registration_path(conference.short_title), + new_conference_conference_registration_path(conference_id), class: 'btn btn-lg btn-success') diff --git a/app/views/conferences/_social_media.haml b/app/views/conferences/_social_media.haml index d227c54a..32cf1b16 100644 --- a/app/views/conferences/_social_media.haml +++ b/app/views/conferences/_social_media.haml @@ -1,20 +1,20 @@ -- cache [conference.contact, '#splash#social'] do +- cache [contact, '#splash#social'] do %section#social-media .container .row .col-md-12.text-center - - unless conference.contact.facebook.blank? - = link_to "#{ conference.contact.facebook }" do + - unless contact.facebook.blank? + = link_to "#{ contact.facebook }" do %i.fa.fa-facebook-square.fa-4x - - unless conference.contact.twitter.blank? - = link_to "#{ conference.contact.twitter }" do + - unless contact.twitter.blank? + = link_to "#{ contact.twitter }" do %i.fa.fa-twitter.fa-4x - - unless conference.contact.instagram.blank? - = link_to "#{ conference.contact.instagram }" do + - unless contact.instagram.blank? + = link_to "#{ contact.instagram }" do %i.fa.fa-instagram.fa-4x - - unless conference.contact.googleplus.blank? - = link_to "#{ conference.contact.googleplus }" do + - unless contact.googleplus.blank? + = link_to "#{ contact.googleplus }" do %i.fa.fa-google-plus-square.fa-4x - - unless conference.contact.email.blank? - = mail_to "#{ conference.contact.email }" do + - unless contact.email.blank? + = mail_to "#{ contact.email }" do %i.fa.fa-envelope-o.fa-4x diff --git a/app/views/conferences/_sponsors.haml b/app/views/conferences/_sponsors.haml index e6cda589..8f4d55c6 100644 --- a/app/views/conferences/_sponsors.haml +++ b/app/views/conferences/_sponsors.haml @@ -2,11 +2,10 @@ %li %a.smoothscroll{ href: '#sponsors' } Sponsors -- cache [conference, conference.sponsors, conference.sponsorship_levels, - conference.try(:call_for_sponsors), '#splash#sponsors'] do +- cache [conference, sponsorship_levels, '#splash#sponsors'] do %section#sponsors .container - - conference.sponsorship_levels.each do |sponsorship_level| + - sponsorship_levels.each do |sponsorship_level| - if sponsorship_level.sponsors.any? .row.text-center %h3 @@ -17,19 +16,21 @@ .col-md-4.col-sm-4.col-centered.col-top %a{ href: '#', data: { toggle: 'modal', target: "#modal-sponsor-#{sponsor.id}" } } - = image_tag get_logo(sponsor), - class: ['img-responsive', 'img-sponsor', - "img-sponsor-#{sponsorship_level.position}"], - title: sponsor.name + - if sponsor.logo_file_name + = image_tag get_logo(sponsor), + class: ['img-responsive', 'img-sponsor', + "img-sponsor-#{sponsorship_level.position}"], + title: sponsor.name + - else + %h4.text-center= sponsor.name - - if conference.call_for_sponsors.try(:open?) - .row - .col-md-12 - %h3.text-center - Want to sponsor? - = link_to(sponsorship_mailto(conference)) do - Contact us! + .row + .col-md-12 + %h3.text-center + Want to sponsor? + = link_to(sponsorship_mailto(conference)) do + Contact us! -- conference.sponsors.each do |sponsor| +- sponsorship_levels.collect(&:sponsors).flatten.each do |sponsor| - content_for :modals do = render 'modal_description', object: sponsor diff --git a/app/views/conferences/_tickets.haml b/app/views/conferences/_tickets.haml index ce4ca802..0a927593 100644 --- a/app/views/conferences/_tickets.haml +++ b/app/views/conferences/_tickets.haml @@ -2,7 +2,7 @@ %li %a.smoothscroll{ href: '#tickets' } Tickets -- cache [conference, conference.tickets, '#splash#tickets'] do +- cache [conference, tickets, '#splash#tickets'] do %section#tickets .container .row @@ -11,7 +11,7 @@ Support = conference.title .row.row-centered - - conference.tickets.each do |ticket| + - tickets.each do |ticket| .col-md-3.col-sm-3.col-centered.col-top = link_to(conference_tickets_path(conference.short_title), class: 'thumbnail') do diff --git a/app/views/conferences/_tracks.haml b/app/views/conferences/_tracks.haml index 3dd8e628..7742778f 100644 --- a/app/views/conferences/_tracks.haml +++ b/app/views/conferences/_tracks.haml @@ -2,7 +2,7 @@ .col-md-12 %h3.text-center Tracks .row.row-centered - - conference.confirmed_tracks.to_a.sort_by!(&:name).each do |track| + - tracks.each do |track| .col-md-3.col-sm-3.col-centered.col-top.track .thumbnail .caption diff --git a/app/views/conferences/_venue.haml b/app/views/conferences/_venue.haml index 2225341b..fbdcde48 100644 --- a/app/views/conferences/_venue.haml +++ b/app/views/conferences/_venue.haml @@ -3,42 +3,41 @@ %a.smoothscroll{ href: '#venue' } Venue %section#venue - - if conference.venue.location? - = render '/conferences/venue_map', conference: conference + - if venue.location? + = render '/conferences/venue_map', venue: venue - else - - cache [conference.venue, conference.venue.commercial, '#splash#venue'] do + - cache [venue, commercial, '#splash#venue'] do .container .row .col-md-6 .thumbnail#venue-pic - - if commercial = conference.venue.commercial + - if commercial .flexvideo{ id: "resource-content-#{commercial.id}" } = render 'shared/media_item', commercial: commercial - - elsif conference.venue.picture? - = image_tag conference.venue.picture.url, - title: conference.venue.name, class: "img-responsive" + - elsif venue.picture? + = image_tag venue.picture.url, + title: venue.name, class: "img-responsive" - else %p.text-center %span.fa.fa-university.fa-5x .caption %h3.text-center - = conference.venue.name - - unless conference.venue.description.blank? - = markdown(conference.venue.description) + = venue.name + - unless venue.description.blank? + = markdown(venue.description) .col-md-6 %h2 - = conference.venue.city + = venue.city \/ - = conference.venue.country_name + = venue.country_name %address - = conference.venue.street + = venue.street %br - = conference.venue.postalcode + ',' - = conference.venue.city + = venue.postalcode + ',' + = venue.city %br - = conference.venue.country_name - - if conference.venue.website + = venue.country_name + - if venue.website %br - = sanitize link_to(h(conference.venue.website), - h(conference.venue.website)) + = sanitize link_to(h(venue.website), h(venue.website)) diff --git a/app/views/conferences/_venue_map.haml b/app/views/conferences/_venue_map.haml index e4e56ea3..07f387bc 100644 --- a/app/views/conferences/_venue_map.haml +++ b/app/views/conferences/_venue_map.haml @@ -1,13 +1,13 @@ #map{ style: "height: 500px;" } - content_for(:script_body) do - marker = escape_javascript(render '/conferences/venue_map_marker', - venue: conference.venue) + venue: venue) :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.latitude.to_f + 0.05}, - #{h(conference.venue.longitude)} + #{venue.latitude.to_f + 0.05}, + #{h(venue.longitude)} ], 11); // add an OpenStreetMap tile layer L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { @@ -20,8 +20,8 @@ // add a marker in the given location, attach some popup content to it // and open the popup L.marker([ - #{h conference.venue.latitude}, - #{h conference.venue.longitude} + #{h venue.latitude}, + #{h venue.longitude} ]).addTo(map) .bindPopup("#{marker}") .openPopup(); diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index e5da32e6..d43c99cf 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -12,35 +12,43 @@ #splash -# header/description - = render 'header', conference: @conference + = render 'header', conference: @conference, venue: @conference.venue -# calls for content, or program - if @conference.splashpage.include_cfp - = render 'call_for_content', conference: @conference + = render 'call_for_content', conference: @conference, + call_for_events: @call_for_events, call_for_tracks: @call_for_tracks, + event_types: @event_types, tracks: @track_names + - if @conference.splashpage.include_program - = render 'program', conference: @conference + = render 'program', conference: @conference, tracks: @tracks, + highlights: @highlights, booths: @booths -# attendance/registration - if @conference.splashpage.include_registrations - if @conference.registration_open? - = render 'registration', conference: @conference + = render 'registration', conference: @conference, + registration_period: @conference.registration_period, + tickets: @tickets, conference_id: @conference_id.short_title - if @conference.splashpage.include_tickets && @conference.tickets.any? - = render 'tickets', conference: @conference + = render 'tickets', conference: @conference, tickets: @tickets -# geo - if @conference.splashpage.include_venue && @conference.venue - = render 'venue', conference: @conference + = render 'venue', conference: @conference, venue: @conference.venue, + commercial: @conference.venue.commercial - if @conference.splashpage.include_lodgings && @conference.lodgings.any? - = render 'lodging', conference: @conference + = render 'lodging', venue: @conference.venue, lodgings: @lodgings -# sponsorship - if @conference.splashpage.include_sponsors - = render 'sponsors', conference: @conference + = render 'sponsors', conference: @conference, + sponsorship_levels: @sponsorship_levels -# footer - if @conference.splashpage.include_social_media - if @conference.contact.has_social_media? - = render 'social_media', conference: @conference + = render 'social_media', contact: @conference.contact = render 'footer' = yield :modals diff --git a/app/views/proposals/_encouragement_text.html.haml b/app/views/proposals/_encouragement_text.html.haml index 48fcd045..ad9f01ea 100644 --- a/app/views/proposals/_encouragement_text.html.haml +++ b/app/views/proposals/_encouragement_text.html.haml @@ -1,7 +1,7 @@ %p.lead - if @program.event_types.any? You can submit proposals for - = "#{event_types(@conference)}." + = "#{event_types_sentence(@conference)}." - if @program.tracks.confirmed.cfp_active.any? Proposals should fit in one of the = "#{pluralize(@program.tracks.confirmed.cfp_active.count, 'track')}:" diff --git a/spec/features/splashpage_spec.rb b/spec/features/splashpage_spec.rb index d33c6c85..006df419 100644 --- a/spec/features/splashpage_spec.rb +++ b/spec/features/splashpage_spec.rb @@ -13,7 +13,7 @@ feature Splashpage do visit admin_conference_splashpage_path(conference.short_title) click_link 'Create Splashpage' - click_button 'Save Splashpage' + click_button 'Save Changes' expect(flash).to eq('Splashpage successfully created.') expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title)) @@ -28,7 +28,7 @@ feature Splashpage do click_link 'Edit' check('Make splash page public') - click_button 'Save Splashpage' + click_button 'Save Changes' expect(flash).to eq('Splashpage successfully updated.') expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title)) diff --git a/spec/features/versions_spec.rb b/spec/features/versions_spec.rb index 1451b907..62536019 100644 --- a/spec/features/versions_spec.rb +++ b/spec/features/versions_spec.rb @@ -233,18 +233,18 @@ feature 'Version' do scenario 'display changes in splashpages', feature: true, versioning: true, js: true do visit admin_conference_splashpage_path(conference.short_title) click_link 'Create Splashpage' - click_button 'Save Splashpage' + click_button 'Save Changes' click_link 'Edit' - uncheck('Display program') - uncheck('Display call for papers and call for tracks information on splashpage, while open') - uncheck('Display venue') + uncheck('Display the program') + uncheck('Display call for papers and call for tracks, while open') + uncheck('Display the venue') uncheck('Display tickets') uncheck('Display the lodgings') uncheck('Display sponsors') - uncheck('Display social media') + uncheck('Display social media links') check('Make splash page public?') - click_button 'Save Splashpage' + click_button 'Save Changes' splashpage_id = conference.splashpage.id click_link 'Delete' diff --git a/spec/helpers/conference_helper_spec.rb b/spec/helpers/conference_helper_spec.rb index 2ed5517e..09e38e69 100644 --- a/spec/helpers/conference_helper_spec.rb +++ b/spec/helpers/conference_helper_spec.rb @@ -6,7 +6,7 @@ describe ConferenceHelper, type: :helper do describe '#one_call_open' do it 'is falsey if neither call is open' do - expect(one_call_open(conference)).to be_falsey + expect(one_call_open(*conference.program.cfps)).to be_falsey end it 'is truthy if call_for_papers is open' do @@ -17,8 +17,7 @@ describe ConferenceHelper, type: :helper do start_date: conference.start_date, end_date: conference.end_date ) - - expect(one_call_open(conference)).to be_truthy + expect(one_call_open(*conference.program.cfps)).to be_truthy end it 'is truthy if call_for_tracks is open' do @@ -30,7 +29,7 @@ describe ConferenceHelper, type: :helper do end_date: conference.end_date ) - expect(one_call_open(conference)).to be_truthy + expect(one_call_open(*conference.program.cfps)).to be_truthy end it 'is falsey if both calls are open' do @@ -49,7 +48,7 @@ describe ConferenceHelper, type: :helper do end_date: conference.end_date ) - expect(one_call_open(conference)).to be_falsey + expect(one_call_open(*conference.program.cfps)).to be_falsey end end From fe17dface63a0f883af147bb8aea5924bae51072 Mon Sep 17 00:00:00 2001 From: evris99 Date: Thu, 21 Dec 2017 18:16:09 +0200 Subject: [PATCH 43/56] remove datatable in program/cfps --- app/views/admin/cfps/index.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/cfps/index.html.haml b/app/views/admin/cfps/index.html.haml index 09c208cf..1b80f411 100644 --- a/app/views/admin/cfps/index.html.haml +++ b/app/views/admin/cfps/index.html.haml @@ -7,7 +7,7 @@ - if @program.cfps .row .col-md-12 - %table.table.table-hover.datatable#tickets + %table.table.table-hover#tickets %thead %th Type %th Start Date From b32ddc453d5fdefa3a8c9727ac9fcbb365c808ff Mon Sep 17 00:00:00 2001 From: Ismael Olea Date: Mon, 4 Dec 2017 13:25:39 +0100 Subject: [PATCH 44/56] Fix the docker persistence for uploaded pictures: #1833 #1667 --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4cc5c04c..6cd0c616 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,6 +40,10 @@ ENV DATA_DIR /data RUN install -d -m 0770 -o osem -g root $DATA_DIR VOLUME ["$DATA_DIR"] +# data persistence for uploaded files (logos, other pictures, etc) +RUN install -d -m 0755 -o osem -g osem /osem/ /osem/tmp /osem/tmp/uploads/ +VOLUME ["/osem/tmp/uploads/"] + USER osem EXPOSE 9292 From 8d17acb1a849991ab3804f44c31e3374e59615f3 Mon Sep 17 00:00:00 2001 From: Ismael Olea Date: Tue, 5 Dec 2017 15:06:03 +0100 Subject: [PATCH 45/56] Update Dockerfile Adding a needed volumen. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6cd0c616..a0be4daa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,8 +41,9 @@ RUN install -d -m 0770 -o osem -g root $DATA_DIR VOLUME ["$DATA_DIR"] # data persistence for uploaded files (logos, other pictures, etc) -RUN install -d -m 0755 -o osem -g osem /osem/ /osem/tmp /osem/tmp/uploads/ +RUN install -d -m 0755 -o osem -g osem /osem/ /osem/tmp /osem/tmp/uploads/ /osem/public/ /osem/public/system/ VOLUME ["/osem/tmp/uploads/"] +VOLUME ["/osem/public/system/"] USER osem EXPOSE 9292 From 4c1a9078fe22ebba6f2a4c31a8bbee2c9fa25170 Mon Sep 17 00:00:00 2001 From: Ismael Olea Date: Fri, 8 Dec 2017 19:54:56 +0100 Subject: [PATCH 46/56] Reviewed changes Following indications from @TheAssassin. --- Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index a0be4daa..570a7560 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,12 +38,10 @@ RUN chown -R osem.root /osem/ && \ # data directory is used to cache the secret key in a file ENV DATA_DIR /data RUN install -d -m 0770 -o osem -g root $DATA_DIR -VOLUME ["$DATA_DIR"] - # data persistence for uploaded files (logos, other pictures, etc) -RUN install -d -m 0755 -o osem -g osem /osem/ /osem/tmp /osem/tmp/uploads/ /osem/public/ /osem/public/system/ -VOLUME ["/osem/tmp/uploads/"] -VOLUME ["/osem/public/system/"] +RUN mkdir 0775 -p /osem/tmp/cache /osem/tmp/uploads/ && \ + chown -R osem.osem /osem/tmp/ +VOLUME ["$DATA_DIR"] ["/osem/tmp/uploads/"] ["/osem/public/system/"] USER osem EXPOSE 9292 From 3afe9054480b99c22e4a961aaf778b7a631eaa4f Mon Sep 17 00:00:00 2001 From: Ismael Olea Date: Fri, 22 Dec 2017 20:55:21 +0100 Subject: [PATCH 47/56] Adding suggested better syntax --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 570a7560..6cf50964 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ RUN install -d -m 0770 -o osem -g root $DATA_DIR # data persistence for uploaded files (logos, other pictures, etc) RUN mkdir 0775 -p /osem/tmp/cache /osem/tmp/uploads/ && \ chown -R osem.osem /osem/tmp/ -VOLUME ["$DATA_DIR"] ["/osem/tmp/uploads/"] ["/osem/public/system/"] +VOLUME ["$DATA_DIR", "/osem/tmp/uploads/", "/osem/public/system/"] USER osem EXPOSE 9292 From 0091d87dc977aee3678ae5d098f18cb99a948173 Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Fri, 22 Dec 2017 13:27:44 +0530 Subject: [PATCH 48/56] Fixed growing of doughnut charts on scrolling. Charts were growing on many pages due to spaces in id. Fixes #1903 --- app/views/admin/conferences/_doughnut_chart.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/conferences/_doughnut_chart.html.haml b/app/views/admin/conferences/_doughnut_chart.html.haml index f4a8f0ba..6ad75cef 100644 --- a/app/views/admin/conferences/_doughnut_chart.html.haml +++ b/app/views/admin/conferences/_doughnut_chart.html.haml @@ -1,6 +1,6 @@ .text-center %h4 #{title} - %canvas.doughnut_chart{ id: "dough_#{title}", 'data-chart' => data.to_json } + %canvas.doughnut_chart{ id: "dough_#{title.parameterize.underscore}", 'data-chart' => data.to_json } - if data - data.each do |key, value| %span{ 'style' => "border-bottom: 3px solid #{value['color']}" } #{key}: #{value['value']} @@ -8,7 +8,7 @@ :javascript $(document).ready( function(){ - var d = $("#dough_#{title}"); + var d = $("#dough_#{title.parameterize.underscore}"); var dt = d.get(0).getContext('2d'); $(window).resize( respondCanvas ); From 96b450224e90ad18973a159cced1e0938108e733 Mon Sep 17 00:00:00 2001 From: AnkushMalik Date: Thu, 4 Jan 2018 00:37:16 +0530 Subject: [PATCH 49/56] Resolve Error on viewing conference#show Fix a typo in conference#show view Closes #1920 --- app/views/conferences/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index d43c99cf..ea99b419 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -29,7 +29,7 @@ - if @conference.registration_open? = render 'registration', conference: @conference, registration_period: @conference.registration_period, - tickets: @tickets, conference_id: @conference_id.short_title + tickets: @tickets, conference_id: @conference.short_title - if @conference.splashpage.include_tickets && @conference.tickets.any? = render 'tickets', conference: @conference, tickets: @tickets From 304ab01874fc73e7fadd523c529f3e26e35f08a6 Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Sat, 23 Dec 2017 14:00:34 +0530 Subject: [PATCH 50/56] Fixed error in booths#show when there is no logo. Added check for logo picture in booths#show Fixed #1916 --- app/views/admin/booths/show.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/admin/booths/show.html.haml b/app/views/admin/booths/show.html.haml index 6ed823e5..02d44609 100644 --- a/app/views/admin/booths/show.html.haml +++ b/app/views/admin/booths/show.html.haml @@ -1,7 +1,8 @@ .row .col-md-12 %h3 - = image_tag(@booth.picture.thumb.url, size: '20%', alt: '') + - if @booth.logo_link + = image_tag( @booth.picture.thumb.url, size: '20%', alt: '') = @booth.title .btn-group.pull-right = link_to 'Edit', edit_admin_conference_booth_path(@conference.short_title, @booth), class: 'btn btn-mini btn-primary' From ada178d62c7b5d96000b81173cdebe4d7b65da48 Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Tue, 26 Dec 2017 13:57:32 +0530 Subject: [PATCH 51/56] Added check for image_tag occurences. Checking for presence of a image before using image_tag Fixes #1909 --- app/views/admin/sponsors/index.html.haml | 3 ++- app/views/conferences/_modal_description.haml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/admin/sponsors/index.html.haml b/app/views/admin/sponsors/index.html.haml index 1c8f1077..d2fc512c 100644 --- a/app/views/admin/sponsors/index.html.haml +++ b/app/views/admin/sponsors/index.html.haml @@ -19,7 +19,8 @@ - @conference.sponsors.each do |sponsor| %tr %td - = image_tag(sponsor.picture.thumb.url, width: '20%') + - if sponsor.picture? + = image_tag(sponsor.picture.thumb.url, width: '20%') %td = sponsor.name %td diff --git a/app/views/conferences/_modal_description.haml b/app/views/conferences/_modal_description.haml index eb6f2b69..7fe4173b 100644 --- a/app/views/conferences/_modal_description.haml +++ b/app/views/conferences/_modal_description.haml @@ -15,7 +15,8 @@ - if object.is_a? Sponsor - img_classes << ['img-sponsor', "img-sponsor-#{object.sponsorship_level.position}"] - = image_tag get_logo(object), class: img_classes + - if object.picture? + = image_tag get_logo(object), class: img_classes %p.description = object.description .modal-footer From e5948698db2581e1ac15457cf60790c27c8f4727 Mon Sep 17 00:00:00 2001 From: Thaleia Tagaraki Date: Mon, 11 Dec 2017 02:01:58 +0200 Subject: [PATCH 52/56] Added autofocus in a number of forms, plus correction of a few spelling mistakes folding code into existing hash in commercials/index --- app/views/admin/campaigns/_form.html.haml | 2 +- app/views/admin/commercials/index.html.haml | 2 +- app/views/admin/contacts/edit.html.haml | 2 +- app/views/admin/difficulty_levels/_form.html.haml | 2 +- app/views/admin/event_types/_form.html.haml | 2 +- app/views/admin/programs/_form.html.haml | 2 +- app/views/admin/reports/_all_events.html.haml | 2 +- app/views/admin/resources/_form.html.haml | 2 +- app/views/admin/roles/_form.html.haml | 2 +- app/views/admin/roles/show.html.haml | 2 +- app/views/admin/rooms/_form.html.haml | 2 +- app/views/admin/sponsors/_form.html.haml | 2 +- app/views/admin/sponsorship_levels/_form.html.haml | 2 +- app/views/admin/targets/_form.html.haml | 2 +- app/views/admin/tracks/_form.html.haml | 2 +- app/views/booths/_form.html.haml | 2 +- app/views/proposals/_proposal_form.html.haml | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/views/admin/campaigns/_form.html.haml b/app/views/admin/campaigns/_form.html.haml index 6b826300..71aa075e 100644 --- a/app/views/admin/campaigns/_form.html.haml +++ b/app/views/admin/campaigns/_form.html.haml @@ -11,7 +11,7 @@ .col-md-8 = semantic_form_for(@campaign, url: (@campaign.new_record? ? admin_conference_campaigns_path : admin_conference_campaign_path(@conference.short_title, @campaign))) do |f| = f.inputs do - = f.input :name + = f.input :name, input_html: { autofocus: true } = f.inputs name: 'UTM Parameters' do = f.input :utm_campaign, label: 'Campaign', hint: 'Groups all of the content from one campaign. E.g. 20percentpromocode' = f.input :utm_source, label: 'Source', hint: 'Which website is sending you traffic. E.g. Facebook, google+, blog' diff --git a/app/views/admin/commercials/index.html.haml b/app/views/admin/commercials/index.html.haml index 32779e2c..095ddad2 100644 --- a/app/views/admin/commercials/index.html.haml +++ b/app/views/admin/commercials/index.html.haml @@ -14,7 +14,7 @@ .row .col-md-6 = semantic_form_for(@commercial, url: admin_conference_commercials_path(conference_id: @conference.short_title)) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { required: 'required' }, + = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', autofocus: true }, hint: 'Just paste the url of your video/photo provider. YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } %hr diff --git a/app/views/admin/contacts/edit.html.haml b/app/views/admin/contacts/edit.html.haml index 872977b0..db06dd7e 100644 --- a/app/views/admin/contacts/edit.html.haml +++ b/app/views/admin/contacts/edit.html.haml @@ -8,7 +8,7 @@ .col-md-8 = semantic_form_for(@contact, url: admin_conference_contact_path(@conference.short_title), html: {multipart: true}) do |f| = f.inputs name: 'Mail' do - = f.input :email, hint: 'Contact email address for your conference. Will be used as reply-to address in emails sent out by the system.' + = f.input :email, input_html: { autofocus: true }, hint: 'Contact email address for your conference. Will be used as reply-to address in emails sent out by the system.' = f.input :sponsor_email, hint: 'This will appear in the sponsor segment of the splash for the sponsors to contact to the organizers' = f.inputs name: 'Social Media' do = f.input :social_tag, hint: "The hashtag you'll use on Twitter and Google+. Don't include the '#' sign!'" diff --git a/app/views/admin/difficulty_levels/_form.html.haml b/app/views/admin/difficulty_levels/_form.html.haml index fa47a88b..f28ab7e3 100644 --- a/app/views/admin/difficulty_levels/_form.html.haml +++ b/app/views/admin/difficulty_levels/_form.html.haml @@ -9,7 +9,7 @@ .row .col-md-8 = semantic_form_for(@difficulty_level, url: (@difficulty_level.new_record? ? admin_conference_program_difficulty_levels_path : admin_conference_program_difficulty_level_path(@conference.short_title, @difficulty_level))) do |f| - = f.input :title, required: true + = f.input :title, input_html: { autofocus: true }, required: true = f.input :description, input_html: {rows: 3, class: 'span6'} = f.input :color, input_html: {size: 6, type: 'color'} %p.text-right diff --git a/app/views/admin/event_types/_form.html.haml b/app/views/admin/event_types/_form.html.haml index 51a0ad99..29fac398 100644 --- a/app/views/admin/event_types/_form.html.haml +++ b/app/views/admin/event_types/_form.html.haml @@ -9,7 +9,7 @@ .row .col-md-12 = semantic_form_for(@event_type, url: (@event_type.new_record? ? admin_conference_program_event_types_path : admin_conference_program_event_type_path(@conference.short_title, @event_type))) do |f| - = f.input :title + = f.input :title, input_html: { autofocus: true } = f.input :length, input_html: {size: 3, type: 'number', step: @event_type.program.schedule_interval, min: @event_type.program.schedule_interval} = f.input :description = f.input :minimum_abstract_length, input_html: {size: 3} diff --git a/app/views/admin/programs/_form.html.haml b/app/views/admin/programs/_form.html.haml index 035093f0..9b42e2b0 100644 --- a/app/views/admin/programs/_form.html.haml +++ b/app/views/admin/programs/_form.html.haml @@ -9,7 +9,7 @@ = f.input :schedule_fluid, label: 'Allow submitters to change their event after it is scheduled' = f.input :rating, hint: 'Enter the number of different rating levels you want to have for voting on proposals. Enter 0 if you do not want to vote on proposals.' = f.input :languages, hint: "Enter the languages allowed for events as values of #{link_to('ISO 639-1', 'http://www.loc.gov/standards/iso639-2/php/code_list.php', target: "_blank")} language codes separated with commas. The first language would be the default language. Leave it blank if you do not want to specify languages.".html_safe - = f.input :schedule_interval, hint: "It is the minimal time interval of your schedule. The value should be 5, 6, 10, 12, 15, 20, 30 or 60. Warning! Some events could be unscheduled when changing this value." + = f.input :schedule_interval, input_html: { autofocus: true }, hint: "It is the minimal time interval of your schedule. The value should be 5, 6, 10, 12, 15, 20, 30 or 60. Warning! Some events could be unscheduled when changing this value." = f.input :blind_voting, hint: 'Enable this feature if you do not want to show voting results and voters prior to user submitting a vote. For the feature to work you need to set the voting dates below as well' = f.input :voting_start_date, as: :string, input_html: { id: 'datetimepicker-voting_start_date', readonly: true, value: (f.object.voting_start_date.to_formatted_s(:db_without_seconds) unless f.object.voting_start_date.nil?) } = f.input :voting_end_date, as: :string, input_html: { id: 'datetimepicker-voting_start_date', readonly: true, value: (f.object.voting_end_date.to_formatted_s(:db_without_seconds) unless f.object.voting_end_date.nil?) } diff --git a/app/views/admin/reports/_all_events.html.haml b/app/views/admin/reports/_all_events.html.haml index 98f405ea..cca8968a 100644 --- a/app/views/admin/reports/_all_events.html.haml +++ b/app/views/admin/reports/_all_events.html.haml @@ -5,7 +5,7 @@ All Events = "(#{@events.length})" %p.text-muted - All submissions and the information that they are mssing + All submissions and the information that they are missing .col-md-12 %table.table.table-striped.table-bordered.table-hover.datatable diff --git a/app/views/admin/resources/_form.html.haml b/app/views/admin/resources/_form.html.haml index ef999104..ce5f25b0 100644 --- a/app/views/admin/resources/_form.html.haml +++ b/app/views/admin/resources/_form.html.haml @@ -8,7 +8,7 @@ .row .col-md-8 = semantic_form_for(@resource, :url => (@resource.new_record? ? admin_conference_resources_path : admin_conference_resource_path(@conference.short_title, @resource))) do |f| - = f.input :name + = f.input :name, input_html: { autofocus: true } = f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } } = f.input :used = f.input :quantity diff --git a/app/views/admin/roles/_form.html.haml b/app/views/admin/roles/_form.html.haml index 2204ef89..860f43a9 100644 --- a/app/views/admin/roles/_form.html.haml +++ b/app/views/admin/roles/_form.html.haml @@ -10,6 +10,6 @@ = semantic_form_for @role, url: @url do |f| .row .col-md-5 - = f.input :description + = f.input :description, input_html: { autofocus: true } = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/roles/show.html.haml b/app/views/admin/roles/show.html.haml index b264bc5f..b8796121 100644 --- a/app/views/admin/roles/show.html.haml +++ b/app/views/admin/roles/show.html.haml @@ -24,7 +24,7 @@ = u.label 'Add user by email: ' .input-group - = u.input :email, label: false, placeholder: "User's email" + = u.input :email, input_html: { autofocus: true }, label: false, placeholder: "User's email" .input-group-btn = u.submit 'Add', id: 'user-add', class: 'btn btn-primary' diff --git a/app/views/admin/rooms/_form.html.haml b/app/views/admin/rooms/_form.html.haml index eec272cd..90de99e0 100644 --- a/app/views/admin/rooms/_form.html.haml +++ b/app/views/admin/rooms/_form.html.haml @@ -9,7 +9,7 @@ .row .col-md-8 = semantic_form_for(@room, url: (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f| - = f.input :name, input_html: { autofocus: true} + = f.input :name, input_html: { autofocus: true } = f.input :size, label: 'Capacity', input_html: {size: 5} %p.text-right = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/sponsors/_form.html.haml b/app/views/admin/sponsors/_form.html.haml index ba24f9f3..c465fc48 100644 --- a/app/views/admin/sponsors/_form.html.haml +++ b/app/views/admin/sponsors/_form.html.haml @@ -9,7 +9,7 @@ .row .col-md-8 = semantic_form_for(@sponsor, url: (@sponsor.new_record? ? admin_conference_sponsors_path : admin_conference_sponsor_path(@conference.short_title, @sponsor))) do |f| - = f.input :name + = f.input :name, input_html: { autofocus: true } = f.input :description = image_tag f.object.picture.thumb.url if f.object.picture? = f.input :picture diff --git a/app/views/admin/sponsorship_levels/_form.html.haml b/app/views/admin/sponsorship_levels/_form.html.haml index 60848928..ae819a71 100644 --- a/app/views/admin/sponsorship_levels/_form.html.haml +++ b/app/views/admin/sponsorship_levels/_form.html.haml @@ -9,6 +9,6 @@ .row .col-md-8 = semantic_form_for(@sponsorship_level, url: (@sponsorship_level.new_record? ? admin_conference_sponsorship_levels_path : admin_conference_sponsorship_level_path(@conference.short_title, @sponsorship_level))) do |f| - = f.input :title + = f.input :title, input_html: { autofocus: true } %p.text-right = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/targets/_form.html.haml b/app/views/admin/targets/_form.html.haml index 1e81989b..df22922e 100644 --- a/app/views/admin/targets/_form.html.haml +++ b/app/views/admin/targets/_form.html.haml @@ -9,7 +9,7 @@ .col-md-8 = semantic_form_for(@target, url: (@target.new_record? ? admin_conference_targets_path : admin_conference_target_path(@conference.short_title, @target))) do |f| = f.input :due_date, as: :string, input_html: { class: 'target-due-date-datepicker'}, label: 'Until when do you want to have ' - = f.input :target_count, label: 'this amount of ' + = f.input :target_count, input_html: { autofocus: true }, label: 'this amount of ' = f.input :unit, as: :select, label: 'Unit', class: 'form-control', collection: Target.units.values, include_blank: false %p.text-right = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/tracks/_form.html.haml b/app/views/admin/tracks/_form.html.haml index a621e1a4..36ff5734 100644 --- a/app/views/admin/tracks/_form.html.haml +++ b/app/views/admin/tracks/_form.html.haml @@ -9,7 +9,7 @@ .row .col-md-12 = semantic_form_for(@track, url: (@track.new_record? ? admin_conference_program_tracks_path(@conference.short_title) : admin_conference_program_track_path(@conference.short_title, @track))) do |f| - = f.input :name + = f.input :name, input_html: { autofocus: true } = f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' } = f.input :color, input_html: {size: 6, type: 'color'}, required: true = f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly', required: @track.self_organized_and_accepted_or_confirmed? } diff --git a/app/views/booths/_form.html.haml b/app/views/booths/_form.html.haml index 55a51432..4f5b6018 100644 --- a/app/views/booths/_form.html.haml +++ b/app/views/booths/_form.html.haml @@ -2,7 +2,7 @@ .row .col-md-8 = semantic_form_for(@booth, url: @url, html: { multipart: true }) do |f| - = f.input :title, as: :string, autofocus: true, required: true + = f.input :title, as: :string, input_html: { autofocus: true }, required: true = f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true, hint: 'This field becomes public upon request acceptance' = f.input :reasoning, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true, diff --git a/app/views/proposals/_proposal_form.html.haml b/app/views/proposals/_proposal_form.html.haml index 4b66240c..1b642d94 100644 --- a/app/views/proposals/_proposal_form.html.haml +++ b/app/views/proposals/_proposal_form.html.haml @@ -1,6 +1,6 @@ = semantic_form_for(@event, url: @url) do |f| = f.inputs name: 'Proposal Information' do - = f.input :title, as: :string, required: true + = f.input :title, as: :string, input_html: { autofocus: true }, required: true = f.input :subtitle, as: :string From 979377f2dfc8d95aa5fd3e575f34607e88bff905 Mon Sep 17 00:00:00 2001 From: Christina Anagnostou Date: Sat, 16 Dec 2017 16:30:11 +0200 Subject: [PATCH 53/56] Add unregistered speakers scope to program And use it in Conference#registration_limit_exceeded? Also change self.registered(conference) to registered(conference) to fix failures in linters --- app/models/conference.rb | 2 +- app/models/program.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/conference.rb b/app/models/conference.rb index 7f821cdc..9adac888 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -719,7 +719,7 @@ class Conference < ApplicationRecord # * +True+ -> If the registration limit has been reached or exceeded # * +False+ -> If the registration limit hasn't been exceeded def registration_limit_exceeded? - registration_limit > 0 && registrations.count + program.speakers.confirmed.count - program.speakers.confirmed.registered(program.conference).count >= registration_limit + registration_limit > 0 && registrations.count + program.speakers.confirmed.unregistered(program.conference).count >= registration_limit end # Returns an hexadecimal color given a collection. The returned color changed diff --git a/app/models/program.rb b/app/models/program.rb index dab2f2b6..14554786 100644 --- a/app/models/program.rb +++ b/app/models/program.rb @@ -51,6 +51,10 @@ class Program < ApplicationRecord def registered(conference) joins(:registrations).where('registrations.conference_id = ?', conference.id) end + + def unregistered(conference) + self - registered(conference) + end end accepts_nested_attributes_for :event_types, allow_destroy: true From e1e0bdb4fc732928eb8da0d40394d68e6fc2bd71 Mon Sep 17 00:00:00 2001 From: Jan-Frederik Rieckers Date: Fri, 1 Dec 2017 20:40:46 +0100 Subject: [PATCH 54/56] Add possibility to link to mastodon --- app/assets/fonts/mastodon.eot | Bin 0 -> 5796 bytes app/assets/fonts/mastodon.otf | Bin 0 -> 4068 bytes app/assets/fonts/mastodon.svg | 14 ++++++ app/assets/fonts/mastodon.ttf | Bin 0 -> 5628 bytes app/assets/fonts/mastodon.woff | Bin 0 -> 3204 bytes app/assets/stylesheets/application.css | 1 + app/assets/stylesheets/mastodon.css.scss | 45 ++++++++++++++++++ app/controllers/admin/contacts_controller.rb | 2 +- app/models/contact.rb | 4 +- app/views/admin/contacts/edit.html.haml | 1 + app/views/conferences/_social_media.html.haml | 21 ++++++++ .../20171201163628_add_mastodon_to_contact.rb | 5 ++ db/schema.rb | 3 +- 13 files changed, 92 insertions(+), 4 deletions(-) create mode 100755 app/assets/fonts/mastodon.eot create mode 100755 app/assets/fonts/mastodon.otf create mode 100755 app/assets/fonts/mastodon.svg create mode 100755 app/assets/fonts/mastodon.ttf create mode 100755 app/assets/fonts/mastodon.woff create mode 100755 app/assets/stylesheets/mastodon.css.scss create mode 100644 app/views/conferences/_social_media.html.haml create mode 100644 db/migrate/20171201163628_add_mastodon_to_contact.rb diff --git a/app/assets/fonts/mastodon.eot b/app/assets/fonts/mastodon.eot new file mode 100755 index 0000000000000000000000000000000000000000..59cd79abcb858d809fcb753eb4c4e1bffbd75b08 GIT binary patch literal 5796 zcmd^COKe-m6}|HwKN6{*W$P0$j)#7dY>AK5|6@m%8B&yN%Z{m!71Bv+K2y}kkwjIZ zQ#&b&qCgXabqhD^1}KUaXm>+71>B&EELyZF8lao(ilB=I@S@umD4Ik)_mR}kasmY1 z^-=H5nS0O7+`0G8M?Y^Q`mBLSkVgDy>-;iW-`x3@y@aT7hl@l17??WCOfqn=S>P%Pf=&6f$Kw?|x(yP|`z34xFh59e?ekc8UPP#t+;$K9Se}`T!tS_$S zfBYaxdnyZV%55{PTN&*uuGvX*R0jdhwqtHsQ(2X z|7bnCnLCrb9>(}Th5pR?MrQrf7XrT}YRIAfmOXb5oHI(=*!bmHs#&peYt%xp-hS9O zd$CwqUbLtJQq~CQSSuhAWpPqlZ6V@-|4-_YQB(d2gVk2U-o8t5MybCp*JZ&htuWXU~gm76F@H@219q-c4OcRoj7C1z|r9Ihk94f zSGSkX$3Oe@8AOPRC8G2gQNo^WuO(KXjlIuNk&iF0w7rkcn(}Kac<*PHPPgoRj8|nN zwd1fOTJ!Q*!%sbZveVZ9>cxI}mmVl#jofsugmuWrO4tE>xrCkMrP&g8L4KozJrux! zTkO+IN9i5jeI1n;=NA2N9r9oaJAluXu#+0al@fMAo-Sbz&56wt z_ENj}Fq&PzyRp2ul#{2U9kRE(XGq?>E3*(SuURY7x}96fZfwf1T*$8FGAk?DP&&K1 zYHjAS^VzlO%;N18YolB(mvfno&E@Qx>2=9ZIz_)1NKVzgLSviJ`Hxr_DT-Yv($y()8>b) z;)dCC~AytVT@=h5>&!eGPMv? znkna{`XH_x?bo+X3r{qbj!nOu@Ed+#J|R^+p75)1(kIn0qv2#y7K$WmUY&-hRFkTk z_1(<;AfAvgB5z6Mi6>H!NY;564Kf-``BKSb(x*fqnKTr|6PaW(sB}}tq;j-bFvuB= zCzR8OD3=j|`AH>GLFF(F*d^x+&YKa*n&RO6g+7*6dZ!=qsLabe`Yv=k+c2%EL@MsH zrjrRH32k^L0hNy@RT?>{oThR|16v54?HU)VM#O-NjfkbRn+r;$(Z6zb29?{CY@|1u ze&nE=puo&M{C-0yr(u@@152~o^AC1ZKR;y~D*A|HEG zNgs?XTdDLm!x}3N;eAST)rwYVyfd}EjjA|jjL4SPqsJ0{pW#n-`h%+4ENEIx&0AwZ zRbyfTQmU%xC7u_65lO0Qu1%v>japFEqMJI~B@!M;!)#R(P04&psv0;gsOrqg*+juH zKbCA&)fwYXP#rNRrxKGhMWN3R`B7V5Zx*OFdM#0?twsE-h^h^6k|K2@g)073?`WI338vcNz7yd_D`e`#C@T9N&pK)M-8|*s%Uge z2w`W#QIiU!#by(#)`-ZM@**ic7&sM?DGdMXx;lY>>mreSs!;C=sEvT{B;0fib2}Oc zss^(lxNL-w$AfrKGk`e6u{Ct(Pe1`Oe{6^3xx21B@Phap^^f+1X}& z`+|dJp;R55Q~^_U22>}Oi-}B~KuR6DUJPs4;JxZg8OWEQ3hu-}G%B-GiH2_5%b~qq z*{|v{<$!HxH#j2paHv@K{RHA77! zLDlzFRAg8h^nQeb8rx(@PVmZv3oqvL6UGE~f&}(#?0HzOeL^%G!}tT(LK>0%__Hah zG8)L_Lxz+idGs~7tCpc+AIgC~!ICP)i#a@%c&JHT`W|ZSdP_3G8(ampN{ojQjd3h3 zL~;K*!J-y{;!dtbQ}c$>qt-n37%gh~fKy2<%!6$#n1o%|7`KLf21XdiyinMqpua-~ zfg!vTI3LHP2J*-uPL@2D;}ZiTEFl%Z_+i^!oPcHTa&j416(KB=qKz+Lv%m(uld0wTeswBN z9F`bgC;QlMyswNH!#@9>c>9wj8zbzDvQwixe?NPkO)Sl0XUb!kazk-(;wZ;DJQ`9x zSc|cz$j7nQiepDrFE|sX>PK;by%vLCcrnd;0A^);^8)D;^sb=5{pT{G3$9cq>gMVi literal 0 HcmV?d00001 diff --git a/app/assets/fonts/mastodon.otf b/app/assets/fonts/mastodon.otf new file mode 100755 index 0000000000000000000000000000000000000000..2d415249aba8713392bcbc0b37aca624f5f63afa GIT binary patch literal 4068 zcmd^CeT-Dq6+ds@eC;m#A?vb87I-U^!kX^F#@5u>2F2ZND+WT}eNq3>ad-BM`B-NL zgo0rWR!CNYxYlN48(SpS+!<IEC+qBJDnJ!>SI453f~6Zb^XaiPtDre z%P=PMztj&!Y=NyHpTNDeKV8@oo1|v=dl~)8bYja8+3O)%^U*{ziF9)5ldtYWA2C7` zL)muSr0~mKilDql3v9-6>Uh^SU*%Q#v`2Ke#p8ss-LHmfk0o^!-M2ib^>w%FPe*8LPg{BMQC>wW&ydXrXJunJK`tj=?-@9pTJ)e|&fnOL^~ zgJexG``280{Y>wRlnP`EIG+mS5XI>CfowznULc1lj@Z7Z2vu220yzr(wSinoS6KT4 zxr*wokFXjmT!GM7cOY9-NBaXgL^X6ckZtJ4133)&cpyh;o>djdQL3}r0=ber>l=Yw zMa!(`X$@s*h_+IW2B?qvsXz`bhjs;??WmzubQPrAVd22iw;G@fC6EUP?Iz6VHzRrU zSL5zQF9U577AeTB)QvVxv?e>WH8;@LUvQSMS>d#=Ty>Rm`&K6l)j%eZauS;g{n=dJ zS?%;@GlgU-m2K_LVpoKi#lyCF)9MlDR}7*(1ryZ|-X^6ndTBTsG}=25EAJa@oOTcLBz- ze+Brsn%eODmpjp4C=6ZQ)^={5eHIBvnu2P)Mk>Yh!$6J00zdR8EM~OCJl_f|$%@V< z3~c{Dukr~~X_ha!JLj?}j0{><#hDT|r^A)g3u$_hHN7}A?by=|;rr%T-o5HE=A>BiQts2qYk=}R4Ut-mHXC2s(@0xD6*Ad zm7f4_?Xq^0EwMuOFDt5RPIXP~ZP>@;Xw4MXrJpd_%4KR(9#cp^&eSZDrAt3Xk?0cB zQmx}ZkBu-b*QI-zKBwHf5AI}Ih*^9>rY?XLAJ?TvcQDnfo9<$|M7i6TYK?`ss1yrh zTcO+?qw(#dk%5PqUr_FMnV;6BQRd%@T})>DTDg0>OzimXXcsg4N^h4KY36BhhDke_ z|G>P1`8B1s#kcQ_?11KkQp_KjaJtC+p#TB4$M0hPn=ZlleHlBhbzW>e=698gX>aS& z-2?YBzoJVc%zsjDJQ_Y$fqSX7AJ{ByqCq1CAzl-c}VL! z_cFf;&&=;>{g9+bV@t#@&6U+miroU4i!e-=i|({|iHc5ALzT)K8H+#m?FiF6iD?WQ zwcf=vUyME$^UFoT$idxyY57hT3;xrRq-I$%>EaUx)uWP*VUpB%Pf3Alzh(M-OX(p~ zeNtWszC@7LiHC*5^axX<_-RxMscV!nZWN=M7GG&f-5;J=KJ`EYs`*M7@!!Qsi(r38 zraQWn#xhX_NX3iF9brC-wmZnT*zilb6u;xPJAR5yct_T^Lb=^cm&(vl24o00ULu|3BrfE`htxD0dWPdxp2nhXfqXjSF!18Rda;FDUhIxoene z_$%o{@qRiE-)uOHtji_}tx*xEG%!SYd%hf0vf*!)IDb|b$2!b@{1bnfR_fv)(^qiR zFs+x(J|>%A<}%aQq#HH`t=v7R%5(YrLsQF-oaOPZi{Wvy%wY)z4oh8n;PG3^3wXTs zKjAPo?hJpK;yB;`s~i^gmuB%8Zw@JBaCx@0Y?#33rBW`RiO-+Jr*05F*UJ{3Y(b1V zNes$mtlWMuOb^J(uTcc=>mpic?lFwSdjY&ed$I*}@qr<5*$}RxM-DktXFCT2M;g+iKsEtn8HW3tov+Z24Lbtj!*5IcNRQy5rB6McxlVv<;CP9D}(n8 zcxh$X=L3(71mOLQ_&EG!%m(lI;6ajezynTzyDUY=<G1iZNGG+VPuZ{*OPyGHMr$#SUxr7f3dXq0>@J>^I!1DA6v(y TgYRDX);3T1vc=s@ONjmf)Ll4R literal 0 HcmV?d00001 diff --git a/app/assets/fonts/mastodon.svg b/app/assets/fonts/mastodon.svg new file mode 100755 index 00000000..8ea5bf6e --- /dev/null +++ b/app/assets/fonts/mastodon.svg @@ -0,0 +1,14 @@ + + + +Copyright (C) 2017 by original authors @ fontello.com + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/fonts/mastodon.ttf b/app/assets/fonts/mastodon.ttf new file mode 100755 index 0000000000000000000000000000000000000000..60c8ad301a75b01a6e6e32dca987434abea9989f GIT binary patch literal 5628 zcmd^CTWlN06}_{|mq@)VTaSpbJ@iVlB`&G=!;UO7q$t^z9a9f0q?6QKlhnhJL{(x^ zJ1L5wKvRQti!|R2P!uT8{te|6aD#s2qeYvd0s51_BIrj0_@loqP_&79?vj)xKN2A5 zUzggwXYM^SbLZYWvnvur)Ie{MPMg#7SEKR=oo_(%AKVL9=6eSwPF}c0Bob&ZX4b9E zJF&n26765${!Zrgf^>cI#XpH^{sy~T+FV{Q{`j2~k=H@w+g!G`H=%EY{V$N7<+a;O z@17s{Es=f-ciT$N%GO`5`xB8X0{h4c6z*|-5pB##9V_dFTfX~1AbS+{O&(r&GWwnAHOSnIiu-ZyK}{xgyG@n(Lza5{A@g86?6`{~WC+~#M`2Y*A< zTtNG6;@|Awg}kRDxeYMs%rHI;vI5g z{x>wtM0d+l{FV9zJk`jlL;Hj)u@uizWsM~n-9 zCS9*RPeN!((zH75!g9{K{?fJN;==swmCKjTjCKc4`kbx7&U)d-pX+4T$*x{;q_w5| z8yz_(THP-Gv4wx5!$YGZ{5vOD41#%FROm+q6Au}~L&k}tqACud!{ESi!Ozwf{hoVz zc1}D$HPKMp+SGQasbMIUSkjjg zslkS(Lv2m1wGG1Id~aoPW@Tn_r8^Y6(%s(PeI*v^{F!Qez+KXQUv-p%O0vvV>}FH?>#M=oA~KaZq^97u>*uW@Tm zk4xj+JeG-UCXGzIxHvca!eu)T-v4bLI*+(cbPbIRw6s13^b&F~db{&s4*cQcr|ld# zn*D+B!20c%M|ztN>B7!IE9W4I9OPz``*ZO5ce~GY}*|SGG_WZ9})=<97{TP4wyBSi@+S$K_LcxPmou z)7c8vp`WZ^2k@l|c9M@4D%b`6^$PY*8U1v`MxR6}uYXkDxGnQg zt!`Lr(t541lHb~v5xJD#DCE}G^5IN=ecjqFj4v6bhSXdVBZJM={FNCf%kj z9F)tnLIsjIVq??|Ie^z~KaB$207HUVX06f&S+oX?MX#a9if!3OJA!)&tqo{%V5|X$ zDTC)aeio8n0M6QsIWU&de+~Mr$E=UC7s1{_|5dxMgkNEJ_b6)`tPPuK*&bx!Pucfv zdL6S3KwE%^?B$m2m82UfAD>9{`tI2pu%9;CAKRcsb^VgDU z$gfVN(o3>(?G^gG|P_;SU59r4+@C$sNoQOGiUWm`bLXLP|4bR;mvZ%F%Ug z=alfq;+go|OUZx{@E4O(B@)SiilqEfjWHTarDUm0va;$FRF#%geQfVz=7))-gcC(e zDsLj0hDNf@%V>nrNZOxHrBZ$+f~l0DD3Q#iQX!?AGA@;)(}F|JSR$#MMpU_sDBMpe zkq#+`X}~X;Eje#QC0ojq^Aq-XM(I5P=wq@dix|7q=j_C?W|QfJ-IsBYomtYfxXN0SAysc;0aB{k*hO9! zfDuipI&RIORfkqcHDH)VJ0ubj$iQt?A4|((TB>>kEuhMsa1)0!06Uh=+E`k*; zBE39qPryL8D)yJ{+y%AI))ZDU4gaUpNaBH1Jtcu9qQeG498)y0BZRQ4;jl?1(&7tA z)nG(rT=`IxUQC>h$~30`Rb!)|dWuGi=~9y`sJ4Rs6A050tnF|xq?*l=VA+B=vurg> zI?Fb*lbP9EcWW_9)TZXGb}_KPm@Jy`~(t{pBqX^=o7o7QMJ}sNDY|b*71-U{3O|`TOna}^a-tqDuC!6f415f!GZhbF)zqZ<-TUYgtEqg> zG-Q~gHic7nJQXel#Sv`0@jW%N`A~g!Pi?cST@P?3Of?*=S`G|)&Qv48B5H_>rHJkL z*u+RnSOqbE#10o1U^Tj2Tn2VU7@MT*YIVI|U5e9BDvYmFeH=GFSH_Jo ze_&s}1F4FSQ4U5ms4-rDfFsW?R@Sk%*dSD3>f z!5jv&%waIcoC$z=<}g@b4uh-AVX(-Y2*8WXVUT1FgA{WZTw_iQ;3eiTc$qm2USSS{ zZ!qT^z;)&@NHd3l#T*7VOf|X}<_tH~b5Lh(G!B%r>j~&On4V%4UBWADK zh^aSCb$XBbDmQHEnvIycZX>2{nCi?PHO~#3x@jY(e$z%w-7@dhIJD}QQ8cJLIi+_b zZt<%oMEJ=5!yG<9#E)<&mp`jFOXQ4V_0+@Qo>vo|GO8yVxuPFvAHrM%tvmVwMao#G z$x?^7GmEdrJIRusoh)^6>jTeQ_@^{-CxcHXQ1Ee_x>u`-+MfGj_j}6mL%b*^iT(>u Ch}UEQ literal 0 HcmV?d00001 diff --git a/app/assets/fonts/mastodon.woff b/app/assets/fonts/mastodon.woff new file mode 100755 index 0000000000000000000000000000000000000000..733653731186078c6fbc05d6c5c2e1d58e150c9e GIT binary patch literal 3204 zcmY+Gc|26zAIC4l*kz7$XPoh+3szpLl@=XYMO&+DA;`+U#&p8LA@b?zt7($o}S0>B1~0C*02#O}ZG z;rRcXnYFDU05I8uR2!6yM4aqxOKVkikfngJ5hy!7c}x(2jQ0WA5Ex$q``~D!r4qtT ze+d9!Rsfj*C<$o){x-?Sl?*Z+0AQs70GCf}A`R<`_XF3mF~A)5|HSL+d5Z+HJ}?&o z01#x7x%x*pBHjf6I1X#5fjY^35zcS}Apmf~z*rQN44V$b&W-FJ1hT`rhaARL1puDj zgu^@yF#fkjJ5xLv9|YFr1kVCU{Lul7*$Yo5g6taj3}ImH&bCTrn2)!gKX}#&Fh>rQ zmKOHvSsw}!Tnjtg>o%yUX#=JAL0JTx3l2BojK-A_a1`GS4*Wz1M!AhZbH?FA0h*5b zBQ^OGx`|J@vWu(lvU4aZL_aIORw%r3fTSdPqy1%n%}sg zvTxHj%Q?crsN%YQc&4)ue%@BproKo76Tcy(3#?IU=N{N=DkydflNF&X%cbIh|M=0p z%v8>k9?D@*L6EqfRhpU?C#XGNyB;$>;k4m0;x~6H`0A>tstm1i)+aN$AaJ&`pD{}0 zznV0}wV0UlNVTbNK<@sM4##}d#g5BV1?@YM#MriR*2}!5X(MmN?im|PUHbcFnKAEg zacrgwb?&lh$D6_{7u!{I=Z`x~8ho%F4?c3Hysc|TU?r3JkAdK=lz#r%saOtJ zJ6k91dwVh8bmMOHi=l!nyR!3ddUtD8Zxsh>>6bfsUw$)n_GoLu(!`R#tW$)81AeSB zd0D}R@8)2jq37_D%>n7b_e@jBTP5`m-SM~*Y9z0c{$s|zBvvKM@>h~s!PSaH0fR-N z#nO4buz|^FMc+;&w);yD2VdV_(h1o1Lp|}`^{7U#tF9ka5IPi!$XkBhwce5(axR5=9=`2u$=co9~ z1ugHC z*qpJes_wNO;of|08e&)Md}fHNciw$Ub=`erTFPX8XI>=u!Z(8fX7xmslZ`3iY~Fj^ zpF0NAP?3Ysp_SzgrKf)l7_SvF{TA&Ox9nHsxDff!Hrnp2bLkCiT3i1Mp_10VK%-2% z+84bnu@sbWOKrUGp3{jFX%G2p$76b5OCQ(uTRzX;i=sXX(9IkyX`(Rsl5SZPW7Ad_ zHCnzyvS+Y4gY)d?9f}K-_50kzrp?ZX5pEf9W%`fPX>sT&W^Nifq6lJS?|4^I83Dsr zvm4n9;n_Q6kqzGo$Oei?RN4C%#Qr{O%;ZRhJ=D_>=bRv3%`lnvI96?A_|DD7!zhQ} zE7eA@>sbgf&r#=llvbILd3tN6liH`$2d2|M2M{XWN3^fhmoIo9P1x32w;G6x)Mq{D zAFz@A;N01m{CrI`D#ug)*~yY1|BLBewz@U@PBu37T$`fik@gDh6`nq>QV|c%WJh`A zr5Z6j89J4V0UepSjeDom423T3{X8XjgljC^0*k>ePrT?K9IY7B4yT+JP{yd8+SsxC zDJA{-b8sTIJ?8;c+=n&(9C644Qi^y#EU(6s@l~da#n<8TN%N7RPb@KT)JEv7jcgV< z{K7N%l*K<$@Sm)BFZwO{Yx%bel<%#WENv(h?m85IGv0pc7GM8*SQP(i)v(>$7bc_e zt0)*|gLqtm)I@Y^Sb05#IyDd1kPVx;H>Ho=Y^-?kt+7SuM`{vTB!XHP-Ct0UJK&ga z@oX%ZB$&RMUCTH887HY)Bzw_v)qC`v=c=hNwA8 zwvj!)GUFC~Z+m8Ouw9;^5VI{v_YcAx1%ABiN2Wlo*XBQ-887pN7mMdkp>LE{V{4#e z-Tshol4hj|Rqb$UG1T{VVKr)Aa)R&$@r|ioF0^Sv;LG3fGuA-CuXruJ`dJ3P+l4z^ zWd=P&`gEk8+Yh;*A^DoNOuAJ@sZ+V}9_AHl3{o z|JzIl2LKOvFZVcj^BV}Vt@)8|239FgCpEmB5Sm&@qs*^VJl7;+Mxq51nW64vX=sTC ze7#3wtBoyp2eHfB+=Zilhlp7F3Tp~ssOqyW`^k)qHW_^hpqFp&f_52OvClPK)Id!A zZ{8{esgE>?E0D0+ps+_(G)PYP31Et;OJ|PM%Hl1%R;p083i2~Hz=6?|kV&Jrko5sS~TAQuSK=ptI2COOZ9 z(`}l}Wf8k#2EXsVZ0f-lvG28dq-qPhzb+KXaEUJqs;s1}-jw7^cR!t`u<*+9=%XU@ zQ2xz0D|7Cs-DdhehwiX`_uk_?RFbhiW%u{G7h!Bj?0IB%+L8OuO0)0os019C`o~Zr z&^a9V2fo%fxmZ{e%3qFl=%hF$iuU(@dPGruSMsU|p(s(~(i1m_Af_W}DVv$K*viV0 z^i`+gW%~4Vp03HjRaNil4TtFfV8Sz5a!=#Ld;?#69`?)g(Su)ctfxg;W^a5&%_2l;4V)5a*3I6(?#62w>4%$3O8-Opw0-qm7noyOsqW0--zj>1+! zbhuvt?aR4FG^)vRyT~gqf1eQl|tGyfDLmS zK>IDQFw?bw*L`y5j#<`~q-vcf+WzqQbAH9`0vAFmTZdCu^2mBXv1ZZ;qyi?~;;5c+CG$S!4F(WZDOjcfBHy2|3QGO-` zjRpX873;A-d23(kK2i$K($WN{DQI&x3WkEUv5Jb=XP;C Date: Sun, 7 Jan 2018 16:06:50 +0530 Subject: [PATCH 55/56] Fixed org_admin administration dashboard error. Fixed error accessing admin dashboard by passing organization_id attribute. Fixes #1933 --- app/models/conference.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/conference.rb b/app/models/conference.rb index 9adac888..03402652 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -595,11 +595,11 @@ class Conference < ApplicationRecord # * +ActiveRecord+ def self.get_active_conferences_for_dashboard result = Conference.where('start_date > ?', Time.now) - .select('id, short_title, color, start_date') + .select('id, short_title, color, start_date, organization_id') if result.empty? result = Conference - .select('id, short_title, color, start_date').limit(2) + .select('id, short_title, color, start_date, organization_id').limit(2) .order(start_date: :desc) end result @@ -611,7 +611,7 @@ class Conference < ApplicationRecord # ====Returns # * +ActiveRecord+ def self.get_conferences_without_active_for_dashboard(active_conferences) - result = Conference.select('id, short_title, color, start_date').order(start_date: :desc) + result = Conference.select('id, short_title, color, start_date, organization_id').order(start_date: :desc) result - active_conferences end From 4e80372ac69a593c53f047a53753cd8b0401cf71 Mon Sep 17 00:00:00 2001 From: AnkushMalik Date: Tue, 9 Jan 2018 17:21:14 +0530 Subject: [PATCH 56/56] Change paths of buttons on conference show page Update path of track submission btn to track#new and proposal submission to proposal#new Closes #1813 --- app/views/conferences/_call_for_papers.haml | 2 +- app/views/conferences/_call_for_tracks.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/conferences/_call_for_papers.haml b/app/views/conferences/_call_for_papers.haml index 3bf0f295..b47d7118 100644 --- a/app/views/conferences/_call_for_papers.haml +++ b/app/views/conferences/_call_for_papers.haml @@ -23,5 +23,5 @@ left! %p.cta-button = link_to "Submit your proposal now", - conference_program_proposals_path(conference_id), + new_conference_program_proposal_path(conference_id), class: 'btn btn-success btn-lg text-center' diff --git a/app/views/conferences/_call_for_tracks.haml b/app/views/conferences/_call_for_tracks.haml index 7eb80fa6..6d78bd05 100644 --- a/app/views/conferences/_call_for_tracks.haml +++ b/app/views/conferences/_call_for_tracks.haml @@ -15,5 +15,5 @@ left! %p.cta-button = link_to("Submit your request for track", - conference_program_tracks_path(conference_id), + new_conference_program_track_path(conference_id), class: 'btn btn-success btn-lg text-center')