Merge branch 'master' into admin-ticketing
* master: (61 commits) Replace more Commercials with Materials Rename more commericals to materials UI -- Repalce "Commerials" with "Materials". Re-order Conference Associations Cleanup CSS add Snap! style block attachments hide venue link if there is no venue link No dropshadow Text with drop shadow for now Tidy up the look of lodging panels Show reg status for tickets. Tweak CSS, fix loding order Move the venue description to below the map. Update lodging styling. Add description for venu when map is shown. CSS tweaks... Make the edit form not so wide. Support markdown in more fields Cleanup CSS ordering, fix coloring for navdropdowns dumb...fix order of link_to args ARRRGHHH, another typo...same line... fix typo ...
This commit is contained in:
commit
4306fbe636
82 changed files with 423 additions and 428 deletions
Binary file not shown.
|
|
@ -39,7 +39,7 @@ class Commercial < ApplicationRecord
|
|||
|
||||
commercial = event.commercials.new(url: url)
|
||||
unless commercial.save
|
||||
errors[:validation_errors] << "Could not create commercial for event with ID #{event.id} (" + commercial.errors.full_messages.to_sentence + ')'
|
||||
errors[:validation_errors] << "Could not create materials for event with ID #{event.id} (" + commercial.errors.full_messages.to_sentence + ')'
|
||||
end
|
||||
end
|
||||
errors
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ class Conference < ApplicationRecord
|
|||
has_one :email_settings, dependent: :destroy
|
||||
has_one :program, dependent: :destroy
|
||||
has_one :venue, dependent: :destroy
|
||||
has_many :physical_tickets, through: :ticket_purchases
|
||||
has_many :ticket_purchases, dependent: :destroy
|
||||
has_many :physical_tickets, through: :ticket_purchases
|
||||
has_many :payments, dependent: :destroy
|
||||
has_many :supporters, through: :ticket_purchases, source: :user
|
||||
has_many :tickets, dependent: :destroy
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ class Registration < ApplicationRecord
|
|||
|
||||
validates :user_id, uniqueness: { scope: :conference_id, message: 'already Registered!' }
|
||||
validate :registration_limit_not_exceed, on: :create
|
||||
validate :registration_to_events_only_if_present
|
||||
|
||||
validates :accepted_code_of_conduct, acceptance: {
|
||||
if: -> { conference.try(:code_of_conduct).present? }
|
||||
}
|
||||
|
|
@ -48,19 +46,6 @@ class Registration < ApplicationRecord
|
|||
|
||||
private
|
||||
|
||||
##
|
||||
# If the user registers to attend events that are already scheduled,
|
||||
# only allow registration to events if the user will be present
|
||||
# (based on arrival and departure attributes)
|
||||
# No validation if arrival/departure attributes are empty
|
||||
def registration_to_events_only_if_present
|
||||
if (arrival || departure) && events.pluck(:start_time).any?
|
||||
errors.add(:arrival, 'is too late! You cannot register for events that take place before your arrival') if events.pluck(:start_time).compact.map { |x| x < arrival }.any?
|
||||
|
||||
errors.add(:departure, 'is too early! You cannot register for events that take place after your departure') if events.pluck(:start_time).compact.map { |x| x > departure }.any?
|
||||
end
|
||||
end
|
||||
|
||||
def subscribe_to_conference
|
||||
Subscription.create(conference_id: conference.id, user_id: user.id)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class User < ApplicationRecord
|
|||
else
|
||||
[:database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :trackable, :validatable, :confirmable,
|
||||
:omniauthable, omniauth_providers: [:suse, :google, :facebook, :github]]
|
||||
:omniauthable, omniauth_providers: [:google, :discourse]]
|
||||
end
|
||||
|
||||
devise(*devise_modules)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue