Commit 52f41f33 authored by Mario Manno's avatar Mario Manno
Browse files

rename call_for_papers to call_for_participation

parent 231f4642
Loading
Loading
Loading
Loading
+2 −2
Changes for app/controllers/application_controller.rb: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -103,9 +103,9 @@ class ApplicationController < ActionController::Base
  end

  def check_cfp_open
    if @conference.call_for_papers.nil?
    if @conference.call_for_participation.nil?
      redirect_to cfp_not_existing_path
    elsif @conference.call_for_papers.start_date > Date.today
    elsif @conference.call_for_participation.start_date > Date.today
      redirect_to cfp_open_soon_path
    end
  end
−45

File deleted.

+45
Changes for app/controllers/call_for_participations_controller.rb: 45 added lines, 0 removed lines.
Original line number Diff line number Diff line
class CallForParticipationsController < ApplicationController

  before_filter :authenticate_user!
  before_filter :not_submitter!
  load_and_authorize_resource

  def show
    @call_for_participation = @conference.call_for_participation
  end

  def new
    @call_for_participation = CallForParticipation.new
  end

  def create
    @call_for_participation = CallForParticipation.new(call_for_participation_params)
    @call_for_participation.conference = @conference

    if @call_for_participation.save
      redirect_to call_for_participation_path, notice: "Launched Call for Participation."
    else
      render action: "new"
    end
  end

  def edit
    @call_for_participation = @conference.call_for_participation
  end

  def update
    @call_for_participation = @conference.call_for_participation
    if @call_for_participation.update_attributes(call_for_participation_params)
      redirect_to call_for_participation_path, notice: "Changes saved successfully!"
    else
      flash[:alert] = "Failed to update"
      render action: "edit"
    end
  end

  private

  def call_for_participation_params
    params.require(:call_for_participation).permit(:start_date, :end_date, :hard_deadline, :welcome_text, :info_url, :contact_email)
  end
end
+2 −2
Changes for app/controllers/cfp/welcome_controller.rb: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4,14 +4,14 @@ class Cfp::WelcomeController < ApplicationController

  def not_existing
    @user = User.new
    unless @conference.call_for_papers.nil?
    unless @conference.call_for_participation.nil?
      redirect_to new_cfp_session_path 
    end
  end

  def open_soon
    @user = User.new
    unless @conference.call_for_papers.start_date > Date.today
    unless @conference.call_for_participation.start_date > Date.today
      redirect_to new_cfp_session_path 
    end
  end
+2 −2
Changes for app/controllers/recent_changes_controller.rb: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ class RecentChangesController < ApplicationController
  before_filter :not_submitter!

  def index
    authorize! :manage, CallForPapers
    authorize! :manage, CallForParticipation
    @all_versions = PaperTrail::Version.where(conference_id: @conference.id).order("created_at DESC")
    @versions = @all_versions.paginate(
      page: page_param,
@@ -17,7 +17,7 @@ class RecentChangesController < ApplicationController
  end

  def show
    authorize! :manage, CallForPapers
    authorize! :manage, CallForParticipation
    @version = PaperTrail::Version.where(conference_id: @conference.id, id: params[:id]).first
  end

Loading