Added semi-functional administration pages
This commit is contained in:
@@ -8,6 +8,7 @@ class Conference < ActiveRecord::Base
|
||||
|
||||
has_many :conference_host_organizations, :dependent => :destroy
|
||||
has_many :organizations, :through => :conference_host_organizations
|
||||
has_many :event_locations
|
||||
|
||||
#has_many :conference_registration_form_fields, :order => 'position ASC', :dependent => :destroy#, :class_name => '::ConferenceRegistrationFormField'
|
||||
#has_many :registration_form_fields, :through => :conference_registration_form_fields
|
||||
@@ -21,6 +22,7 @@ class Conference < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def host?(user)
|
||||
return false unless user.present?
|
||||
organizations.each do |o|
|
||||
return true if o.host?(user)
|
||||
end
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
class Event < ActiveRecord::Base
|
||||
translates :info, :title
|
||||
|
||||
belongs_to :conference
|
||||
belongs_to :event_location
|
||||
|
||||
def conference_day
|
||||
return nil unless start_time.present? && end_time.present?
|
||||
|
||||
@@ -1,2 +1,25 @@
|
||||
require 'geocoder'
|
||||
require 'geocoder/railtie'
|
||||
|
||||
Geocoder::Railtie.insert
|
||||
|
||||
class EventLocation < ActiveRecord::Base
|
||||
belongs_to :conference
|
||||
geocoded_by :full_address
|
||||
|
||||
reverse_geocoded_by :latitude, :longitude, :address => :full_address
|
||||
after_validation :geocode, if: ->(obj){ obj.address_changed? }
|
||||
|
||||
def full_address
|
||||
l = conference.location
|
||||
[address, l.city, l.territory, l.country].join(', ')
|
||||
end
|
||||
|
||||
def self.all_spaces
|
||||
Workshop.all_spaces + [:event_space]
|
||||
end
|
||||
|
||||
def self.all_amenities
|
||||
Workshop.all_needs
|
||||
end
|
||||
end
|
||||
|
||||
+4
-9
@@ -3,17 +3,8 @@ class User < ActiveRecord::Base
|
||||
config.authentications_class = Authentication
|
||||
end
|
||||
|
||||
#validates :password, presence: true, confirmation: true, length: { minimum: 3 }, unless: ("id?" || "password_confirmation?")
|
||||
#validates :password_confirmation, presence: true, unless: ("id?" || "password?")
|
||||
|
||||
validates :email, uniqueness: true
|
||||
|
||||
#validates_presence_of :avatar
|
||||
#validates_integrity_of :avatar
|
||||
#validates_processing_of :avatar
|
||||
|
||||
#has_secure_password validations: false
|
||||
|
||||
mount_uploader :avatar, AvatarUploader
|
||||
|
||||
has_many :user_organization_relationships
|
||||
@@ -21,6 +12,10 @@ class User < ActiveRecord::Base
|
||||
has_many :authentications, :dependent => :destroy
|
||||
accepts_nested_attributes_for :authentications
|
||||
|
||||
before_save do |user|
|
||||
user.locale = I18n.locale
|
||||
end
|
||||
|
||||
def can_translate?(to_locale = nil, from_locale = nil)
|
||||
is_translator unless to_locale.present?
|
||||
|
||||
|
||||
@@ -115,6 +115,14 @@ class Workshop < ActiveRecord::Base
|
||||
[:race_gender, :mechanics, :funding, :organization, :community]
|
||||
end
|
||||
|
||||
def self.all_spaces
|
||||
[:meeting_room, :workshop, :outdoor_meeting]
|
||||
end
|
||||
|
||||
def self.all_needs
|
||||
[:sound, :projector, :tools]
|
||||
end
|
||||
|
||||
def get_translators(data, loc = nil)
|
||||
notify_list = {}
|
||||
active_facilitators.each do |facilitator|
|
||||
|
||||
Reference in New Issue
Block a user