Add a backup event status
This commit is contained in:
parent
054ef9c947
commit
c83a6fb719
|
@ -21,6 +21,11 @@ module Management
|
||||||
render :index
|
render :index
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def backup
|
||||||
|
@suggestion_groups = SuggestionGroup.for_conference Conference.current, state: Event.states[:backup]
|
||||||
|
render :index
|
||||||
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,11 @@ class Event < ActiveRecord::Base
|
||||||
|
|
||||||
after_create :send_new_event_notification
|
after_create :send_new_event_notification
|
||||||
|
|
||||||
enum state: [:undecided, :approved, :rejected]
|
enum state: [:undecided, :approved, :rejected, :backup]
|
||||||
|
|
||||||
# XXX: this belongs in a decorator
|
# XXX: this belongs in a decorator
|
||||||
STATE_TO_GLYPH = {undecided: 'question-sign', rejected: 'thumbs-down', approved: 'thumbs-up'}
|
STATE_TO_GLYPH = {undecided: 'question-sign', rejected: 'thumbs-down', approved: 'thumbs-up', backup: 'retweet'}
|
||||||
STATE_TO_CLASS = {undecided: 'warning', rejected: 'danger', approved: 'success'}
|
STATE_TO_CLASS = {undecided: 'warning', rejected: 'danger', approved: 'success', backup: 'info'}
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ html
|
||||||
meta name="viewport" content="width=device-width, initial-scale=1"
|
meta name="viewport" content="width=device-width, initial-scale=1"
|
||||||
title Clarion
|
title Clarion
|
||||||
= stylesheet_link_tag "management/application"
|
= stylesheet_link_tag "management/application"
|
||||||
|
= stylesheet_link_tag '//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.2.4/bootstrap-table.min.css'
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
body
|
body
|
||||||
nav.navbar.navbar-default.navbar-fixed-top
|
nav.navbar.navbar-default.navbar-fixed-top
|
||||||
|
@ -30,12 +31,15 @@ html
|
||||||
li class="#{'active' if action_name == 'index'}"
|
li class="#{'active' if action_name == 'index'}"
|
||||||
= link_to "Всички", management_events_path
|
= link_to "Всички", management_events_path
|
||||||
li class="#{'active' if action_name == 'undecided'}"
|
li class="#{'active' if action_name == 'undecided'}"
|
||||||
= link_to "Висящи", undecided_management_events_path
|
= link_to "Нерешени", undecided_management_events_path
|
||||||
li class="#{'active' if action_name == 'approved'}"
|
li class="#{'active' if action_name == 'approved'}"
|
||||||
= link_to "Одобрени", approved_management_events_path
|
= link_to "Одобрени", approved_management_events_path
|
||||||
|
li class="#{'active' if action_name == 'backup'}"
|
||||||
|
= link_to "Резерви", backup_management_events_path
|
||||||
li class="#{'active' if action_name == 'rejected'}"
|
li class="#{'active' if action_name == 'rejected'}"
|
||||||
= link_to "Отхвърлени", rejected_management_events_path
|
= link_to "Отхвърлени", rejected_management_events_path
|
||||||
|
|
||||||
div.container
|
div.container
|
||||||
== yield
|
== yield
|
||||||
= javascript_include_tag "management/application"
|
= javascript_include_tag "management/application"
|
||||||
|
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.2.4/bootstrap-table.min.js'
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
.btn-group id="suggestion-#{suggestion.id}-state"
|
.btn-group id="suggestion-#{suggestion.id}-state"
|
||||||
button class="btn dropdown-toggle btn-#{Event::STATE_TO_CLASS[suggestion.state.to_sym]}" type="button" data-toggle="dropdown"
|
button class="btn dropdown-toggle btn-#{Event::STATE_TO_CLASS[suggestion.state.to_sym]}" type="button" title="#{suggestion.state}" data-toggle="dropdown"
|
||||||
=> glyph Event::STATE_TO_GLYPH[suggestion.state.to_sym]
|
=> glyph Event::STATE_TO_GLYPH[suggestion.state.to_sym]
|
||||||
span.caret
|
span.caret
|
||||||
ul.dropdown-menu role="menu"
|
ul.dropdown-menu role="menu"
|
||||||
- Event.states.each do |state, number|
|
- Event.states.each do |state, number|
|
||||||
- next if state == suggestion.state
|
- next if state == suggestion.state
|
||||||
li
|
li
|
||||||
= link_to glyph(Event::STATE_TO_GLYPH[state.to_sym]), state_management_event_path(suggestion, state: state), class: "btn text-#{Event::STATE_TO_CLASS[state.to_sym]}", remote: true, method: :patch
|
= link_to glyph(Event::STATE_TO_GLYPH[state.to_sym]), state_management_event_path(suggestion, state: state), title: state, class: "btn text-#{Event::STATE_TO_CLASS[state.to_sym]}", remote: true, method: :patch
|
||||||
|
|
|
@ -22,6 +22,7 @@ Rails.application.routes.draw do
|
||||||
get 'approved'
|
get 'approved'
|
||||||
get 'rejected'
|
get 'rejected'
|
||||||
get 'undecided'
|
get 'undecided'
|
||||||
|
get 'backup'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue