Talk boxes with less information and schedule view simplified
This commit is contained in:
parent
6ba3512d2b
commit
2905c8858c
8 changed files with 38 additions and 31 deletions
|
|
@ -81,6 +81,16 @@ class Conference < ActiveRecord::Base
|
|||
result
|
||||
end
|
||||
|
||||
##
|
||||
# Check if there is any event in the program scheduled.
|
||||
#
|
||||
# ====Returns
|
||||
# * +false+ -> If there aren't schedules events
|
||||
# * +true+ -> If there are schedules events
|
||||
def scheduled?
|
||||
self.program.events.where.not(start_time: nil).any?
|
||||
end
|
||||
|
||||
##
|
||||
# Checks if the user is registered to the conference
|
||||
#
|
||||
|
|
|
|||
|
|
@ -223,6 +223,13 @@ class Event < ActiveRecord::Base
|
|||
(100 * result.values.count(true) / result.values.compact.count).to_s
|
||||
end
|
||||
|
||||
##
|
||||
# Returns the number of columns this event should span in the schedule
|
||||
#
|
||||
def span
|
||||
self.event_type.length / EventType::LENGTH_STEP
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
|
|
|
|||
|
|
@ -8,4 +8,7 @@ class EventType < ActiveRecord::Base
|
|||
validates :maximum_abstract_length, presence: true
|
||||
|
||||
alias_attribute :name, :title
|
||||
|
||||
# If LENGTH_STEP > 60 the public schedule must be changed
|
||||
LENGTH_STEP = 15
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,10 +26,6 @@ class Program < ActiveRecord::Base
|
|||
where(state: :confirmed)
|
||||
end
|
||||
|
||||
def scheduled
|
||||
where.not(start_time: nil)
|
||||
end
|
||||
|
||||
def highlights
|
||||
where(state: :confirmed, is_highlight: true)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue