Merge branch 'final_volunteers' of https://github.com/differentreality/osem into differentreality-final_volunteers

Conflicts:
	app/models/conference.rb
	app/models/registration.rb
	app/views/admin/conference/_sidebar.html.haml
	app/views/conference_registration/register.html.haml
This commit is contained in:
Henne Vogelsang 2014-03-03 10:52:24 +01:00
commit 14a896842b
31 changed files with 342 additions and 43 deletions

View file

@ -2,7 +2,12 @@ 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,
<<<<<<< HEAD
:event_types_attributes, :registration_start_date, :registration_end_date, :logo, :questions_attributes, :question_ids, :answers_attributes, :answer_ids, :difficulty_levels_attributes, :use_difficulty_levels
=======
:event_types_attributes, :registration_start_date, :registration_end_date, :logo, :use_vpositions, :use_vdays, :vdays_attributes,
:vpositions_attributes
>>>>>>> 64b2b8b3f8a62be1a4161d957c06a958debe89cc
has_paper_trail
@ -20,6 +25,9 @@ class Conference < ActiveRecord::Base
has_many :difficulty_levels, :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
@ -32,7 +40,12 @@ 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
<<<<<<< HEAD
accepts_nested_attributes_for :questions, :allow_destroy => true
=======
accepts_nested_attributes_for :vdays, :allow_destroy => true
accepts_nested_attributes_for :vpositions, :allow_destroy => true
>>>>>>> 64b2b8b3f8a62be1a4161d957c06a958debe89cc
has_attached_file :logo,
:styles => {:thumb => "100x100>", :large => "300x300>" }

View file

@ -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

View file

@ -8,10 +8,13 @@ class Registration < ActiveRecord::Base
has_and_belongs_to_many :social_events
has_and_belongs_to_many :events
has_and_belongs_to_many :qanswers
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, :qanswer_ids, :qanswers_attributes
:handicapped_access_required, :supporter_registration_attributes, :social_event_ids, :other_special_needs,
:event_ids, :attended, :volunteer, :vchoice_ids,
:qanswer_ids, :qanswers_attributes
accepts_nested_attributes_for :person
accepts_nested_attributes_for :supporter_registration
@ -24,6 +27,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 :other_needs, :other_special_needs
end

6
app/models/vchoice.rb Normal file
View file

@ -0,0 +1,6 @@
class Vchoice < ActiveRecord::Base
belongs_to :vday
belongs_to :vposition
has_and_belongs_to_many :registrations
end

8
app/models/vday.rb Normal file
View file

@ -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

10
app/models/vposition.rb Normal file
View file

@ -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