From 64b2b8b3f8a62be1a4161d957c06a958debe89cc Mon Sep 17 00:00:00 2001 From: Stella Date: Wed, 1 Jan 2014 11:39:59 +0200 Subject: [PATCH] Volunteers, positions and days and volunteers list for admin, volunteering option for attendees --- .../admin/volunteers_controller.rb | 23 +++++ app/models/conference.rb | 8 +- app/models/person.rb | 7 +- app/models/registration.rb | 7 +- app/models/vchoice.rb | 6 ++ app/models/vday.rb | 8 ++ app/models/vposition.rb | 10 +++ app/views/admin/conference/_sidebar.html.haml | 5 +- .../admin/volunteers/_vday_fields.html.erb | 7 ++ .../volunteers/_volunteers_table.html.haml | 19 ++++ .../volunteers/_vposition_fields.html.erb | 8 ++ app/views/admin/volunteers/index.html.haml | 15 ++++ app/views/admin/volunteers/show.html.haml | 6 ++ .../_registration.html.haml | 76 ++++++++++++++++ .../_volunteer.html.haml | 16 ++++ .../register.html.haml | 87 +++---------------- .../registrations/_volunteerperson.html.haml | 7 ++ app/views/devise/registrations/edit.html.haml | 2 + app/views/layouts/_navigation.html.haml | 10 +++ config/routes.rb | 3 + ...21094246_add_volunteer_to_registrations.rb | 5 ++ ...d_volunteer_experience_to_registrations.rb | 5 ++ .../20130821102047_add_tshirt_to_people.rb | 5 ++ .../20130821102108_add_mobile_to_people.rb | 5 ++ .../20130821102404_add_languages_to_people.rb | 5 ++ ...02543_add_use_vpositions_to_conferences.rb | 5 ++ ...0821102618_add_use_vdays_to_conferences.rb | 5 ++ .../20130821133651_create_vpositions.rb | 15 ++++ db/migrate/20130821133850_create_vdays.rb | 15 ++++ db/migrate/20131228214532_create_vchoices.rb | 8 ++ .../20131229072532_registrations_vchoices.rb | 11 +++ 31 files changed, 335 insertions(+), 79 deletions(-) create mode 100644 app/controllers/admin/volunteers_controller.rb create mode 100644 app/models/vchoice.rb create mode 100644 app/models/vday.rb create mode 100644 app/models/vposition.rb create mode 100644 app/views/admin/volunteers/_vday_fields.html.erb create mode 100644 app/views/admin/volunteers/_volunteers_table.html.haml create mode 100644 app/views/admin/volunteers/_vposition_fields.html.erb create mode 100644 app/views/admin/volunteers/index.html.haml create mode 100644 app/views/admin/volunteers/show.html.haml create mode 100644 app/views/conference_registration/_registration.html.haml create mode 100644 app/views/conference_registration/_volunteer.html.haml create mode 100644 app/views/devise/registrations/_volunteerperson.html.haml create mode 100644 db/migrate/20130821094246_add_volunteer_to_registrations.rb create mode 100644 db/migrate/20130821102003_add_volunteer_experience_to_registrations.rb create mode 100644 db/migrate/20130821102047_add_tshirt_to_people.rb create mode 100644 db/migrate/20130821102108_add_mobile_to_people.rb create mode 100644 db/migrate/20130821102404_add_languages_to_people.rb create mode 100644 db/migrate/20130821102543_add_use_vpositions_to_conferences.rb create mode 100644 db/migrate/20130821102618_add_use_vdays_to_conferences.rb create mode 100644 db/migrate/20130821133651_create_vpositions.rb create mode 100644 db/migrate/20130821133850_create_vdays.rb create mode 100644 db/migrate/20131228214532_create_vchoices.rb create mode 100644 db/migrate/20131229072532_registrations_vchoices.rb diff --git a/app/controllers/admin/volunteers_controller.rb b/app/controllers/admin/volunteers_controller.rb new file mode 100644 index 00000000..ec9de1c9 --- /dev/null +++ b/app/controllers/admin/volunteers_controller.rb @@ -0,0 +1,23 @@ +class Admin::VolunteersController < ApplicationController + def index + @conference = Conference.find_all_by_short_title(params[:conference_id]).first + render :index + end + + def show + @conference = Conference.find_all_by_short_title(params[:conference_id]).first + @volunteers = @conference.registrations.joins(:vchoices).all + end + + def update + @conference = Conference.find_all_by_short_title(params[:conference_id]).first +# @conference.update_attributes(params[:conference]) +# redirect_to admin_conference_volunteers_path(@conference.short_title) + begin + @conference.update_attributes!(params[:conference]) + redirect_to(admin_conference_volunteer_options_path(:conference_id => params[:conference_id]), :notice => "Volunteering options were successfully updated.") + rescue Exception => e + redirect_to(admin_conference_volunteer_options_path(:conference_id => params[:conference_id]), :alert => "Volunteering options update failed: #{e.message}") + end + end +end diff --git a/app/models/conference.rb b/app/models/conference.rb index d1be19fb..31acdb80 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -2,7 +2,8 @@ class Conference < ActiveRecord::Base attr_accessible :title, :short_title, :social_tag, :contact_email, :timezone, :html_export_path, :start_date, :end_date, :rooms_attributes, :tracks_attributes, :dietary_choices_attributes, :use_dietary_choices, :use_supporter_levels, :supporter_levels_attributes, :social_events_attributes, - :event_types_attributes, :registration_start_date, :registration_end_date, :logo + :event_types_attributes, :registration_start_date, :registration_end_date, :logo, :use_vpositions, :use_vdays, :vdays_attributes, + :vpositions_attributes has_paper_trail @@ -17,6 +18,9 @@ class Conference < ActiveRecord::Base has_many :tracks, :dependent => :destroy has_many :rooms, :dependent => :destroy has_many :registrations, :dependent => :destroy + has_many :vdays, :dependent => :destroy + has_many :vpositions, :dependent => :destroy + has_many :vchoices, :dependent => :destroy belongs_to :venue @@ -28,6 +32,8 @@ class Conference < ActiveRecord::Base accepts_nested_attributes_for :supporter_levels, :allow_destroy => true accepts_nested_attributes_for :event_types, :allow_destroy => true accepts_nested_attributes_for :email_settings + accepts_nested_attributes_for :vdays, :allow_destroy => true + accepts_nested_attributes_for :vpositions, :allow_destroy => true has_attached_file :logo, :styles => {:thumb => "100x100>", :large => "300x300>" } diff --git a/app/models/person.rb b/app/models/person.rb index a149bf23..04318f16 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -2,7 +2,7 @@ class Person < ActiveRecord::Base include Gravtastic gravtastic :size => 32 - attr_accessible :email, :first_name, :last_name, :public_name, :biography, :company, :avatar, :irc_nickname + attr_accessible :email, :first_name, :last_name, :public_name, :biography, :company, :avatar, :irc_nickname, :mobile, :tshirt, :languages, :volunteer_experience belongs_to :user, :inverse_of => :person has_many :event_people, :dependent => :destroy @@ -18,6 +18,7 @@ class Person < ActiveRecord::Base before_create :generate_guid before_save :set_public_name + before_save :languages_upcase has_attached_file :avatar, :styles => {:tiny => "16x16>", :small => "32x32>", :large => "128x128>"}, @@ -26,6 +27,10 @@ class Person < ActiveRecord::Base alias_attribute :affiliation, :company + def languages_upcase + self.languages = self.languages.upcase + end + def to_s if self.public_name.empty? self.first_name + " " + self.last_name diff --git a/app/models/registration.rb b/app/models/registration.rb index 92778f07..25e4062c 100644 --- a/app/models/registration.rb +++ b/app/models/registration.rb @@ -7,11 +7,12 @@ class Registration < ActiveRecord::Base has_one :supporter_level, :through => :supporter_registration has_and_belongs_to_many :social_events has_and_belongs_to_many :events + has_and_belongs_to_many :vchoices attr_accessible :person_id, :conference_id, :attending_social_events, :attending_with_partner, :using_affiliated_lodging, :arrival, :departure, :person_attributes, :other_dietary_choice, :dietary_choice_id, :handicapped_access_required, :supporter_registration_attributes, :social_event_ids, :other_special_needs, - :event_ids, :attended + :event_ids, :attended, :volunteer, :vchoice_ids accepts_nested_attributes_for :person accepts_nested_attributes_for :supporter_registration @@ -23,6 +24,10 @@ class Registration < ActiveRecord::Base delegate :email, :to => :person delegate :irc_nickname, :to => :person delegate :company, :to => :person + delegate :mobile, :to => :person + delegate :languages, :to => :person + delegate :volunteer_experience, :to => :person + delegate :tshirt, :to => :person alias_attribute :with_partner, :attending_with_partner alias_attribute :need_access, :handicapped_access_required diff --git a/app/models/vchoice.rb b/app/models/vchoice.rb new file mode 100644 index 00000000..cc09574a --- /dev/null +++ b/app/models/vchoice.rb @@ -0,0 +1,6 @@ +class Vchoice < ActiveRecord::Base + belongs_to :vday + belongs_to :vposition + + has_and_belongs_to_many :registrations +end diff --git a/app/models/vday.rb b/app/models/vday.rb new file mode 100644 index 00000000..2b94be8b --- /dev/null +++ b/app/models/vday.rb @@ -0,0 +1,8 @@ +class Vday < ActiveRecord::Base + attr_accessible :day, :description + + belongs_to :conference + + has_many :vchoices + has_many :vpositions, :through => :vchoices, :dependent => :destroy +end \ No newline at end of file diff --git a/app/models/vposition.rb b/app/models/vposition.rb new file mode 100644 index 00000000..9e6d5547 --- /dev/null +++ b/app/models/vposition.rb @@ -0,0 +1,10 @@ +class Vposition < ActiveRecord::Base + attr_accessible :title, :description, :date, :vday_ids + + belongs_to :conference + + has_many :vchoices + has_many :vdays, :through => :vchoices + + validates_presence_of :title, :vdays +end diff --git a/app/views/admin/conference/_sidebar.html.haml b/app/views/admin/conference/_sidebar.html.haml index 17c35727..c7b4164c 100644 --- a/app/views/admin/conference/_sidebar.html.haml +++ b/app/views/admin/conference/_sidebar.html.haml @@ -43,4 +43,7 @@ %li.active= link_to "Dietary Choices", "#" - else %li= link_to "Dietary Choices", admin_conference_dietary_list_path(@conference.short_title) - + - if activated == "volunteers" + %li.active= link_to "Volunteer Options", "#" + - else + %li= link_to "Volunteer Options", admin_conference_volunteer_options_path(@conference.short_title) \ No newline at end of file diff --git a/app/views/admin/volunteers/_vday_fields.html.erb b/app/views/admin/volunteers/_vday_fields.html.erb new file mode 100644 index 00000000..00943cc5 --- /dev/null +++ b/app/views/admin/volunteers/_vday_fields.html.erb @@ -0,0 +1,7 @@ +
+ <%= f.inputs do %> + <%= f.date_select :day %> + <%= f.input :description, :input_html => {:rows => "2", :class => "span8"} %> + <%= remove_association_link :vday, f %> + <% end %> +
\ No newline at end of file diff --git a/app/views/admin/volunteers/_volunteers_table.html.haml b/app/views/admin/volunteers/_volunteers_table.html.haml new file mode 100644 index 00000000..c2f9a4b4 --- /dev/null +++ b/app/views/admin/volunteers/_volunteers_table.html.haml @@ -0,0 +1,19 @@ +%table.table.table-striped.table-bordered.table-hover#speakertable + %thead + %th First Name + %th Last Name + %th Email + %th Mobile + %th Languages + %th Experience + %th Tshirt Size + %tbody + - @volunteers.each do |volunteer| + %tr + %td= volunteer.first_name + %td= volunteer.last_name + %td= volunteer.email + %td= volunteer.mobile + %td= volunteer.languages + %td= volunteer.volunteer_experience + %td= volunteer.tshirt \ No newline at end of file diff --git a/app/views/admin/volunteers/_vposition_fields.html.erb b/app/views/admin/volunteers/_vposition_fields.html.erb new file mode 100644 index 00000000..8756ccb4 --- /dev/null +++ b/app/views/admin/volunteers/_vposition_fields.html.erb @@ -0,0 +1,8 @@ +
+ <%= f.inputs do %> + <%= f.input :title %> + <%= f.input :description, :input_html => {:rows => "2", :class => "span8"}%> + <%= f.input :vdays, :collection => @conference.vdays.map {|x| [x.day, x.id]}, :label => "Position is required for the following days:"%> + <%= remove_association_link :vposition, f %> + <% end %> +
diff --git a/app/views/admin/volunteers/index.html.haml b/app/views/admin/volunteers/index.html.haml new file mode 100644 index 00000000..2f82b3f2 --- /dev/null +++ b/app/views/admin/volunteers/index.html.haml @@ -0,0 +1,15 @@ +.container-fluid + .row-fluid + .span3 + = render 'admin/conference/sidebar', :activated => "Volunteers" + .span9 + = semantic_form_for(@conference, :url => admin_conference_volunteer_options_update_path(@conference.short_title)) do |f| + = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} + %br + %br + .span5 + = f.input :use_vdays, :label => false + = dynamic_association :vdays, "Volunteer Days", f + .span5 + = f.input :use_vpositions, :label => false + = dynamic_association :vpositions, "Volunteer positions", f \ No newline at end of file diff --git a/app/views/admin/volunteers/show.html.haml b/app/views/admin/volunteers/show.html.haml new file mode 100644 index 00000000..4bb0a3a6 --- /dev/null +++ b/app/views/admin/volunteers/show.html.haml @@ -0,0 +1,6 @@ +- if @volunteers.count > 0 + %h3= "Volunteers (#{@volunteers.count})" + %br + = render :partial => "volunteers_table" +- else + %h3 There are no volunteers yet! \ No newline at end of file diff --git a/app/views/conference_registration/_registration.html.haml b/app/views/conference_registration/_registration.html.haml new file mode 100644 index 00000000..ced7e675 --- /dev/null +++ b/app/views/conference_registration/_registration.html.haml @@ -0,0 +1,76 @@ +.row + .span12 + %h3 + Registration for + = @conference.title +- if @person.proposal_count(@conference) > 0 + .row + .span12 + %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 + .span12 + = 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.use_supporter_levels? + = 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 :attending_with_partner, :label => false + = f.input :using_affiliated_lodging, :label => false + = 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 + =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 + - 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 + $("#registration_supporter_registration_attributes_supporter_level_id").change(function () { + var str = ""; + #{generate_supporter_level_js @conference} + $("#supporter-link").html(str); + }) + .trigger('change'); + + $("#registration-arrival-datepicker").datetimepicker({ + dateFormat: "yy-mm-dd", + timeFormat: "HH:mm", + showSecond: false, + numberOfMonths: 1, + defaultDate: '#{@conference.start_date.yesterday.strftime('%Y-%m-%d')}', + onSelect: function(selected) { + $("#registration-departure-datepicker").datepicker("option","minDate", selected) + } + }); + + $("#registration-departure-datepicker").datetimepicker({ + dateFormat: "yy-mm-dd", + timeFormat: "HH:mm", + showSecond: false, + numberOfMonths: 1, + defaultDate: '#{@conference.end_date.tomorrow.strftime('%Y-%m-%d')}', + onSelect: function(selected) { + $("#registration-arrival-datepicker").datepicker("option","maxDate", selected) + } + }); + diff --git a/app/views/conference_registration/_volunteer.html.haml b/app/views/conference_registration/_volunteer.html.haml new file mode 100644 index 00000000..857e95a5 --- /dev/null +++ b/app/views/conference_registration/_volunteer.html.haml @@ -0,0 +1,16 @@ +.row + .span12 + = f.input :volunteer, :label => "Click here if you want to become a volunteer at #{@conference.short_title}", :input_html => {:maxlength => 15, :size => 40} + = f.fields_for :person do |p| + = render :partial => 'devise/registrations/volunteerperson', :locals => {:p => p} + + %br + - if @conference.vpositions.count > 0 + %h4 + %u Positions that require volunteers: + - @conference.vpositions.each do |pos| + %p{:style => "font-weight:bold"} + = pos.title + = "(#{pos.description})" if pos.description + + = f.input :vchoices, :collection => pos.vchoices.map {|x| [x.vday.day, x.id]}, :label => "Choose days to volunteer:" diff --git a/app/views/conference_registration/register.html.haml b/app/views/conference_registration/register.html.haml index 0304c80c..96f44c84 100644 --- a/app/views/conference_registration/register.html.haml +++ b/app/views/conference_registration/register.html.haml @@ -1,83 +1,20 @@ -.row - .span12 - %h3 - Registration for - = @conference.title -- if @person.proposal_count(@conference) > 0 - .row - .span12 - %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 .span12 = 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.use_supporter_levels? - = 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 :attending_with_partner, :label => false - = f.input :using_affiliated_lodging, :label => false - = f.input :handicapped_access_required, :label => false - = f.input :other_special_needs, :label => "Any other special needs?", :input_html => {:rows => 2} - - - 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 - - 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)" + .tabbable + %ul.nav.nav-tabs + %li.active + = link_to "Register", "#register-content", "data-toggle"=>"tab" + %li + = link_to "Volunteer", "#volunteer-content", "data-toggle"=>"tab" + .tab-content + #register-content.tab-pane.active + = render 'conference_registration/registration', :f => f + #volunteer-content.tab-pane + = render 'conference_registration/volunteer', :f => f - if @registered = 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", :confirm => "Are you sure you want to unregister?" - else - = f.action :submit, :button_html => { :value => "Register", :class => "btn btn-primary" } - -:javascript - $("#registration_supporter_registration_attributes_supporter_level_id").change(function () { - var str = ""; - #{generate_supporter_level_js @conference} - $("#supporter-link").html(str); - }) - .trigger('change'); - - $("#registration-arrival-datepicker").datetimepicker({ - dateFormat: "yy-mm-dd", - timeFormat: "HH:mm", - showSecond: false, - numberOfMonths: 1, - defaultDate: '#{@conference.start_date.yesterday.strftime('%Y-%m-%d')}', - onSelect: function(selected) { - $("#registration-departure-datepicker").datepicker("option","minDate", selected) - } - }); - - $("#registration-departure-datepicker").datetimepicker({ - dateFormat: "yy-mm-dd", - timeFormat: "HH:mm", - showSecond: false, - numberOfMonths: 1, - defaultDate: '#{@conference.end_date.tomorrow.strftime('%Y-%m-%d')}', - onSelect: function(selected) { - $("#registration-arrival-datepicker").datepicker("option","maxDate", selected) - } - }); - + = f.action :submit, :button_html => { :value => "Register", :class => "btn btn-primary" } \ No newline at end of file diff --git a/app/views/devise/registrations/_volunteerperson.html.haml b/app/views/devise/registrations/_volunteerperson.html.haml new file mode 100644 index 00000000..bf363099 --- /dev/null +++ b/app/views/devise/registrations/_volunteerperson.html.haml @@ -0,0 +1,7 @@ +=p.input :mobile, :label => "Mobile No (Include country code)", :input_html => {:placeholder => "Eg. +336812345679"}, :hint => "Only visible to org team & volunteer coordinator" + +=p.input :tshirt, :label => "Tshirt Size", :collection => [["Choose", nil],["XS","XS"],["S","S"],["M", "M"], ["L", "L"], ["XL", "XL"], ["XXL", "XXL"], ["XXXL", "XXXL"], ["Girl-S","Girl-s"], ["Girl-M","Girl-M"], ["Girl-L","Girl-L"], ["Girl-XL","Girl-XL"]] + +=p.input :languages, :label => "Which languages do you speak", :hint => "Start from the one you speak best and use 2 letter symbolization, eg. EN, GR, DE" + += p.input :volunteer_experience, :label => "Do you have any past experience?", :input_html => {:rows => 3, :class => "span6"} \ No newline at end of file diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml index a68a1e0d..a5dbb165 100644 --- a/app/views/devise/registrations/edit.html.haml +++ b/app/views/devise/registrations/edit.html.haml @@ -16,6 +16,8 @@ words. Biographies are limited to 150 words. %br %br + = render :partial => 'devise/registrations/volunteerperson', :locals => {:p => p} + = f.inputs :name => "Account" do = f.input :email, :required => false = f.input :password, :hint => "(Leave blank if you don't want to change it)", :input_html => {:autocomplete => "off"} diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index 5824c652..0ee09c2e 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -63,6 +63,16 @@ = link_to(admin_conference_stats_path(@conference.short_title)) do %i.icon-tasks Statistics + - if current_page?(admin_conference_volunteers_list_path(@conference.short_title)) + %li.active + = link_to('#') do + %i.icon-user + Volunteers + - else + %li + = link_to(admin_conference_volunteers_list_path(@conference.short_title)) do + %i.icon-user + Volunteers %li = link_to(admin_conference_schedule_path(@conference.short_title), :target => "_blank") do %i.icon-calendar diff --git a/config/routes.rb b/config/routes.rb index a5451c60..fabe3340 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -30,6 +30,9 @@ Osem::Application.routes.draw do put "/tracks" => "tracks#update", :as => "tracks_update" get "/dietary_choices" => "dietchoices#show", :as => "dietary_list" put "/dietary_choices" => "dietchoices#update", :as => "dietary_update" + get "/volunteers_list" => "volunteers#show" + get "/volunteers" => "volunteers#index", :as => "volunteer_options" + put "/volunteers" => "volunteers#update", :as => "volunteer_options_update" get "/cfp" => "callforpapers#show", :as => "cfp_info" put "/cfp" => "callforpapers#update", :as => "cfp_update" post "/cfp" => "callforpapers#create", :as => "cfp_create" diff --git a/db/migrate/20130821094246_add_volunteer_to_registrations.rb b/db/migrate/20130821094246_add_volunteer_to_registrations.rb new file mode 100644 index 00000000..98a2e3fe --- /dev/null +++ b/db/migrate/20130821094246_add_volunteer_to_registrations.rb @@ -0,0 +1,5 @@ +class AddVolunteerToRegistrations < ActiveRecord::Migration + def change + add_column :registrations, :volunteer, :boolean + end +end diff --git a/db/migrate/20130821102003_add_volunteer_experience_to_registrations.rb b/db/migrate/20130821102003_add_volunteer_experience_to_registrations.rb new file mode 100644 index 00000000..b725d532 --- /dev/null +++ b/db/migrate/20130821102003_add_volunteer_experience_to_registrations.rb @@ -0,0 +1,5 @@ +class AddVolunteerExperienceToRegistrations < ActiveRecord::Migration + def change + add_column :people, :volunteer_experience, :text + end +end diff --git a/db/migrate/20130821102047_add_tshirt_to_people.rb b/db/migrate/20130821102047_add_tshirt_to_people.rb new file mode 100644 index 00000000..9519dc91 --- /dev/null +++ b/db/migrate/20130821102047_add_tshirt_to_people.rb @@ -0,0 +1,5 @@ +class AddTshirtToPeople < ActiveRecord::Migration + def change + add_column :people, :tshirt, :string + end +end diff --git a/db/migrate/20130821102108_add_mobile_to_people.rb b/db/migrate/20130821102108_add_mobile_to_people.rb new file mode 100644 index 00000000..f4e9ae68 --- /dev/null +++ b/db/migrate/20130821102108_add_mobile_to_people.rb @@ -0,0 +1,5 @@ +class AddMobileToPeople < ActiveRecord::Migration + def change + add_column :people, :mobile, :string + end +end diff --git a/db/migrate/20130821102404_add_languages_to_people.rb b/db/migrate/20130821102404_add_languages_to_people.rb new file mode 100644 index 00000000..2ffbbb3b --- /dev/null +++ b/db/migrate/20130821102404_add_languages_to_people.rb @@ -0,0 +1,5 @@ +class AddLanguagesToPeople < ActiveRecord::Migration + def change + add_column :people, :languages, :string + end +end diff --git a/db/migrate/20130821102543_add_use_vpositions_to_conferences.rb b/db/migrate/20130821102543_add_use_vpositions_to_conferences.rb new file mode 100644 index 00000000..f78ccd18 --- /dev/null +++ b/db/migrate/20130821102543_add_use_vpositions_to_conferences.rb @@ -0,0 +1,5 @@ +class AddUseVpositionsToConferences < ActiveRecord::Migration + def change + add_column :conferences, :use_vpositions, :boolean + end +end diff --git a/db/migrate/20130821102618_add_use_vdays_to_conferences.rb b/db/migrate/20130821102618_add_use_vdays_to_conferences.rb new file mode 100644 index 00000000..70af09c4 --- /dev/null +++ b/db/migrate/20130821102618_add_use_vdays_to_conferences.rb @@ -0,0 +1,5 @@ +class AddUseVdaysToConferences < ActiveRecord::Migration + def change + add_column :conferences, :use_vdays, :boolean + end +end diff --git a/db/migrate/20130821133651_create_vpositions.rb b/db/migrate/20130821133651_create_vpositions.rb new file mode 100644 index 00000000..10c15263 --- /dev/null +++ b/db/migrate/20130821133651_create_vpositions.rb @@ -0,0 +1,15 @@ +class CreateVpositions < ActiveRecord::Migration + def up + create_table :vpositions do |t| + t.references :conference + t.string :title, :null => false + t.text :description + + t.timestamps + end + end + + def down + drop_table :vpositions + end +end diff --git a/db/migrate/20130821133850_create_vdays.rb b/db/migrate/20130821133850_create_vdays.rb new file mode 100644 index 00000000..c4d83d4c --- /dev/null +++ b/db/migrate/20130821133850_create_vdays.rb @@ -0,0 +1,15 @@ +class CreateVdays < ActiveRecord::Migration + def up + create_table :vdays do |t| + t.references :conference + t.date :day + t.text :description + + t.timestamps + end + end + + def down + drop_table :vdays + end +end diff --git a/db/migrate/20131228214532_create_vchoices.rb b/db/migrate/20131228214532_create_vchoices.rb new file mode 100644 index 00000000..04fabb75 --- /dev/null +++ b/db/migrate/20131228214532_create_vchoices.rb @@ -0,0 +1,8 @@ +class CreateVchoices < ActiveRecord::Migration + def change + create_table :vchoices do |t| + t.references :vday + t.references :vposition + end + end +end diff --git a/db/migrate/20131229072532_registrations_vchoices.rb b/db/migrate/20131229072532_registrations_vchoices.rb new file mode 100644 index 00000000..76f430e4 --- /dev/null +++ b/db/migrate/20131229072532_registrations_vchoices.rb @@ -0,0 +1,11 @@ +class RegistrationsVchoices < ActiveRecord::Migration + def up + create_table :registrations_vchoices, :id => false do |t| + t.references :registration, :vchoice + end + end + + def down + drop_table :registrations_vchoices + end +end