Commit 7e2848ca authored by Gualter's avatar Gualter

Add activist and artistic session types (#236)

parent 5253f9fa
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)
ALLOWED_EVENT_TYPE_SCOPES = %(all individual_papers special_sessions poster_presentations participatory_sessions activist_sessions artistic_sessions)
before_action :authenticate_user!
before_action :not_submitter!
before_action :set_is_reviewer
......
......@@ -32,6 +32,10 @@ class ScheduleController < ApplicationController
@unscheduled_events = @unscheduled_events.poster_presentations
elsif params[:session_type] and params[:session_type] == "Participatory Session"
@unscheduled_events = @unscheduled_events.participatory_sessions
elsif params[:session_type] and params[:session_type] == "Activist Session"
@unscheduled_events = @unscheduled_events.activist_sessions
elsif params[:session_type] and params[:session_type] == "Artistic Session"
@unscheduled_events = @unscheduled_events.artistic_sessions
end
render partial: "unscheduled_events"
end
......
......@@ -13,6 +13,10 @@ class StatisticsController < ApplicationController
result = @conference.events_by_state_and_type('Participatory Session')
when 'poster_presentations'
result = @conference.events_by_state_and_type('Poster Presentation')
when 'activist_sessions'
result = @conference.events_by_state_and_type('Activist Session')
when 'artistic_sessions'
result = @conference.events_by_state_and_type('Artistic Session')
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']
TYPES = SPECIAL_SESSION_TYPES + ['Individual Paper', 'Poster Presentation', 'Participatory Session', 'Activist Session', 'Artistic Session']
has_one :ticket, dependent: :destroy
has_many :conflicts_as_conflicting, class_name: "Conflict", foreign_key: "conflicting_event_id", dependent: :destroy
......@@ -71,6 +71,8 @@ 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') }
#
# 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: ['Individual Paper', 'Poster Presentation', 'Participatory Session']
= f.input :event_type, collection: ['Activist Session', 'Artistic Session', 'Individual Paper', 'Poster Presentation', 'Participatory Session']
- else
-# Should not be reached. Page not-accessible if both deadlines are in the past.
= f.association :track, label: 'Theme', collection: @conference.tracks
......
......@@ -63,6 +63,10 @@
= link_to "Individual Papers", "#", :id => "events_individual_papers_only"
|
= link_to "Poster Presentations", "#", :id => "events_poster_presentations_only"
|
= link_to "Activist Sessions", "#", :id => "events_activist_sessions_only"
|
= link_to "Artistic Sessions", "#", :id => "events_artistic_sessions_only"
#event_state_graph(style="width:600px;height:300px;")
%table.zebra-stripe
......@@ -142,6 +146,36 @@
%td= @conference.events.where(event_type: 'Poster Presentation', :state => :canceled).count
%td= @conference.events.where(event_type: 'Poster Presentation', :state => :rejected).count
%td= @conference.events.where(event_type: 'Poster Presentation').count
%tr
%td
%strong Activist
%td= @conference.events.where(event_type: 'Activist Session', :state => :new).count
%td= @conference.events.where(event_type: 'Activist Session', :state => :submission_finished).count
%td= @conference.events.where(event_type: 'Activist Session', :state => :review).count
%td= @conference.events.undecided.where(event_type: 'Activist Session').count
%td= @conference.events.where(event_type: 'Activist Session', :state => :withdrawn).count
%td= @conference.events.accepted.where(event_type: 'Activist Session').count
%td= @conference.events.where(event_type: 'Activist Session', :state => :unconfirmed).count
%td= @conference.events.where(event_type: 'Activist Session', :state => :confirmed).count
%td= @conference.events.where(event_type: 'Activist Session', :state => :paid).count
%td= @conference.events.where(event_type: 'Activist Session', :state => :canceled).count
%td= @conference.events.where(event_type: 'Activist Session', :state => :rejected).count
%td= @conference.events.where(event_type: 'Activist Session').count
%tr
%td
%strong Artistic
%td= @conference.events.where(event_type: 'Artistic Session', :state => :new).count
%td= @conference.events.where(event_type: 'Artistic Session', :state => :submission_finished).count
%td= @conference.events.where(event_type: 'Artistic Session', :state => :review).count
%td= @conference.events.undecided.where(event_type: 'Artistic Session').count
%td= @conference.events.where(event_type: 'Artistic Session', :state => :withdrawn).count
%td= @conference.events.accepted.where(event_type: 'Artistic Session').count
%td= @conference.events.where(event_type: 'Artistic Session', :state => :unconfirmed).count
%td= @conference.events.where(event_type: 'Artistic Session', :state => :confirmed).count
%td= @conference.events.where(event_type: 'Artistic Session', :state => :paid).count
%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 All
......@@ -236,6 +270,10 @@
update_events_breakdown("individual_papers")
$("#events_poster_presentations_only").click (event) ->
update_events_breakdown("poster_presentations")
$("#events_activist_sessions_only").click (event) ->
update_events_breakdown("activist_sessions")
$("#events_artistic_sessions_only").click (event) ->
update_events_breakdown("artistic_sessions")
update_events_breakdown()
$("#languages_all_events").click (event) ->
......
......@@ -84,6 +84,16 @@
= link_to 'Special Sessions', set_events_scope_path('special_sessions')
- else
= link_to 'Special Sessions', set_events_scope_path('special_sessions')
- if session[:events_filter] == 'activist_sessions'
%strong
= link_to 'Activist Sessions', set_events_scope_path('activist_sessions')
- else
= link_to 'Artistic Sessions', set_events_scope_path('artistic_sessions')
- if session[:events_filter] == 'artistic_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] == 'participatory_sessions'
%strong
= link_to 'Participatory Sessions', set_events_scope_path('participatory_sessions')
......
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