Implements user and event state distribution
This commit is contained in:
parent
069cc0eb4c
commit
b25ae50908
12 changed files with 344 additions and 14 deletions
|
|
@ -154,6 +154,26 @@ class Event < ActiveRecord::Base
|
|||
created_at.strftime('%W').to_i
|
||||
end
|
||||
|
||||
def self.get_state_color(state)
|
||||
# default azure
|
||||
result = '#00FFFF'
|
||||
case state
|
||||
when 'new' # blue
|
||||
result = '#0000FF'
|
||||
when 'withdrawn' # orange
|
||||
result = '#FF8000'
|
||||
when 'confirmed' # green
|
||||
result = '#00FF00'
|
||||
when 'unconfirmed' # yellow
|
||||
result = '#FFFF00'
|
||||
when 'rejected' # red
|
||||
result = '#FF0000'
|
||||
when 'canceled' # grey
|
||||
result = '#848484'
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def abstract_limit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue