Various small fixes for the participant UI
This commit is contained in:
parent
b6abe96279
commit
d13efa5f52
31 changed files with 287 additions and 279 deletions
|
|
@ -1,23 +1,23 @@
|
|||
.container
|
||||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Registration for
|
||||
= @conference.title
|
||||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f|
|
||||
.tabbable
|
||||
%ul.nav.nav-tabs
|
||||
%li.active
|
||||
= link_to 'Register', '#register-content', 'data-toggle' => 'tab'
|
||||
- if @conference.use_volunteers
|
||||
%li
|
||||
= link_to 'Volunteer', '#volunteer-content', 'data-toggle' => 'tab'
|
||||
.tab-content
|
||||
#register-content.tab-pane.active
|
||||
= render 'conference_registrations/registration', f: f
|
||||
- if @conference.use_volunteers
|
||||
#volunteer-content.tab-pane
|
||||
= render 'conference_registrations/volunteer', f: f
|
||||
- if @conference.user_registered?(current_user)
|
||||
= f.action :submit, button_html: { value: 'Update Registration', class: 'btn btn-primary' }
|
||||
= link_to 'Unregister', conference_conference_registrations_path(@conference.short_title),
|
||||
method: :delete, class: 'btn btn-danger', confirm: 'Are you sure you want to unregister?'
|
||||
- else
|
||||
= f.action :submit, button_html: { value: 'Register', class: 'btn btn-primary', id: 'register' }
|
||||
- if @conference.questions.any?
|
||||
= render partial: 'questions', locals: { f: f }
|
||||
- if @conference.events.workshops.any?
|
||||
=f.inputs 'Register to Workshops' do
|
||||
= f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops
|
||||
= f.inputs 'Your Travel Info' do
|
||||
= f.input :arrival, as: :string, label: 'Your arrival time', input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' }
|
||||
= f.input :departure, as: :string, label: 'Your departure time', input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' }
|
||||
%p.pull-right
|
||||
- if @conference.user_registered?(current_user)
|
||||
= f.action :submit, button_html: { value: 'Update Registration', class: 'btn btn-primary' }
|
||||
- else
|
||||
= f.action :submit, button_html: { value: 'Register', class: 'btn btn-primary', id: 'register' }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
- @conference.questions.each do |q|
|
||||
%h5
|
||||
= "Q: #{q.title}"
|
||||
- if q.question_type.id == 1 || q.question_type.id == 2 # yes/no or single choice
|
||||
= f.input :qanswers, :collection => q.qanswers, :as => :select, :input_html => { :multiple => false }, :label => false, :include_blank => "Please make your choice",
|
||||
:member_label => Proc.new {|a| a.answer.title}
|
||||
|
||||
- if q.question_type.id == 3 # multiple choice
|
||||
= f.input :qanswers, :collection => q.qanswers, :as => :check_boxes, :label => false,
|
||||
:member_label => Proc.new {|a| a.answer.title}
|
||||
= f.inputs 'Additional Info' do
|
||||
- if q.question_type.id == 1 || q.question_type.id == 2 # yes/no or single choice
|
||||
= f.input :qanswers, :collection => q.qanswers, :as => :select, :input_html => { :multiple => false, class: 'col-sm-10' }, label: q.title, :include_blank => "Please make your choice",
|
||||
:member_label => Proc.new {|a| a.answer.title}
|
||||
- if q.question_type.id == 3 # multiple choice
|
||||
= f.input :qanswers, :collection => q.qanswers, :as => :check_boxes, :input_html => { class: 'col-sm-2' }, :label => false,
|
||||
:member_label => Proc.new {|a| a.answer.title}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
.row
|
||||
.col-md-12
|
||||
%h3
|
||||
Registration for
|
||||
= @conference.title
|
||||
- if current_user.proposal_count(@conference) > 0
|
||||
.row
|
||||
.col-md-12
|
||||
%i
|
||||
Please note: Registration is not automatically performed for speakers. If you're scheduled to speak at the conference, you still need to register!
|
||||
.row
|
||||
.col-md-12
|
||||
= f.inputs name: 'Your Details' do
|
||||
- if @conference.questions
|
||||
= render partial: 'questions', locals: { f: f }
|
||||
%br
|
||||
|
||||
- if @conference.events.workshops.any?
|
||||
=f.inputs 'Register to Workshops' do
|
||||
= f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops
|
||||
|
||||
= f.inputs 'Travel Info' do
|
||||
= f.input :arrival, as: :string, input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' }
|
||||
= f.input :departure, as: :string, input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' }
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
%table.table.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th Ticket
|
||||
%th.text-center Quantity
|
||||
%th.text-center Price
|
||||
%th.text-center Total
|
||||
%th
|
||||
%tbody
|
||||
- tickets.each do |ticket|
|
||||
%tr
|
||||
%td.col-sm-8.col-md-6
|
||||
.media
|
||||
.media-body
|
||||
%h4.media-heading
|
||||
= ticket.title
|
||||
%h5.media-heading
|
||||
-if !ticket.description.blank?
|
||||
= markdown(ticket.description)
|
||||
%td.col-sm-1.col-md-1.text-center
|
||||
= ticket.quantity_bought_by(current_user)
|
||||
%td.col-sm-1.col-md-1.text-center
|
||||
= humanized_money_with_symbol ticket.price
|
||||
%td.col-sm-1.col-md-1.text-center
|
||||
%strong
|
||||
= ticket.total_price(current_user)
|
||||
%td.col-sm-1.col-md-1.text-center
|
||||
= link_to conference_ticket_purchase_path(@conference.short_title, ticket.id),
|
||||
method: :delete, class: 'btn btn-danger',
|
||||
data: { confirm: "Do you really want to delete the #{ticket.title} for #{@conference.title}?" } do
|
||||
Delete
|
||||
%i.fa.fa-trash-o
|
||||
%tr
|
||||
%td
|
||||
%td
|
||||
%td
|
||||
%td.col-sm-1.col-md-1.text-center
|
||||
%h4
|
||||
Total
|
||||
%td.col-sm-1.col-md-1.text-center
|
||||
%h4
|
||||
%strong
|
||||
- if @total_price.cents == -1
|
||||
not-calculable
|
||||
- else
|
||||
= humanized_money_with_symbol Ticket.total_price(@conference, current_user)
|
||||
|
|
@ -3,117 +3,136 @@
|
|||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Registration for
|
||||
= @conference.title
|
||||
%p.text-muted
|
||||
-if @conference.venue
|
||||
at
|
||||
%strong
|
||||
= "#{@conference.venue.name},"
|
||||
= "#{@conference.venue.street},"
|
||||
= "#{@conference.venue.city} / #{@conference.venue.country_name}."
|
||||
%small
|
||||
= date_string(@conference.start_date, @conference.end_date)
|
||||
.row
|
||||
.col-md-6
|
||||
- if @conference.venue
|
||||
%p
|
||||
%small
|
||||
at
|
||||
= link_to @conference.venue.name
|
||||
,
|
||||
= link_to @conference.venue.address, "http://maps.google.com/maps?q=#{@conference.venue.address}"
|
||||
.col-md-4
|
||||
- if @conference.contact.facebook.present?
|
||||
= link_to "#{ @conference.contact.facebook }" do
|
||||
%i.fa.fa-facebook-square
|
||||
- if @conference.contact.twitter.present?
|
||||
= link_to "#{ @conference.contact.twitter }" do
|
||||
%i.fa.fa-twitter
|
||||
- if @conference.contact.instagram.present?
|
||||
= link_to "#{ @conference.contact.instagram }" do
|
||||
%i.fa.fa-instagram
|
||||
- if @conference.contact.googleplus.present?
|
||||
= link_to "#{ @conference.contact.googleplus }" do
|
||||
%i.fa.fa-google-plus-square
|
||||
.row
|
||||
.col-md-12
|
||||
- if @conference.tickets.any?
|
||||
%h3
|
||||
Tickets
|
||||
- if current_user.tickets.any?
|
||||
%p
|
||||
You have purchased the following tickets:
|
||||
= render partial: 'tickets_bought', locals: { tickets: current_user.tickets }
|
||||
- else
|
||||
= render partial: 'tickets', locals: { tickets: @conference.tickets }
|
||||
%p
|
||||
If you would like to buy more tickets, please click
|
||||
= link_to 'here', conference_tickets_path(@conference.short_title)
|
||||
.row
|
||||
.col-md-12
|
||||
- if @conference.speakers.confirmed.any?
|
||||
%h3
|
||||
= pluralize(@conference.speakers.confirmed.count, 'Speaker')
|
||||
- @conference.speakers.confirmed.limit(12).each_slice(4) do |slice|
|
||||
.row
|
||||
- slice.each do |speaker|
|
||||
.col-md-3
|
||||
.row
|
||||
.col-md-3
|
||||
= image_tag(speaker.gravatar_url(size: '25'),
|
||||
title: "Yo #{speaker.name}!",
|
||||
alt: '', 'class' => 'img-circle img-responsive text-center')
|
||||
.col-md-9
|
||||
%h4
|
||||
= speaker.name
|
||||
.row
|
||||
.col-md-12
|
||||
- if @conference.events.confirmed.any?
|
||||
%h3
|
||||
= pluralize(@conference.events.confirmed.count, 'Event')
|
||||
%ul.list-unstyled
|
||||
- @conference.events.confirmed.limit(10).each do |event|
|
||||
%li
|
||||
%h4
|
||||
= link_to event.title, conference_proposal_path(@conference.short_title, event.id)
|
||||
%strong
|
||||
presented by
|
||||
= event.speaker_names
|
||||
.row
|
||||
.col-md-12
|
||||
- if @conference.participants.any?
|
||||
%h3
|
||||
= pluralize(@conference.participants.count, 'Participant')
|
||||
- @conference.participants.limit(36).each_slice(12) do |slice|
|
||||
.row
|
||||
- slice.each do |participant|
|
||||
.col-md-1
|
||||
= image_tag(participant.gravatar_url(size: '25'),
|
||||
title: "Yo #{participant.name}!",
|
||||
alt: '', 'class' => 'img-circle img-responsive text-center')
|
||||
.row
|
||||
.col-md-12
|
||||
- if @registration
|
||||
%h2
|
||||
Congratulations! You are now registered for
|
||||
= "#{@conference.title}!"
|
||||
- if @conference.questions.any?
|
||||
%h3 Your answers to the registrations questions are:
|
||||
%h4
|
||||
%span.fa-stack
|
||||
%i.fa.fa-square-o.fa-stack-2x
|
||||
%i.fa.fa-plane.fa-stack-1x
|
||||
Travel Schedule
|
||||
%ul
|
||||
%li
|
||||
- if @registration.arrival.present?
|
||||
arrive at
|
||||
%strong
|
||||
= @registration.arrival.strftime('%A, %B %-d. %Y %H:%m')
|
||||
- else
|
||||
You haven't scheduled your arrival
|
||||
%li
|
||||
- if @registration.departure.present?
|
||||
depart at
|
||||
%strong
|
||||
= @registration.departure.strftime('%A, %B %-d. %Y %H:%m')
|
||||
- else
|
||||
You haven't scheduled your departure
|
||||
- if @conference.questions.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%h4
|
||||
%span.fa-stack
|
||||
%i.fa.fa-square-o.fa-stack-2x
|
||||
%i.fa.fa-info.fa-stack-1x
|
||||
Additional Info
|
||||
%ul
|
||||
- @conference.questions.each do |q|
|
||||
%p
|
||||
%b Question:
|
||||
= q.title
|
||||
%b Your Answer:
|
||||
- @registration.qanswers.where(:question_id => q.id).each do |qa|
|
||||
= qa.answer.title
|
||||
- if @workshops.any?
|
||||
%h3 You are registered for the following workshops:
|
||||
%ul.list-unstyled
|
||||
- @workshops.each do |workshop|
|
||||
%li
|
||||
%h4
|
||||
= link_to workshop.title, conference_proposal_path(@conference.short_title, workshop.id)
|
||||
%strong
|
||||
presented by
|
||||
= workshop.speaker_names
|
||||
%div
|
||||
= link_to 'Modify your Registration', edit_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success'
|
||||
%li
|
||||
%strong
|
||||
= q.title
|
||||
- if @registration.qanswers.any?
|
||||
- @registration.qanswers.where(:question_id => q.id).each do |qa|
|
||||
= qa.answer.title
|
||||
- else
|
||||
You haven't answered
|
||||
- if @workshops.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%h4
|
||||
%span.fa-stack
|
||||
%i.fa.fa-square-o.fa-stack-2x
|
||||
%i.fa.fa-check.fa-stack-1x
|
||||
Event Registrations
|
||||
%ul
|
||||
- @workshops.each do |workshop|
|
||||
%li
|
||||
= link_to workshop.title, conference_proposal_path(@conference.short_title, workshop.id)
|
||||
.row
|
||||
.col-md-12
|
||||
%h4
|
||||
%span.fa-stack
|
||||
%i.fa.fa-square-o.fa-stack-2x
|
||||
%i.fa.fa-ticket.fa-stack-1x
|
||||
Tickets
|
||||
-if @tickets.any?
|
||||
= "(#{@total_price} #{@tickets.first.price.symbol})"
|
||||
%ul
|
||||
- @tickets.each do |ticket|
|
||||
%li
|
||||
= ticket.quantity
|
||||
= ticket.title
|
||||
= word_pluralize(ticket.quantity, 'Ticket')
|
||||
for
|
||||
= humanized_money ticket.price
|
||||
= ticket.price.symbol
|
||||
= link_to conference_ticket_purchase_path(@conference.short_title, ticket.id), method: :delete,
|
||||
id: "ticket-#{ticket.id}-delete",
|
||||
class: 'btn btn-danger btn-xs',
|
||||
data: { confirm: "Do you really want to delete the #{ticket.title} ticket for #{@conference.title}?" } do
|
||||
%i.fa.fa-trash-o
|
||||
|
||||
%li
|
||||
- if @tickets.any?
|
||||
= link_to 'Buy more tickets', conference_tickets_path(@conference.short_title)
|
||||
- else
|
||||
You haven't bought any tickets.
|
||||
= link_to 'Please buy some tickets to support us!', conference_tickets_path(@conference.short_title)
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
-if @registration
|
||||
.btn-group-vertical.pull-right
|
||||
= link_to 'Edit your Registration', edit_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success'
|
||||
= link_to 'Unregister', conference_conference_registrations_path(@conference.short_title),
|
||||
method: :delete, class: 'btn btn-danger', confirm: 'Are you sure you want to unregister?'
|
||||
method: :delete, class: 'btn btn-danger btn-xs', confirm: 'Are you sure you want to unregister?'
|
||||
- else
|
||||
%p.lead
|
||||
= "Unfortunately you are not registered for #{@conference.title}. If you want to register click"
|
||||
= link_to 'here.', new_conference_conference_registrations_path(@conference.short_title)
|
||||
= link_to 'Register', new_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success btn-lg pull-right'
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
%small
|
||||
Meet the people of
|
||||
= @conference.short_title
|
||||
.col-md-4
|
||||
- if @conference.participants.any?
|
||||
%h4
|
||||
%span.fa-stack
|
||||
%i.fa.fa-square-o.fa-stack-2x
|
||||
%i.fa.fa-group.fa-stack-1x
|
||||
= @conference.participants.count
|
||||
Registered
|
||||
= word_pluralize(@conference.participants.count, 'Attendees')
|
||||
- @conference.participants.each do |participant|
|
||||
= image_tag(participant.gravatar_url(size: '25'), title: "#{participant.name}!", class: 'img-circle')
|
||||
.col-md-4.col-md-offset-2
|
||||
- if @conference.speakers.any?
|
||||
%h4
|
||||
%span.fa-stack
|
||||
%i.fa.fa-square-o.fa-stack-2x
|
||||
%i.fa.fa-microphone.fa-stack-1x
|
||||
= @conference.speakers.count
|
||||
Confirmed
|
||||
= word_pluralize(@conference.speakers.count, 'Speaker')
|
||||
- @conference.speakers.each do |speaker|
|
||||
= image_tag(speaker.gravatar_url(size: '25'), title: "#{speaker.name}!", class: 'img-circle')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue