Merge pull request #47 from snap-cloud/reg-and-ui-tweaks
Improved Registration Flow,
This commit is contained in:
commit
c7d8735f50
19 changed files with 100 additions and 35 deletions
|
|
@ -50,4 +50,10 @@
|
||||||
.trapezoid {
|
.trapezoid {
|
||||||
border-top-color: $navbar-default-bg;
|
border-top-color: $navbar-default-bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-thumbnail {
|
||||||
|
border-radius: 3px;
|
||||||
|
max-height: 20px;
|
||||||
|
max-width: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,6 @@ body {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav #current-user-detail .profile-thumnail {
|
|
||||||
max-height: 20px;
|
|
||||||
max-width: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* centered columns styles */
|
/* centered columns styles */
|
||||||
.row-centered {
|
.row-centered {
|
||||||
text-align:center;
|
text-align:center;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ module Admin
|
||||||
private
|
private
|
||||||
|
|
||||||
def room_params
|
def room_params
|
||||||
params.require(:room).permit(:name, :size, :url)
|
params.require(:room).permit(:name, :size, :url, :order)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ class ConferenceRegistrationsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def registration_params
|
def registration_params
|
||||||
params.permit(:registration)
|
params.require(:registration)
|
||||||
.permit(
|
.permit(
|
||||||
:conference_id,
|
:conference_id,
|
||||||
:volunteer, :accepted_code_of_conduct,
|
:volunteer, :accepted_code_of_conduct,
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,24 @@ module EventsHelper
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def join_event_link(event, current_user)
|
||||||
|
return unless event.url.present? && current_user
|
||||||
|
|
||||||
|
conference = event.conference
|
||||||
|
is_today = event.time&.today?
|
||||||
|
if current_user.roles.where(id: conference.roles).any?
|
||||||
|
# Show Pre-Event links for any memeber of the conference team.
|
||||||
|
link_to("Join Live Event #{'(Pre-Event)' unless is_today}",
|
||||||
|
event.url, target: '_blank')
|
||||||
|
elsif current_user.registered_to_event?(conference)
|
||||||
|
if is_today
|
||||||
|
link_to('Join Live Event', event.url, target: '_blank')
|
||||||
|
else
|
||||||
|
link_to('Live Event Link Coming Soon', '#')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def active_dropdown(selection, options)
|
def active_dropdown(selection, options)
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ class Event < ApplicationRecord
|
||||||
belongs_to :track
|
belongs_to :track
|
||||||
belongs_to :difficulty_level
|
belongs_to :difficulty_level
|
||||||
belongs_to :program
|
belongs_to :program
|
||||||
|
belongs_to :room
|
||||||
|
delegate :url, to: :room, allow_nil: true
|
||||||
|
|
||||||
accepts_nested_attributes_for :event_users, allow_destroy: true
|
accepts_nested_attributes_for :event_users, allow_destroy: true
|
||||||
accepts_nested_attributes_for :speakers, allow_destroy: true
|
accepts_nested_attributes_for :speakers, allow_destroy: true
|
||||||
|
|
@ -286,6 +288,10 @@ class Event < ApplicationRecord
|
||||||
program.conference
|
program.conference
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def <=>(other)
|
||||||
|
time <=> other.time
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class Program < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_registration_open
|
def with_registration_open
|
||||||
select { |e| e if e.registration_possible? }
|
select { |e| e if e.registration_possible? }.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
# All confirmed events of the conference with attribute require_registration
|
# All confirmed events of the conference with attribute require_registration
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ class Registration < ApplicationRecord
|
||||||
|
|
||||||
def user_has_registration_ticket
|
def user_has_registration_ticket
|
||||||
return if TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any?
|
return if TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any?
|
||||||
|
|
||||||
errors.add(:base, 'You must purchase a registration ticket before registering')
|
errors.add(:base, 'You must purchase a registration ticket before registering')
|
||||||
if TicketPurchase.where(user: user, ticket: conference.registration_tickets).unpaid.any?
|
if TicketPurchase.where(user: user, ticket: conference.registration_tickets).unpaid.any?
|
||||||
errors.add(:base, 'You currently have a ticket with an unfinished purchase')
|
errors.add(:base, 'You currently have a ticket with an unfinished purchase')
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ class Room < ApplicationRecord
|
||||||
validates :name, :venue_id, presence: true
|
validates :name, :venue_id, presence: true
|
||||||
|
|
||||||
validates :size, numericality: { only_integer: true, greater_than: 0 }, allow_nil: true
|
validates :size, numericality: { only_integer: true, greater_than: 0 }, allow_nil: true
|
||||||
|
validates :order, numericality: { only_integer: true, greater_than: 0 }, allow_nil: true
|
||||||
|
|
||||||
|
default_scope { order(order: :asc) }
|
||||||
|
|
||||||
def conference
|
def conference
|
||||||
venue.conference
|
venue.conference
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,7 @@
|
||||||
= semantic_form_for(@room, url: (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f|
|
= 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}
|
= f.input :size, label: 'Capacity', input_html: {size: 5}
|
||||||
= f.input :url, label: 'URL'
|
= f.input :order, label: 'Order', input_html: {size: 5}, hint: 'Force the order of rooms in the schedule.'
|
||||||
%p.small
|
= f.input :url, label: 'URL', hint: 'The URL is only visible to registered attendees.'
|
||||||
The URL is only visible to registered attendees.
|
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,18 @@
|
||||||
%thead
|
%thead
|
||||||
%th Name
|
%th Name
|
||||||
%th Capacity
|
%th Capacity
|
||||||
|
%th Order
|
||||||
%th URL
|
%th URL
|
||||||
%th Actions
|
%th Actions
|
||||||
%tbody
|
%tbody
|
||||||
- @rooms.each_with_index do |room, index|
|
- @rooms.each_with_index do |room, index|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%th
|
||||||
= room.name
|
= room.name
|
||||||
%td
|
%td
|
||||||
= room.size
|
= room.size
|
||||||
|
%td
|
||||||
|
= room.order
|
||||||
%td
|
%td
|
||||||
= room.url
|
= room.url
|
||||||
%td
|
%td
|
||||||
|
|
|
||||||
33
app/views/conference_registrations/_event.html.haml
Normal file
33
app/views/conference_registrations/_event.html.haml
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
.panel.panel-default{class: ("panel-success" if event.registrations.include?(@registration)) }
|
||||||
|
.panel-heading
|
||||||
|
%label{for: "registration_event_ids_#{event.id}"}
|
||||||
|
%h3{style: 'margin: 0 auto;'}
|
||||||
|
= hidden_field_tag "registration[event_ids][]", nil
|
||||||
|
= check_box_tag "registration[event_ids][]", event.id, event.registrations.include?(@registration), id: "registration_event_ids_#{event.id}"
|
||||||
|
= event.title
|
||||||
|
%small
|
||||||
|
= event.subtitle
|
||||||
|
.panel-body
|
||||||
|
-# %p
|
||||||
|
-# = canceled_replacement_event_label(event, event_schedule)
|
||||||
|
-# = replacement_event_notice(event_schedule)
|
||||||
|
%p
|
||||||
|
- if event.speakers.any?
|
||||||
|
presented by #{event.speaker_names}
|
||||||
|
- if event_schedule.present?
|
||||||
|
.h4.track
|
||||||
|
%span.fa.fa-clock-o
|
||||||
|
%span.label{ style: "background-color: grey" }
|
||||||
|
= event_schedule.start_time.strftime('%A, %B %-d %H:%M')
|
||||||
|
\-
|
||||||
|
= event_schedule.end_time.strftime('%H:%M')
|
||||||
|
%p
|
||||||
|
= markdown(truncate(event.abstract, length: 250))
|
||||||
|
-# TODO: More informative text or aria-label.
|
||||||
|
= link_to 'more', conference_program_proposal_path(@conference.short_title, event.id), target: '_blank'
|
||||||
|
|
||||||
|
- if event.track
|
||||||
|
%span.track
|
||||||
|
%span.fa.fa-road
|
||||||
|
%span.label{ style: "background-color: #{event.track.color}; color: #{ contrast_color(event.track.color) }" }
|
||||||
|
= event.track.name
|
||||||
|
|
@ -13,15 +13,11 @@
|
||||||
- if @conference.program.events.with_registration_open.any? || @registration.events.any?
|
- if @conference.program.events.with_registration_open.any? || @registration.events.any?
|
||||||
= f.inputs 'Pre-registration required for the following:' do
|
= f.inputs 'Pre-registration required for the following:' do
|
||||||
|
|
||||||
|
-# TODO: This needs to be easier to use.
|
||||||
|
%p
|
||||||
|
You are registered for #{pluralize(@registration.events.count, 'event')}.
|
||||||
|
They are at the end of this list.
|
||||||
- @registration.events_ordered.each do |event|
|
- @registration.events_ordered.each do |event|
|
||||||
%label
|
= render 'event', event: event, event_schedule: event.event_schedules.first
|
||||||
= hidden_field_tag "registration[event_ids][]", nil
|
|
||||||
= check_box_tag "registration[event_ids][]", event.id, event.registrations.include?(@registration)
|
|
||||||
= event.title
|
|
||||||
.text-muted
|
|
||||||
= registered_text(event)
|
|
||||||
- if event.scheduled?
|
|
||||||
(Scheduled on: #{event.time.to_date})
|
|
||||||
%br
|
|
||||||
|
|
||||||
= render 'conferences/code_of_conduct', organization: @conference.organization
|
= render 'conferences/code_of_conduct', organization: @conference.organization
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
%li
|
%li
|
||||||
%a.smoothscroll{ href: '#program' } Program
|
%a.smoothscroll{ href: '#program' } Program
|
||||||
%li
|
%li
|
||||||
= link_to('Schedule', conference_schedule_path(@conference))
|
= link_to('Schedule', events_conference_schedule_path(@conference))
|
||||||
|
|
||||||
- cache [conference, highlights, tracks, booths, '#splash#program'] do
|
- cache [conference, highlights, tracks, booths, '#splash#program'] do
|
||||||
%section#program
|
%section#program
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%p.cta-button.text-center
|
%p.cta-button.text-center
|
||||||
= link_to(conference_schedule_path(conference.short_title),
|
= link_to(events_conference_schedule_path(conference.short_title),
|
||||||
class: 'btn btn-success btn-lg') do
|
class: 'btn btn-success btn-lg') do
|
||||||
Full Schedule
|
Full Schedule
|
||||||
.trapezoid
|
.trapezoid
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
.container
|
.container
|
||||||
.row
|
.row
|
||||||
.col-md-12.text-center
|
.col-md-12.text-center
|
||||||
%h2 Sign Up for Snap<em>!</em>Con
|
|
||||||
%br
|
%br
|
||||||
-# %h2
|
%h2
|
||||||
-# Support
|
Sign up for
|
||||||
-# = conference.title
|
= conference.title
|
||||||
|
!
|
||||||
.row.row-centered
|
.row.row-centered
|
||||||
- tickets.each do |ticket|
|
- tickets.each do |ticket|
|
||||||
.col-lg-4.col-md-3.col-sm-3.col-centered.col-top
|
.col-lg-4.col-md-3.col-sm-3.col-centered.col-top
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,8 @@
|
||||||
%br
|
%br
|
||||||
%small
|
%small
|
||||||
= @event.subtitle
|
= @event.subtitle
|
||||||
- if @event.room&.url && @conference.user_registered?(current_user)
|
%h3
|
||||||
%h3
|
= join_event_link(@event, current_user)
|
||||||
= link_to('Join Event', @event.room.url, target: '_blank')
|
|
||||||
.col-md-2
|
.col-md-2
|
||||||
%p{style: "margin-top: 20px"}
|
%p{style: "margin-top: 20px"}
|
||||||
- if can?(:update, @event) && @event.require_registration?
|
- if can?(:update, @event) && @event.require_registration?
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
%h4
|
%h4
|
||||||
- if(event.speakers.any?)
|
- if(event.speakers.any?)
|
||||||
presented by #{event.speaker_names}
|
presented by #{event.speaker_names}
|
||||||
- if event.room&.url && @conference.user_registered?(current_user)
|
%h5
|
||||||
%p
|
= join_event_link(event, current_user)
|
||||||
= link_to('Join Event', event.room.url, target: '_blank')
|
|
||||||
%p
|
%p
|
||||||
= markdown(truncate(event.abstract, length: 400))
|
= markdown(truncate(event.abstract, length: 400))
|
||||||
|
-# TODO: More informative text or aria-label.
|
||||||
= link_to 'more', conference_program_proposal_path(@conference.short_title, event.id) if event.abstract.length > 400
|
= link_to 'more', conference_program_proposal_path(@conference.short_title, event.id) if event.abstract.length > 400
|
||||||
- if event_schedule.present?
|
- if event_schedule.present?
|
||||||
%span.track
|
%span.track
|
||||||
|
|
|
||||||
5
db/migrate/20200716181602_add_order_to_rooms.rb
Normal file
5
db/migrate/20200716181602_add_order_to_rooms.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddOrderToRooms < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :rooms, :order, :int
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2020_07_15_034647) do
|
ActiveRecord::Schema.define(version: 2020_07_16_181602) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
@ -407,7 +407,8 @@ ActiveRecord::Schema.define(version: 2020_07_15_034647) do
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.integer "size"
|
t.integer "size"
|
||||||
t.integer "venue_id", null: false
|
t.integer "venue_id", null: false
|
||||||
t.text "url"
|
t.string "url"
|
||||||
|
t.integer "order"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "schedules", force: :cascade do |t|
|
create_table "schedules", force: :cascade do |t|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue