diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml
index 83f1aca4..6875c7b8 100644
--- a/.github/workflows/spec.yml
+++ b/.github/workflows/spec.yml
@@ -38,6 +38,12 @@ jobs:
with:
ruby-version: 2.6.6
bundler-cache: true
+ - name: Use Node.js
+ uses: actions/setup-node@v1
+ with:
+ node-version: '12.x'
+ - name: Install JavaScript libraries via npm
+ run: npm install
- name: Prepare spec
run: |
rm -f osem_test osem_development
@@ -46,7 +52,7 @@ jobs:
- name: spec/${{ matrix.suite }}
run: bundle exec rake spec:${{ matrix.suite }}
- name: coverage upload ${{ matrix.suite }}
- uses: codacy/codacy-coverage-reporter-action@master
+ uses: codacy/codacy-coverage-reporter-action@v1
if: github.ref == 'refs/heads/master'
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
diff --git a/.gitignore b/.gitignore
index c65dc0b1..fcdf9332 100644
--- a/.gitignore
+++ b/.gitignore
@@ -121,3 +121,6 @@ build-iPhoneSimulator/
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
.rubocop-https?--*
+
+# Ignore Javascript package binaries
+/node_modules
diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml
index 02f1ac56..b861bbe2 100644
--- a/.haml-lint_todo.yml
+++ b/.haml-lint_todo.yml
@@ -250,8 +250,9 @@ linters:
ConsecutiveComments:
exclude:
- # This one seems like a bug in haml-lint.
+ # These seems like a bug in haml-lint.
- "app/views/admin/conferences/show.html.haml"
+ - "app/views/proposals/index.html.haml"
# Offense count: 24
ConsecutiveSilentScripts:
diff --git a/.travis.yml b/.travis.yml
index b35784c6..00d5b582 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -43,6 +43,7 @@ jobs:
- gem install bundler -v $(tail -n 1 Gemfile.lock)
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $CCTR
- chmod +x $CCTR
+ - npm install
before_script:
- RAILS_ENV=test bundle exec rake db:bootstrap --trace
- RAILS_ENV=test bundle exec bin/rails webdrivers:chromedriver:update
diff --git a/Gemfile b/Gemfile
index 7933f0d2..3499a073 100644
--- a/Gemfile
+++ b/Gemfile
@@ -27,8 +27,9 @@ gem 'paper_trail'
# for upload management
gem 'carrierwave'
gem 'carrierwave-bombshelter'
-gem 'mimemagic', '~> 0.3.6'
gem 'mini_magick'
+# for uploading images to the cloud
+gem 'cloudinary'
# for internationalizing
gem 'rails-i18n'
@@ -115,6 +116,9 @@ end
# as date picker
gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47'
+# for switch checkboxes
+gem 'bootstrap-switch-rails', '~> 3.0.0'
+
# data tables
gem 'ajax-datatables-rails'
gem 'jquery-datatables'
@@ -142,6 +146,7 @@ gem 'rqrcode'
gem 'caxlsx'
gem 'caxlsx_rails'
+# Application Monitoring
gem 'sentry-delayed_job'
gem 'sentry-rails'
gem 'sentry-ruby'
@@ -174,15 +179,9 @@ gem 'money-rails'
# for lists
gem 'acts_as_list'
-# for switch checkboxes
-gem 'bootstrap-switch-rails', '~> 3.0.0'
-
# for parsing OEmbed data
gem 'ruby-oembed'
-# for uploading images to the cloud
-gem 'cloudinary'
-
# for setting app configuration in the environment
gem 'dotenv-rails'
@@ -214,7 +213,7 @@ gem 'skylight'
# Nokogiri < 1.8.1 is subject to:
# CVE-2017-0663, CVE-2017-7375, CVE-2017-7376, CVE-2017-9047, CVE-2017-9048,
# CVE-2017-9049, CVE-2017-9050
-gem 'nokogiri', '>= 1.8.1'
+gem 'nokogiri'
# memcached binary connector
gem 'dalli'
@@ -234,6 +233,7 @@ group :development do
gem 'spring-commands-rspec'
# to open mails
gem 'letter_opener'
+ # view mail at /letter_opener/
gem 'letter_opener_web'
# as deployment system
gem 'mina'
diff --git a/Gemfile.lock b/Gemfile.lock
index 110b19bd..aca6d74e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -171,11 +171,15 @@ GEM
railties (>= 3.0.0)
faker (1.9.3)
i18n (>= 0.7)
- faraday (1.3.0)
+ faraday (1.4.1)
+ faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
+ faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
- ruby2_keywords
+ ruby2_keywords (>= 0.0.4)
+ faraday-excon (1.1.0)
faraday-net_http (1.0.1)
+ faraday-net_http_persistent (1.1.0)
fastimage (2.1.4)
feature (1.4.0)
ffi (1.10.0)
@@ -293,7 +297,7 @@ GEM
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0225)
- mimemagic (0.4.3)
+ mimemagic (0.3.10)
nokogiri (~> 1)
rake
mina (1.2.3)
@@ -301,7 +305,7 @@ GEM
rake
mini_magick (4.9.5)
mini_mime (1.0.3)
- mini_portile2 (2.5.0)
+ mini_portile2 (2.5.1)
minitest (5.14.4)
momentjs-rails (2.20.1)
railties (>= 3.1)
@@ -320,7 +324,7 @@ GEM
nenv (0.3.0)
netrc (0.11.0)
nio4r (2.5.7)
- nokogiri (1.11.2)
+ nokogiri (1.11.3)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
notiffany (0.1.1)
@@ -332,7 +336,7 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
- octokit (4.20.0)
+ octokit (4.21.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
omniauth (1.9.1)
@@ -496,7 +500,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
- rexml (3.2.4)
+ rexml (3.2.5)
rolify (5.2.0)
rqrcode (0.10.1)
chunky_png (~> 1.0)
@@ -637,7 +641,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
- unicode-display_width (1.6.0)
+ unicode-display_width (1.6.1)
unicode_utils (1.4.0)
unobtrusive_flash (3.3.1)
railties
diff --git a/README.md b/README.md
index 1a549b45..9bb3cff4 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,3 @@
-### Spring 2021 Student Project
-[](https://travis-ci.com/CactusPuppy/snapcon)
-[](https://codeclimate.com/github/CactusPuppy/snapcon/maintainability)
-[](https://codeclimate.com/github/CactusPuppy/snapcon/test_coverage)
-[](https://hakiri.io/github/CactusPuppy/snapcon/master)
-[](https://depfu.com/github/CactusPuppy/snapcon?project_id=22682)
-[](http://dashboard.bluejay.governify.io/dashboard/script/dashboardLoader.js?dashboardURL=https://reporter.bluejay.governify.io/api/v4/dashboards/tpa-CS169L-GH-CactusPuppy_snapcon/main)
-
-
-
-
-
-
-
-
-
----
-
[](https://travis-ci.com/snap-cloud/snapcon)
[](https://codeclimate.com/github/snap-cloud/snapcon/maintainability)
[](https://codeclimate.com/github/snap-cloud/snapcon/test_coverage)
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 6548a3fe..c5b49ae7 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -55,6 +55,8 @@
//= require bootstrap-select
//= require osem-survey
//= require pagy
+//= require fullcalendar-scheduler/main.js
+//= require fullcalendar
$(document).ready(function() {
$('a[disabled=disabled]').click(function(event){
diff --git a/app/assets/javascripts/fullcalendar.js.erb b/app/assets/javascripts/fullcalendar.js.erb
new file mode 100644
index 00000000..22ee857d
--- /dev/null
+++ b/app/assets/javascripts/fullcalendar.js.erb
@@ -0,0 +1,28 @@
+$( document ).ready(function() {
+ let calendarEl = document.getElementById('vert-schedule-full-calendar');
+ if (!calendarEl) return; //check that we need a vertical schedule
+ let fullcalData = $('#fullcalendar');
+
+ let license_key = "<%= Rails.configuration.fullcalendar[:license_key] %>";
+
+ var calendar = new FullCalendar.Calendar(calendarEl, {
+ schedulerLicenseKey: license_key,
+ nowIndicator: true,
+ now: fullcalData.data('now'),
+ expandRows: true,
+ allDaySlot: false,
+ slotMinTime: fullcalData.data('startHour') + ':00:00',
+ slotMaxTime: fullcalData.data('endHour') + ':00:00',
+ validRange: {
+ start: fullcalData.data('startDate'),
+ end: fullcalData.data('endDate')
+ },
+ timeZone: fullcalData.data('timezone'),
+ initialDate: fullcalData.data('day'),
+ initialView: 'resourceTimeGridDay',
+ resources: fullcalData.data('rooms'),
+ events: fullcalData.data('events')
+ });
+
+ calendar.render();
+});
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index f5c58982..520eedbe 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -26,4 +26,6 @@
*= require osem-navbar
*= require mastodon
*= require conferences
+
+ *= require fullcalendar-scheduler/main.css
*/
diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb
index 35e6b709..cfd7eafc 100644
--- a/app/controllers/conferences_controller.rb
+++ b/app/controllers/conferences_controller.rb
@@ -40,7 +40,7 @@ class ConferencesController < ApplicationController
@image_url = "#{request.protocol}#{request.host}#{@conference.picture}"
- if splashpage.include_cfp
+ if splashpage.include_cfp?
cfps = @conference.program.cfps
@call_for_events = cfps.find { |call| call.cfp_type == 'events' }
if @call_for_events.try(:open?)
@@ -50,31 +50,27 @@ class ConferencesController < ApplicationController
@call_for_tracks = cfps.find { |call| call.cfp_type == 'tracks' }
@call_for_booths = cfps.find { |call| call.cfp_type == 'booths' }
end
- if splashpage.include_program
+ if splashpage.include_program?
@highlights = @conference.highlighted_events.eager_load(:speakers)
- if splashpage.include_tracks
+ if splashpage.include_tracks?
@tracks = @conference.confirmed_tracks.eager_load(
:room
).order('tracks.name')
end
- if splashpage.include_booths
+ if splashpage.include_booths?
@booths = @conference.confirmed_booths.order('title')
end
- if splashpage.include_happening_now
- events_schedules_list = get_happening_now_events_schedules(@conference)
- @events_schedules_limit = EVENTS_PER_PAGE
- @events_schedules_length = events_schedules_list.length
- @pagy, @events_schedules = pagy_array(events_schedules_list, items: @events_schedules_limit, link_extra: 'data-remote="true"')
- @happening_now_url = happening_now_conference_schedule_path(conference_id: @conference.short_title, format: :json)
+ if splashpage.include_happening_now?
+ load_happening_now
end
end
- if splashpage.include_registrations || splashpage.include_tickets
+ if splashpage.include_registrations? || splashpage.include_tickets?
@tickets = @conference.tickets.visible.order('price_cents')
end
- if splashpage.include_lodgings
+ if splashpage.include_lodgings?
@lodgings = @conference.lodgings.order('id')
end
- if splashpage.include_sponsors
+ if splashpage.include_sponsors?
@sponsorship_levels = @conference.sponsorship_levels.eager_load(
:sponsors
).order('sponsorship_levels.position ASC', 'sponsors.name')
diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb
index bf1b3adc..92625ea9 100644
--- a/app/controllers/proposals_controller.rb
+++ b/app/controllers/proposals_controller.rb
@@ -1,6 +1,9 @@
# frozen_string_literal: true
+EVENTS_PER_PAGE = Rails.configuration.conference[:events_per_page]
+
class ProposalsController < ApplicationController
+ include ConferenceHelper
before_action :authenticate_user!, except: [:show, :new, :create]
load_resource :conference, find_by: :short_title
load_resource :program, through: :conference, singleton: true
@@ -19,6 +22,7 @@ class ProposalsController < ApplicationController
@event_schedule = @event.event_schedules.find_by(schedule_id: @program.selected_schedule_id)
@speakers_ordered = @event.speakers_ordered
@surveys_after_event = @event.surveys.after_event.select(&:active?)
+ load_happening_now
end
def new
@@ -169,11 +173,11 @@ class ProposalsController < ApplicationController
private
def event_params
+ # TODO-SNAPCON: Restrict committee review to admins.
params.require(:event).permit(:event_type_id, :track_id, :difficulty_level_id,
:title, :subtitle, :abstract, :submission_text, :description,
:require_registration, :max_attendees, :language,
- speaker_ids: [], volunteer_ids: []
- )
+ :committee_review, speaker_ids: [], volunteer_ids: [])
end
def user_params
diff --git a/app/controllers/schedules_controller.rb b/app/controllers/schedules_controller.rb
index bdefb939..e0c5f911 100644
--- a/app/controllers/schedules_controller.rb
+++ b/app/controllers/schedules_controller.rb
@@ -78,6 +78,25 @@ class SchedulesController < ApplicationController
end
end
+ def vertical_schedule
+ dates = @conference.start_date..@conference.end_date
+ # the schedule takes you to today if it is a date of the schedule
+ current_day = @conference.current_conference_day
+ @day = current_day.present? ? current_day : dates.first
+ event_schedules = @program.selected_event_schedules(
+ includes: [{ event: %i[event_type speakers submitter] }]
+ )
+
+ unless event_schedules
+ redirect_to events_conference_schedule_path(@conference.short_title)
+ return
+ end
+
+ @rooms = FullCalendarFormatter.rooms_to_resources(@conference.venue.rooms) if @conference.venue
+ @event_schedules = FullCalendarFormatter.event_schedules_to_resources(event_schedules)
+ @now = Time.now.in_time_zone(@conference.timezone).strftime('%FT%T%:z')
+ end
+
def app
@qr_code = RQRCode::QRCode.new(conference_schedule_url).as_svg(offset: 20, color: '000', shape_rendering: 'crispEdges', module_size: 11)
end
diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb
index cf2c06ce..4240ad54 100644
--- a/app/helpers/conference_helper.rb
+++ b/app/helpers/conference_helper.rb
@@ -79,10 +79,42 @@ module ConferenceHelper
end
def get_happening_now_events_schedules(conference)
- events_schedules = conference.program.selected_event_schedules(
- includes: [:room, { event: %i[track event_type speakers submitter] }]
- ).select(&:happening_now?)
+ events_schedules = filter_events_schedules(conference, :happening_now?)
events_schedules ||= []
events_schedules
end
+
+ def get_happening_next_events_schedules(conference)
+ events_schedules = filter_events_schedules(conference, :happening_later?)
+
+ if events_schedules.empty?
+ return []
+ end
+
+ # events_schedules have been sorted by start_time in selected_event_schedules
+ happening_next_time = events_schedules[0].start_time
+ events_schedules = events_schedules.select { |s| s.start_time == happening_next_time }
+
+ events_schedules
+ end
+
+ def load_happening_now
+ events_schedules_list = get_happening_now_events_schedules(@conference)
+ @is_happening_next = false
+ if events_schedules_list.empty?
+ events_schedules_list = get_happening_next_events_schedules(@conference)
+ @is_happening_next = true
+ end
+ @events_schedules_limit = EVENTS_PER_PAGE
+ @events_schedules_length = events_schedules_list.length
+ @pagy, @events_schedules = pagy_array(events_schedules_list, items: @events_schedules_limit, link_extra: 'data-remote="true"')
+ end
+
+ private
+
+ def filter_events_schedules(conference, filter)
+ conference.program.selected_event_schedules(
+ includes: [:room, { event: %i[track event_type speakers submitter] }]
+ ).select(&filter)
+ end
end
diff --git a/app/models/ability.rb b/app/models/ability.rb
index ec17e14c..68c83066 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -31,7 +31,7 @@ class Ability
event.state == 'confirmed'
end
- can [:show, :events, :happening_now, :app], Schedule do |schedule|
+ can [:show, :events, :happening_now, :app, :vertical_schedule], Schedule do |schedule|
schedule.program.schedule_public
end
diff --git a/app/models/email_settings.rb b/app/models/email_settings.rb
index 8a8ab0b5..e5b64801 100644
--- a/app/models/email_settings.rb
+++ b/app/models/email_settings.rb
@@ -91,6 +91,8 @@ class EmailSettings < ApplicationRecord
h['eventtitle'] = event.title
h['proposalslink'] = Rails.application.routes.url_helpers.conference_program_proposals_url(
conference.short_title, host: (ENV['OSEM_HOSTNAME'] || 'localhost:3000'))
+ h['committee_review'] = event.committee_review
+ h['committee_review_html'] = ApplicationController.helpers.markdown(event.committee_review)
end
if booth
diff --git a/app/models/event_schedule.rb b/app/models/event_schedule.rb
index 036a89f2..7be7a7d2 100644
--- a/app/models/event_schedule.rb
+++ b/app/models/event_schedule.rb
@@ -70,6 +70,14 @@ class EventSchedule < ApplicationRecord
event_time_range.overlaps?(now_range)
end
+ def happening_later?
+ # TODO: Save start_time with local timezone info when making an event schedule
+ in_tz_start = start_time.in_time_zone(timezone)
+ in_tz_start -= in_tz_start.utc_offset
+
+ in_tz_start >= Time.now
+ end
+
def self.withdrawn_or_canceled_event_schedules(schedule_ids)
EventSchedule
.unscoped
@@ -125,6 +133,14 @@ class EventSchedule < ApplicationRecord
other.schedule_id == schedule_id
end
+ def start_time_in_conference_timezone
+ time_in_conference_timezone(start_time)
+ end
+
+ def end_time_in_conference_timezone
+ time_in_conference_timezone(end_time)
+ end
+
private
def replaced_event_schedules
@@ -179,4 +195,10 @@ class EventSchedule < ApplicationRecord
errors.add(:schedule, "must be one of #{event.track.name} track's schedules") unless event.track.schedules.include?(schedule)
end
+
+ def time_in_conference_timezone(time)
+ time_in_tz = time.in_time_zone(timezone)
+ time_in_tz -= time_in_tz.utc_offset
+ time_in_tz
+ end
end
diff --git a/app/models/program.rb b/app/models/program.rb
index e0196099..f9e851bf 100644
--- a/app/models/program.rb
+++ b/app/models/program.rb
@@ -117,7 +117,8 @@ class Program < ApplicationRecord
def show_voting?
return true unless blind_voting
- Time.current > voting_end_date
+ # TODO-SNAPCON: UPDATE TESTS
+ # Time.current > voting_end_date
end
##
diff --git a/app/services/full_calendar_formatter.rb b/app/services/full_calendar_formatter.rb
new file mode 100644
index 00000000..499b8e04
--- /dev/null
+++ b/app/services/full_calendar_formatter.rb
@@ -0,0 +1,42 @@
+class FullCalendarFormatter
+ def self.rooms_to_resources(rooms)
+ rooms.map { |room| room_to_resource(room) }.to_json
+ end
+
+ def self.event_schedules_to_resources(event_schedules)
+ return '[]' if event_schedules.empty?
+
+ conference = event_schedules.first.schedule.program.conference
+ event_schedules.map { |event_schedule| event_schedule_to_resource(conference, event_schedule) }.to_json
+ end
+
+ class << self
+ include FormatHelper
+
+ private
+
+ def room_to_resource(room)
+ {
+ id: room.guid,
+ title: room.name
+ }
+ end
+
+ def event_schedule_to_resource(conference, event_schedule)
+ event_type_color = event_schedule.event.event_type.color
+ url = Rails.application.routes.url_helpers.conference_program_proposal_path(conference.short_title, event_schedule.event.id)
+
+ {
+ id: event_schedule.event.guid,
+ title: event_schedule.event.title,
+ start: event_schedule.start_time_in_conference_timezone,
+ end: event_schedule.end_time_in_conference_timezone,
+ resourceId: event_schedule.room.guid,
+ url: url,
+ borderColor: event_type_color,
+ backgroundColor: event_type_color,
+ textColor: contrast_color(event_type_color)
+ }
+ end
+ end
+end
diff --git a/app/views/admin/commercials/index.html.haml b/app/views/admin/commercials/index.html.haml
index 2b91c1a6..d318707c 100644
--- a/app/views/admin/commercials/index.html.haml
+++ b/app/views/admin/commercials/index.html.haml
@@ -1,7 +1,7 @@
.row
.col-md-12
.page-header
- %h1 Session Materials
+ %h1 #{@conference.title} Materials
%p.text-muted
Conference materials will be displayed on the events in the
= link_to 'schedule,', conference_schedule_path(@conference.short_title)
diff --git a/app/views/admin/emails/_help.html.haml b/app/views/admin/emails/_help.html.haml
index 371bac7b..1222c1ac 100644
--- a/app/views/admin/emails/_help.html.haml
+++ b/app/views/admin/emails/_help.html.haml
@@ -17,6 +17,12 @@
%tr
%td {eventtitle}
%td The title of an accepted or rejected proposal
+ %tr
+ %td {committee_review}
+ %td The raw text in the committee review for the proposal
+ %tr
+ %td {committee_review_html}
+ %td The committee review markdown rendered as HTML.
%tr
%td {conference_start_date}
%td The start date of the conference
@@ -51,14 +57,11 @@
- if @conference.program.schedule_public
%td {schedule_link}
%td The link to complete schedule of the conference
- - if @conference.splashpage && @conference.splashpage.public
+ - if @conference.splashpage && @conference.splashpage.public?
%tr
%td {conference_splash_link}
%td The link to conference splash page
- if @conference.booths
- %tr
- %td {submitter_name}
- %td Submitter's name
%tr
%td {booth_title}
%td Booth's title
diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml
index 05d48bb7..c21f364f 100644
--- a/app/views/admin/events/_proposal.html.haml
+++ b/app/views/admin/events/_proposal.html.haml
@@ -73,9 +73,7 @@
%td
= link_to @event.submitter.name, admin_user_path(@event.submitter)
- if @event.submitter.email_public
- (
- = link_to @event.submitter.email, "mailto: #{@event.submitter.email}"
- )
+ (#{mail_to(@event.submitter.email)})
%tr
%td
%b Speakers
@@ -84,9 +82,7 @@
%div
= link_to speaker.name, admin_user_path(speaker)
- if speaker.email_public
- (
- = link_to speaker.email, "mailto: #{speaker.email}"
- )
+ (#{mail_to(speaker.email)})
%tr
%td
%b Volunteers
@@ -117,11 +113,17 @@
%td
%b Submission Description
%td= markdown(@event.submission_text)
+
%tr
%td
%b Requirements
%td= simple_format(@event.description)
+ %tr
+ %td
+ %b Committee Review
+ %td= markdown(@event.committee_review)
+
- if @conference.program.rating_enabled?
= render 'voting',
event: @event,
diff --git a/app/views/admin/events/_voting.html.haml b/app/views/admin/events/_voting.html.haml
index e0388663..e0baa050 100644
--- a/app/views/admin/events/_voting.html.haml
+++ b/app/views/admin/events/_voting.html.haml
@@ -22,20 +22,20 @@
- if voting_period
- max_rating.times do |counter|
- if event.user_rating(current_user) > counter
- = link_to '',
+ = link_to('',
vote_admin_conference_program_event_path(conference_id,
event, rating: counter + 1),
remote: true,
id: "label#{counter + 1}",
class: 'rating myrating bright',
- voted: true
+ voted: true)
- else
- = link_to '',
+ = link_to('',
vote_admin_conference_program_event_path(conference_id,
event, rating: counter + 1),
remote: true,
id: "label#{counter + 1}",
- class: 'rating myrating'
+ class: 'rating myrating')
- else
= rating_stars(event.user_rating(current_user), max_rating, voted: true)
(Voting period is closed)
diff --git a/app/views/admin/splashpages/show.html.haml b/app/views/admin/splashpages/show.html.haml
index 08edb140..e3732b89 100644
--- a/app/views/admin/splashpages/show.html.haml
+++ b/app/views/admin/splashpages/show.html.haml
@@ -49,7 +49,7 @@
%i{ class: "fa-li #{icon_for_todo @splashpage.include_social_media?}" }
Display social media links
%li
- - if @conference.splashpage && @conference.splashpage.public
+ - if @conference.splashpage && @conference.splashpage.public?
%i{ class: "fa-li #{icon_for_todo @splashpage.public?}" }
%text-muted.publicorprivate Public
- else
diff --git a/app/views/admin/tickets/show.html.haml b/app/views/admin/tickets/show.html.haml
index a6b31ea4..dba94810 100644
--- a/app/views/admin/tickets/show.html.haml
+++ b/app/views/admin/tickets/show.html.haml
@@ -20,7 +20,7 @@
.col-md-12
%table.datatable
%thead
- %th #
+ %th ID
%th Name
%th Quantity
%th E-Mail
@@ -32,7 +32,7 @@
- purchases = buyer.ticket_purchases.where(ticket_id: @ticket.id)
%tr
%td
- = index + 1
+ = purchases.length == 1 ? purchases.first.id : purchases.map(&:id)
%td
= buyer.name
%td
diff --git a/app/views/conferences/_about_and_happening_now.haml b/app/views/conferences/_about_and_happening_now.haml
index c048b28d..3b327c4f 100644
--- a/app/views/conferences/_about_and_happening_now.haml
+++ b/app/views/conferences/_about_and_happening_now.haml
@@ -3,21 +3,21 @@
= render 'happening_now', conference: conference,
events_schedules: events_schedules, pagy: pagy,
events_schedules_length: events_schedules_length,
- events_schedules_limit: events_schedules_limit
+ events_schedules_limit: events_schedules_limit,
+ is_happening_next: is_happening_next
= content_for :about do
#about
.row
- %h2.text-left{ style: 'margin-bottom:30px' } About the Conference
= markdown(conference.description, false)
%section#about-and-happening-now
.container
.row
-# happening now events are displayed second in md or lg view
- - if conference.splashpage.include_happening_now && conference.splashpage.include_program
+ - if conference.splashpage.include_happening_now? && conference.splashpage.include_program?
- if conference.description.present?
- .col-md-6.col-md-push-6.col-lg-4.col-lg-push-8
+ .col-md-6.col-md-push-6.col-lg-4.col-lg-push-8{ style: 'margin-top: 60px' }
= yield :happening_now
- else
.col-md-12
diff --git a/app/views/conferences/_happening_now.haml b/app/views/conferences/_happening_now.haml
index 66355a82..ccf0181f 100644
--- a/app/views/conferences/_happening_now.haml
+++ b/app/views/conferences/_happening_now.haml
@@ -1,12 +1,15 @@
-- if conference.splashpage.include_program && conference.splashpage.include_happening_now
- - if events_schedules.any?
- .row
- %h2.text-center{ style: 'margin-bottom:30px' } Happening Now
- - events_schedules.each do |event_schedule|
- = render 'schedules/event', conference: conference, event_schedule: event_schedule, event: event_schedule.event, is_brief: true
- - if events_schedules_length > events_schedules_limit
- .container{ style: 'width:100%; text-align:center' }
- != pagy_bootstrap_nav_js(pagy)
- - else
- .row
- %h3.text-center There are no events happening now.
+- if events_schedules.present? && events_schedules.any?
+ .row
+ %h3.text-left{ style: 'margin-bottom:30px; padding-left:20px' }
+ - if is_happening_next
+ Events Happening Next
+ - else
+ Events Happening Now
+ - events_schedules.each do |event_schedule|
+ = render 'schedules/event', conference: conference, event_schedule: event_schedule, event: event_schedule.event, is_brief: true
+ - if events_schedules_length > events_schedules_limit
+ .container{ style: 'width:100%; text-align:center' }
+ != pagy_bootstrap_nav_js(pagy)
+- else
+ .row
+ %h3.text-center There are no events scheduled yet.
diff --git a/app/views/conferences/_header.haml b/app/views/conferences/_header.haml
index 9a1316f6..4ee7123c 100644
--- a/app/views/conferences/_header.haml
+++ b/app/views/conferences/_header.haml
@@ -1,6 +1,11 @@
- cache [conference, venue, '#splash#header'] do
#banner{ style: ("background-image: url(#{conference.picture_url})" if conference.picture_url) }
.container
+ - if user_signed_in?
+ - if current_user.ticket_purchases.by_conference(@conference).empty?
+ .alert.bg-info{ :role => "alert", :style => "margin-bottom: 100px" }
+ You have not purchased any tickets for this conference yet.
+ = link_to "Book your tickets now!", "#tickets"
.row
.col-md-6.col-md-offset-3{ id: (conference.picture? ? "header-image" : "header-no-image") }
.row
diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml
index 3a73c0b0..ed642f34 100644
--- a/app/views/conferences/show.html.haml
+++ b/app/views/conferences/show.html.haml
@@ -49,21 +49,22 @@
= render 'about_and_happening_now', conference: @conference,
events_schedules: @events_schedules, pagy: @pagy,
events_schedules_length: @events_schedules_length,
- events_schedules_limit: @events_schedules_limit
+ events_schedules_limit: @events_schedules_limit,
+ is_happening_next: @is_happening_next
-# calls for content, or program
- - if @conference.splashpage.include_cfp
+ - if @conference.splashpage.include_cfp?
= render 'call_for_content', conference: @conference,
call_for_events: @call_for_events, call_for_tracks: @call_for_tracks,
call_for_booths: @call_for_booths,
event_types: @event_types, tracks: @track_names
- - if @conference.splashpage.include_program
+ - if @conference.splashpage.include_program?
= render 'program', conference: @conference, tracks: @tracks,
highlights: @highlights, booths: @booths
-# attendance/registration
- - if @conference.splashpage.include_registrations
+ - if @conference.splashpage.include_registrations?
- if @conference.registration_open?
= render 'registration', conference: @conference,
registration_period: @conference.registration_period,
@@ -72,20 +73,20 @@
= render 'tickets', conference: @conference, tickets: @tickets
-# geo
- - if @conference.splashpage.include_venue && @conference.venue
+ - if @conference.splashpage.include_venue? && @conference.venue
= render 'venue', conference: @conference, venue: @conference.venue,
commercial: @conference.venue.commercial
- if @conference.splashpage.include_lodgings && @conference.lodgings.any?
= render 'lodging', venue: @conference.venue, lodgings: @lodgings
-# sponsorship
- - if @conference.splashpage.include_sponsors
+ - if @conference.splashpage.include_sponsors?
= render 'sponsors', conference: @conference,
sponsorship_levels: @sponsorship_levels,
sponsors: @sponsors
-# footer
- - if @conference.splashpage.include_social_media
+ - if @conference.splashpage.include_social_media?
- if @conference.contact.has_social_media?
= render 'social_media', contact: @conference.contact
= render 'footer'
diff --git a/app/views/conferences/show.js.erb b/app/views/conferences/show.js.erb
index fb35b420..61c0a3a3 100644
--- a/app/views/conferences/show.js.erb
+++ b/app/views/conferences/show.js.erb
@@ -1,5 +1,6 @@
$('#happening-now').html("<%= j(render 'happening_now', conference: @conference,
events_schedules: @events_schedules, pagy: @pagy,
events_schedules_length: @events_schedules_length,
- events_schedules_limit: @events_schedules_limit)%>");
+ events_schedules_limit: @events_schedules_limit,
+ is_happening_next: @is_happening_next) %>");
Pagy.init(document.getElementById('happening-now'));
diff --git a/app/views/layouts/_mailbot_header.html.erb b/app/views/layouts/_mailbot_header.html.erb
index f3c33bd8..084cddb1 100644
--- a/app/views/layouts/_mailbot_header.html.erb
+++ b/app/views/layouts/_mailbot_header.html.erb
@@ -19,7 +19,7 @@
<% end %>