Merge pull request #35 from differentreality/fix_conference_registration_after_questions
fix registration page
This commit is contained in:
commit
120b812a53
7 changed files with 69 additions and 72 deletions
|
|
@ -6,16 +6,20 @@ class Admin::VolunteersController < ApplicationController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||||
@volunteers = @conference.registrations.joins(:vchoices).all
|
if @conference.use_vpositions
|
||||||
|
@volunteers = @conference.registrations.joins(:vchoices).uniq
|
||||||
|
else
|
||||||
|
@volunteers = @conference.registrations.where(:volunteer => true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
@conference = Conference.find_all_by_short_title(params[:conference_id]).first
|
||||||
begin
|
begin
|
||||||
@conference.update_attributes!(params[:conference])
|
@conference.update_attributes!(params[:conference])
|
||||||
redirect_to(admin_conference_volunteer_info_path(:conference_id => params[:conference_id]), :notice => "Volunteering options were successfully updated.")
|
redirect_to(admin_conference_volunteers_info_path(:conference_id => params[:conference_id]), :notice => "Volunteering options were successfully updated.")
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
redirect_to(admin_conference_volunteer_info_path(:conference_id => params[:conference_id]), :alert => "Volunteering options update failed: #{e.message}")
|
redirect_to(admin_conference_volunteers_info_path(:conference_id => params[:conference_id]), :alert => "Volunteering options update failed: #{e.message}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ class Conference < ActiveRecord::Base
|
||||||
:event_types_attributes, :registration_start_date, :registration_end_date, :logo,
|
:event_types_attributes, :registration_start_date, :registration_end_date, :logo,
|
||||||
:questions_attributes, :question_ids, :answers_attributes, :answer_ids,
|
:questions_attributes, :question_ids, :answers_attributes, :answer_ids,
|
||||||
:difficulty_levels_attributes, :use_difficulty_levels,
|
:difficulty_levels_attributes, :use_difficulty_levels,
|
||||||
:use_vpositions, :use_vdays, :vdays_attributes, :vpositions_attributes
|
:use_vpositions, :use_vdays, :vdays_attributes, :vpositions_attributes, :use_volunteers
|
||||||
|
|
||||||
has_paper_trail
|
has_paper_trail
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,27 @@
|
||||||
%table.table.table-striped.table-bordered.table-hover#speakertable
|
.well
|
||||||
%thead
|
%table.table.table-striped.table-bordered.table-hover#volunteerstable
|
||||||
%th First Name
|
%thead
|
||||||
%th Last Name
|
%th First Name
|
||||||
%th Email
|
%th Last Name
|
||||||
%th Mobile
|
%th Email
|
||||||
%th Languages
|
%th Mobile
|
||||||
%th Experience
|
%th Languages
|
||||||
%th Tshirt Size
|
%th Experience
|
||||||
%tbody
|
%th Tshirt Size
|
||||||
- @volunteers.each do |volunteer|
|
%tbody
|
||||||
%tr
|
- @volunteers.each do |volunteer|
|
||||||
%td= volunteer.first_name
|
%tr
|
||||||
%td= volunteer.last_name
|
%td= volunteer.first_name
|
||||||
%td= volunteer.email
|
%td= volunteer.last_name
|
||||||
%td= volunteer.mobile
|
%td= volunteer.email
|
||||||
%td= volunteer.languages
|
%td= volunteer.mobile
|
||||||
%td= volunteer.volunteer_experience
|
%td= volunteer.languages
|
||||||
%td= volunteer.tshirt
|
%td= volunteer.volunteer_experience
|
||||||
|
%td= volunteer.tshirt
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('#volunteerstable').dataTable({
|
||||||
|
"bPaginate": false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -7,9 +7,11 @@
|
||||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
.span5
|
= f.input :use_volunteers, :label => "Enable Volunteering"
|
||||||
= f.input :use_vdays, :label => false
|
.row-fluid
|
||||||
= dynamic_association :vdays, "Volunteer Days", f
|
.span6
|
||||||
.span5
|
= f.input :use_vdays, :label => false
|
||||||
= f.input :use_vpositions, :label => false
|
= dynamic_association :vdays, "Volunteer Days", f
|
||||||
= dynamic_association :vpositions, "Volunteer positions", f
|
.span6
|
||||||
|
= f.input :use_vpositions, :label => false
|
||||||
|
= dynamic_association :vpositions, "Volunteer positions", f
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,18 @@
|
||||||
%br
|
%br
|
||||||
= f.fields_for :person do |p|
|
= f.fields_for :person do |p|
|
||||||
= p.text_field :public_name, :for => :person
|
= p.text_field :public_name, :for => :person
|
||||||
- if @conference.use_supporter_levels? and @conference.supporter_levels.length > 0
|
|
||||||
|
- if @conference.questions
|
||||||
|
= render :partial => "questions", :locals => {:f => f}
|
||||||
|
%br
|
||||||
|
|
||||||
|
- if @conference.use_supporter_levels? && @conference.supporter_levels.length > 0
|
||||||
= f.semantic_fields_for :supporter_registration do |reg|
|
= f.semantic_fields_for :supporter_registration do |reg|
|
||||||
= reg.input :supporter_level, :as => :select, :collection => @conference.supporter_levels
|
= reg.input :supporter_level, :as => :select, :collection => @conference.supporter_levels
|
||||||
= reg.input :code, :label => "Confirmation or registration code (if applicable)"
|
= reg.input :code, :label => "Confirmation or registration code (if applicable)"
|
||||||
%span#supporter-link.help-block
|
%span#supporter-link.help-block
|
||||||
= f.input :attending_with_partner, :label => false
|
|
||||||
= f.input :using_affiliated_lodging, :label => false
|
= f.input :other_special_needs, :label => "Any other needs or comments?", :input_html => {:rows => 2, :class => "span6"}
|
||||||
= f.input :handicapped_access_required, :label => false
|
|
||||||
= f.input :other_special_needs, :label => "Any other special needs?", :input_html => {:rows => 2, :class => "span6"}
|
|
||||||
|
|
||||||
- if @workshops.count > 0
|
- if @workshops.count > 0
|
||||||
=f.inputs "Register to workshops" do
|
=f.inputs "Register to workshops" do
|
||||||
|
|
@ -38,6 +41,11 @@
|
||||||
%br Yes, I'll be attending...
|
%br Yes, I'll be attending...
|
||||||
%br
|
%br
|
||||||
= f.input :social_events, :as => :check_boxes, :label => false
|
= f.input :social_events, :as => :check_boxes, :label => false
|
||||||
|
- if @conference.use_dietary_choices?
|
||||||
|
= f.inputs "Food" do
|
||||||
|
= f.input :dietary_choice, :collection => [["None", nil]] + @conference.dietary_choices.map {|x| [x.title, x.id]},
|
||||||
|
:include_blank => false, :label => "Special Dietary Restriction"
|
||||||
|
= f.input :other_dietary_choice, :input_html => {:rows => "2"}, :label => "Other Dietary Restictions (please describe)"
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$("#registration_supporter_registration_attributes_supporter_level_id").change(function () {
|
$("#registration_supporter_registration_attributes_supporter_level_id").change(function () {
|
||||||
|
|
@ -67,5 +75,4 @@
|
||||||
onSelect: function(selected) {
|
onSelect: function(selected) {
|
||||||
$("#registration-arrival-datepicker").datepicker("option","maxDate", selected)
|
$("#registration-arrival-datepicker").datepicker("option","maxDate", selected)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1,51 +1,22 @@
|
||||||
.row
|
.row
|
||||||
.span12
|
.span12
|
||||||
= semantic_form_for(@registration, :url => register_conference_path(@conference.short_title), :html => { :method => :put }) do |f|
|
= semantic_form_for(@registration, :url => register_conference_path(@conference.short_title), :html => { :method => :put }) do |f|
|
||||||
= f.inputs :name => "Your Details" do
|
|
||||||
%br
|
|
||||||
Your public name (required)
|
|
||||||
%br
|
|
||||||
= f.fields_for :person do |p|
|
|
||||||
= p.text_field :public_name, :for => :person
|
|
||||||
|
|
||||||
- if @conference.questions
|
|
||||||
= render :partial => "questions", :locals => {:f => f}
|
|
||||||
%br
|
|
||||||
|
|
||||||
- if @conference.use_supporter_levels? && @conference.supporter_levels.length > 0
|
|
||||||
= f.semantic_fields_for :supporter_registration do |reg|
|
|
||||||
= reg.input :supporter_level, :as => :select, :collection => @conference.supporter_levels
|
|
||||||
= reg.input :code, :label => "Confirmation or registration code (if applicable)"
|
|
||||||
%span#supporter-link.help-block
|
|
||||||
|
|
||||||
= f.input :other_special_needs, :label => "Any other needs or comments?", :input_html => {:rows => 2, :class => "span6"}
|
|
||||||
|
|
||||||
- if @workshops.count > 0
|
|
||||||
=f.inputs "Register to workshops" do
|
|
||||||
= f.input :events, :as => :check_boxes, :label => false, :collection => @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" }
|
|
||||||
- if @conference.social_events.count > 0
|
|
||||||
= f.inputs "Are you planning to attend any of the parties?" do
|
|
||||||
%br Yes, I'll be attending...
|
|
||||||
%br
|
|
||||||
= f.input :social_events, :as => :check_boxes, :label => false
|
|
||||||
.tabbable
|
.tabbable
|
||||||
%ul.nav.nav-tabs
|
%ul.nav.nav-tabs
|
||||||
%li.active
|
%li.active
|
||||||
= link_to "Register", "#register-content", "data-toggle"=>"tab"
|
= link_to "Register", "#register-content", "data-toggle"=>"tab"
|
||||||
%li
|
- if @conference.use_volunteers
|
||||||
= link_to "Volunteer", "#volunteer-content", "data-toggle"=>"tab"
|
%li
|
||||||
|
= link_to "Volunteer", "#volunteer-content", "data-toggle"=>"tab"
|
||||||
.tab-content
|
.tab-content
|
||||||
#register-content.tab-pane.active
|
#register-content.tab-pane.active
|
||||||
= render 'conference_registration/registration', :f => f
|
= render 'conference_registration/registration', :f => f
|
||||||
#volunteer-content.tab-pane
|
- if @conference.use_volunteers
|
||||||
= render 'conference_registration/volunteer', :f => f
|
#volunteer-content.tab-pane
|
||||||
|
= render 'conference_registration/volunteer', :f => f
|
||||||
- if @registered
|
- if @registered
|
||||||
= f.action :submit, :button_html => { :value => "Update Registration", :class => "btn btn-primary" }
|
= f.action :submit, :button_html => { :value => "Update Registration", :class => "btn btn-primary" }
|
||||||
= link_to "Unregister", register_conference_path(@conference.short_title),:method => :delete, :class => "btn btn-danger",
|
= link_to "Unregister", register_conference_path(@conference.short_title),:method => :delete, :class => "btn btn-danger",
|
||||||
:confirm => "Are you sure you want to unregister?"
|
:confirm => "Are you sure you want to unregister?"
|
||||||
- else
|
- else
|
||||||
= f.action :submit, :button_html => { :value => "Register", :class => "btn btn-primary" }
|
= f.action :submit, :button_html => { :value => "Register", :class => "btn btn-primary" }
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddUseVolunteersToConference < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :conferences, :use_volunteers, :boolean
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue