Volunteers, positions and days and volunteers list for admin, volunteering option for attendees
This commit is contained in:
parent
125d5fe3ff
commit
64b2b8b3f8
31 changed files with 335 additions and 79 deletions
|
|
@ -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>" }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
6
app/models/vchoice.rb
Normal file
6
app/models/vchoice.rb
Normal 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
8
app/models/vday.rb
Normal 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
10
app/models/vposition.rb
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue