mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
event: refactor get_state_color method
This commit is contained in:
parent
82edf7870a
commit
8250e1305e
1 changed files with 10 additions and 16 deletions
|
|
@ -149,22 +149,16 @@ class Event < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.get_state_color(state)
|
||||
case state
|
||||
when 'new' # blue
|
||||
'#0000FF'
|
||||
when 'withdrawn' # orange
|
||||
'#FF8000'
|
||||
when 'confirmed' # green
|
||||
'#00FF00'
|
||||
when 'unconfirmed' # yellow
|
||||
'#FFFF00'
|
||||
when 'rejected' # red
|
||||
'#FF0000'
|
||||
when 'canceled' # grey
|
||||
'#848484'
|
||||
else
|
||||
'#00FFFF' # azure
|
||||
end
|
||||
color = {
|
||||
new: '#0000FF', # blue
|
||||
withdrawn: '#FF8000', # orange
|
||||
confirmed: '#00FF00', # green
|
||||
unconfirmed: '#FFFF00', # yellow
|
||||
rejected: '#FF0000', # red
|
||||
canceled: '#848484' # grey
|
||||
}[state.to_sym]
|
||||
|
||||
color || '#00FFFF' # azure
|
||||
end
|
||||
|
||||
def update_state(transition, mail = false, subject = false, send_mail = false, send_mail_param)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue