Commit 4ee43fb6 authored by jon richter's avatar jon richter

Merge branch 'impl-240' into 'deployment'

Implement new session types, fixes #240

Closes #240

See merge request degrowth/scriptorium!19
parents ee73e27c d77d0243
class EventsController < ApplicationController
COLLECTION_ACTIONS = [:my, :my_coordinating, :my_reviewed, :with_review, :without_review, :undecided, :cards, :index, :feedbacks]
ALLOWED_EVENT_TYPE_SCOPES = %(all individual_papers special_sessions poster_presentations participatory_sessions activist_sessions artistic_sessions)
ALLOWED_EVENT_TYPE_SCOPES = %(all individual_papers special_sessions poster_presentations participatory_sessions activist_sessions artistic_sessions keynotes plenary_sessions highlights)
before_action :authenticate_user!
before_action :not_submitter!
before_action :set_is_reviewer
......
......@@ -36,6 +36,12 @@ class ScheduleController < ApplicationController
@unscheduled_events = @unscheduled_events.activist_sessions
elsif params[:session_type] and params[:session_type] == "Artistic Session"
@unscheduled_events = @unscheduled_events.artistic_sessions
elsif params[:session_type] and params[:session_type] == "Keynote"
@unscheduled_events = @unscheduled_events.keynotes
elsif params[:session_type] and params[:session_type] == "Plenary Session"
@unscheduled_events = @unscheduled_events.plenary_sessions
elsif params[:session_type] and params[:session_type] == "Highlights of Degrowth Research"
@unscheduled_events = @unscheduled_events.highlights
end
render partial: "unscheduled_events"
end
......
......@@ -17,6 +17,12 @@ class StatisticsController < ApplicationController
result = @conference.events_by_state_and_type('Activist Session')
when 'artistic_sessions'
result = @conference.events_by_state_and_type('Artistic Session')
when 'keynotes'
result = @conference.events_by_state_and_type('Keynote')
when 'plenary_sessions'
result = @conference.events_by_state_and_type('Plenary Session')
when 'highlights'
result = @conference.events_by_state_and_type('Highlights of Degrowth Research')
else
result = @conference.events_by_state
end
......
......@@ -5,7 +5,7 @@ class Event < ActiveRecord::Base
before_create :generate_guid
SPECIAL_SESSION_TYPES = ['Academic Special Session']
TYPES = SPECIAL_SESSION_TYPES + ['Individual Paper', 'Poster Presentation', 'Participatory Session', 'Activist Session', 'Artistic Session']
TYPES = SPECIAL_SESSION_TYPES + ['Individual Paper', 'Poster Presentation', 'Participatory Session', 'Activist Session', 'Artistic Session', 'Keynote', 'Plenary Session', 'Highlight of Degrowth Research']
has_one :ticket, dependent: :destroy
has_many :conflicts_as_conflicting, class_name: "Conflict", foreign_key: "conflicting_event_id", dependent: :destroy
......@@ -71,8 +71,11 @@ class Event < ActiveRecord::Base
scope :individual_papers, -> { where(event_type: 'Individual Paper') }
scope :poster_presentations, -> { where(event_type: 'Poster Presentation') }
scope :participatory_sessions, -> { where(event_type: 'Participatory Session') }
scope :activist_session, -> { where(event_type: 'Activist Session') }
scope :artistic_session, -> { where(event_type: 'Artistic Session') }
scope :activist_sessions, -> { where(event_type: 'Activist Session') }
scope :artistic_sessions, -> { where(event_type: 'Artistic Session') }
scope :plenary_sessions, -> { where(event_type: 'Plenary Session') }
scope :highlights, -> { where(event_type: 'Highlight of Degrowth Research') }
scope :keynotes, -> { where(event_type: 'Keynote') }
#
# Scopes by Person
......
......@@ -9,7 +9,7 @@
- elsif can? :submit_special_session, Event and not can? :submit_individual_paper, Event
= f.input :event_type, collection: ['Academic Special Session']
- elsif not can? :submit_special_session, Event and can? :submit_individual_paper, Event
= f.input :event_type, collection: ['Activist Session', 'Artistic Session', 'Individual Paper', 'Poster Presentation', 'Participatory Session']
= f.input :event_type, collection: ['Activist Session', 'Artistic Session', 'Highlight of Degrowth Research', 'Individual Paper', 'Keynote', 'Poster Presentation', 'Participatory Session', 'Plenary Session']
- else
-# Should not be reached. Page not-accessible if both deadlines are in the past.
= f.association :track, label: 'Theme', collection: @conference.tracks
......
......@@ -60,10 +60,16 @@
|
= link_to "Participatory Sessions", "#", :id => "events_participatory_sessions_only"
|
= link_to "Highlights of Degrowth Research", "#", :id => "events_highlights_only"
|
= link_to "Individual Papers", "#", :id => "events_individual_papers_only"
|
= link_to "Keynotes", "#", :id => "events_keynotes_only"
|
= link_to "Poster Presentations", "#", :id => "events_poster_presentations_only"
|
= link_to "Plenary Sessions", "#", :id => "events_plenary_sessions_only"
|
= link_to "Activist Sessions", "#", :id => "events_activist_sessions_only"
|
= link_to "Artistic Sessions", "#", :id => "events_artistic_sessions_only"
......@@ -176,6 +182,51 @@
%td= @conference.events.where(event_type: 'Artistic Session', :state => :canceled).count
%td= @conference.events.where(event_type: 'Artistic Session', :state => :rejected).count
%td= @conference.events.where(event_type: 'Artistic Session').count
%tr
%td
%strong Plenary
%td= @conference.events.where(event_type: 'Plenary Session', :state => :new).count
%td= @conference.events.where(event_type: 'Plenary Session', :state => :submission_finished).count
%td= @conference.events.where(event_type: 'Plenary Session', :state => :review).count
%td= @conference.events.undecided.where(event_type: 'Plenary Session').count
%td= @conference.events.where(event_type: 'Plenary Session', :state => :withdrawn).count
%td= @conference.events.accepted.where(event_type: 'Plenary Session').count
%td= @conference.events.where(event_type: 'Plenary Session', :state => :unconfirmed).count
%td= @conference.events.where(event_type: 'Plenary Session', :state => :confirmed).count
%td= @conference.events.where(event_type: 'Plenary Session', :state => :paid).count
%td= @conference.events.where(event_type: 'Plenary Session', :state => :canceled).count
%td= @conference.events.where(event_type: 'Plenary Session', :state => :rejected).count
%td= @conference.events.where(event_type: 'Plenary Session').count
%tr
%td
%strong Keynote
%td= @conference.events.where(event_type: 'Keynote', :state => :new).count
%td= @conference.events.where(event_type: 'Keynote', :state => :submission_finished).count
%td= @conference.events.where(event_type: 'Keynote', :state => :review).count
%td= @conference.events.undecided.where(event_type: 'Keynote').count
%td= @conference.events.where(event_type: 'Keynote', :state => :withdrawn).count
%td= @conference.events.accepted.where(event_type: 'Keynote').count
%td= @conference.events.where(event_type: 'Keynote', :state => :unconfirmed).count
%td= @conference.events.where(event_type: 'Keynote', :state => :confirmed).count
%td= @conference.events.where(event_type: 'Keynote', :state => :paid).count
%td= @conference.events.where(event_type: 'Keynote', :state => :canceled).count
%td= @conference.events.where(event_type: 'Keynote', :state => :rejected).count
%td= @conference.events.where(event_type: 'Keynote').count
%tr
%td
%strong Highlight
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research', :state => :new).count
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research', :state => :submission_finished).count
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research', :state => :review).count
%td= @conference.events.undecided.where(event_type: 'Highlight of Degrowth Research').count
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research', :state => :withdrawn).count
%td= @conference.events.accepted.where(event_type: 'Highlight of Degrowth Research').count
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research', :state => :unconfirmed).count
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research', :state => :confirmed).count
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research', :state => :paid).count
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research', :state => :canceled).count
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research', :state => :rejected).count
%td= @conference.events.where(event_type: 'Highlight of Degrowth Research').count
%tr
%td
%strong All
......@@ -274,6 +325,12 @@
update_events_breakdown("activist_sessions")
$("#events_artistic_sessions_only").click (event) ->
update_events_breakdown("artistic_sessions")
$("#events_plenary_sessions_only").click (event) ->
update_events_breakdown("plenary_sessions")
$("#events_highlights_only").click (event) ->
update_events_breakdown("highlights")
$("#events_keynotes_only").click (event) ->
update_events_breakdown("keynotes")
update_events_breakdown()
$("#languages_all_events").click (event) ->
......
......@@ -88,17 +88,32 @@
%strong
= link_to 'Activist Sessions', set_events_scope_path('activist_sessions')
- else
= link_to 'Artistic Sessions', set_events_scope_path('artistic_sessions')
= link_to 'Activist Sessions', set_events_scope_path('activist_sessions')
- if session[:events_filter] == 'artistic_sessions'
%strong
= link_to 'Participatory Sessions', set_events_scope_path('participatory_sessions')
= link_to 'Artistic Sessions', set_events_scope_path('artistic_sessions')
- else
= link_to 'Participatory Sessions', set_events_scope_path('participatory_sessions')
= link_to 'Artistic Sessions', set_events_scope_path('artistic_sessions')
- if session[:events_filter] == 'participatory_sessions'
%strong
= link_to 'Participatory Sessions', set_events_scope_path('participatory_sessions')
- else
= link_to 'Participatory Sessions', set_events_scope_path('participatory_sessions')
- if session[:events_filter] == 'plenary_sessions'
%strong
= link_to 'Plenary Sessions', set_events_scope_path('plenary_sessions')
- else
= link_to 'Plenary Sessions', set_events_scope_path('plenary_sessions')
- if session[:events_filter] == 'keynotes'
%strong
= link_to 'Keynotes', set_events_scope_path('keynotes')
- else
= link_to 'Keynotes', set_events_scope_path('keynotes')
- if session[:events_filter] == 'highlights'
%strong
= link_to 'Highlights of Degrowth Research', set_events_scope_path('highlights')
- else
= link_to 'Highlights of Degrowth Research', set_events_scope_path('highlights')
- if session[:events_filter] == 'individual_papers'
%strong
= link_to 'Individual Papers', set_events_scope_path('individual_papers')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment