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 {
|
||||
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;
|
||||
}
|
||||
|
||||
nav #current-user-detail .profile-thumnail {
|
||||
max-height: 20px;
|
||||
max-width: 20px;
|
||||
}
|
||||
|
||||
/* centered columns styles */
|
||||
.row-centered {
|
||||
text-align:center;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ module Admin
|
|||
private
|
||||
|
||||
def room_params
|
||||
params.require(:room).permit(:name, :size, :url)
|
||||
params.require(:room).permit(:name, :size, :url, :order)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
end
|
||||
|
||||
def registration_params
|
||||
params.permit(:registration)
|
||||
params.require(:registration)
|
||||
.permit(
|
||||
:conference_id,
|
||||
:volunteer, :accepted_code_of_conduct,
|
||||
|
|
|
|||
|
|
@ -173,6 +173,24 @@ module EventsHelper
|
|||
)
|
||||
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
|
||||
|
||||
def active_dropdown(selection, options)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ class Event < ApplicationRecord
|
|||
belongs_to :track
|
||||
belongs_to :difficulty_level
|
||||
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 :speakers, allow_destroy: true
|
||||
|
|
@ -286,6 +288,10 @@ class Event < ApplicationRecord
|
|||
program.conference
|
||||
end
|
||||
|
||||
def <=>(other)
|
||||
time <=> other.time
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class Program < ApplicationRecord
|
|||
end
|
||||
|
||||
def with_registration_open
|
||||
select { |e| e if e.registration_possible? }
|
||||
select { |e| e if e.registration_possible? }.sort
|
||||
end
|
||||
|
||||
# All confirmed events of the conference with attribute require_registration
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ class Registration < ApplicationRecord
|
|||
|
||||
def user_has_registration_ticket
|
||||
return if TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any?
|
||||
|
||||
errors.add(:base, 'You must purchase a registration ticket before registering')
|
||||
if TicketPurchase.where(user: user, ticket: conference.registration_tickets).unpaid.any?
|
||||
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 :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
|
||||
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|
|
||||
= f.input :name, input_html: { autofocus: true }
|
||||
= f.input :size, label: 'Capacity', input_html: {size: 5}
|
||||
= f.input :url, label: 'URL'
|
||||
%p.small
|
||||
The URL is only visible to registered attendees.
|
||||
= f.input :order, label: 'Order', input_html: {size: 5}, hint: 'Force the order of rooms in the schedule.'
|
||||
= f.input :url, label: 'URL', hint: 'The URL is only visible to registered attendees.'
|
||||
%p.text-right
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||
|
|
|
|||
|
|
@ -12,15 +12,18 @@
|
|||
%thead
|
||||
%th Name
|
||||
%th Capacity
|
||||
%th Order
|
||||
%th URL
|
||||
%th Actions
|
||||
%tbody
|
||||
- @rooms.each_with_index do |room, index|
|
||||
%tr
|
||||
%td
|
||||
%th
|
||||
= room.name
|
||||
%td
|
||||
= room.size
|
||||
%td
|
||||
= room.order
|
||||
%td
|
||||
= room.url
|
||||
%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?
|
||||
= 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|
|
||||
%label
|
||||
= 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 'event', event: event, event_schedule: event.event_schedules.first
|
||||
|
||||
= render 'conferences/code_of_conduct', organization: @conference.organization
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
%li
|
||||
%a.smoothscroll{ href: '#program' } Program
|
||||
%li
|
||||
= link_to('Schedule', conference_schedule_path(@conference))
|
||||
= link_to('Schedule', events_conference_schedule_path(@conference))
|
||||
|
||||
- cache [conference, highlights, tracks, booths, '#splash#program'] do
|
||||
%section#program
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
.row
|
||||
.col-md-12
|
||||
%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
|
||||
Full Schedule
|
||||
.trapezoid
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
.container
|
||||
.row
|
||||
.col-md-12.text-center
|
||||
%h2 Sign Up for Snap<em>!</em>Con
|
||||
%br
|
||||
-# %h2
|
||||
-# Support
|
||||
-# = conference.title
|
||||
%h2
|
||||
Sign up for
|
||||
= conference.title
|
||||
!
|
||||
.row.row-centered
|
||||
- tickets.each do |ticket|
|
||||
.col-lg-4.col-md-3.col-sm-3.col-centered.col-top
|
||||
|
|
|
|||
|
|
@ -16,9 +16,8 @@
|
|||
%br
|
||||
%small
|
||||
= @event.subtitle
|
||||
- if @event.room&.url && @conference.user_registered?(current_user)
|
||||
%h3
|
||||
= link_to('Join Event', @event.room.url, target: '_blank')
|
||||
%h3
|
||||
= join_event_link(@event, current_user)
|
||||
.col-md-2
|
||||
%p{style: "margin-top: 20px"}
|
||||
- if can?(:update, @event) && @event.require_registration?
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
%h4
|
||||
- if(event.speakers.any?)
|
||||
presented by #{event.speaker_names}
|
||||
- if event.room&.url && @conference.user_registered?(current_user)
|
||||
%p
|
||||
= link_to('Join Event', event.room.url, target: '_blank')
|
||||
%h5
|
||||
= join_event_link(event, current_user)
|
||||
%p
|
||||
= 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
|
||||
- if event_schedule.present?
|
||||
%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.
|
||||
|
||||
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
|
||||
enable_extension "plpgsql"
|
||||
|
|
@ -407,7 +407,8 @@ ActiveRecord::Schema.define(version: 2020_07_15_034647) do
|
|||
t.string "name", null: false
|
||||
t.integer "size"
|
||||
t.integer "venue_id", null: false
|
||||
t.text "url"
|
||||
t.string "url"
|
||||
t.integer "order"
|
||||
end
|
||||
|
||||
create_table "schedules", force: :cascade do |t|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue