From d7ae2ba29b7b15a876caba56d029c9cdf286d5fe Mon Sep 17 00:00:00 2001 From: differentreality Date: Sun, 28 Jul 2013 13:03:22 +0300 Subject: [PATCH] Allow title edit for confirmed proposal if organizer or admin and do not allow event type change for confirmed/unconfirmed proposals if schedule_changes is not set, unless it is done by an admin or organizer --- app/controllers/application_controller.rb | 1 + app/views/proposal/_proposal_form.html.haml | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fe7d2950..80d74f93 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -48,4 +48,5 @@ class ApplicationController < ActionController::Base Rails.logger.debug("Access denied!") redirect_to root_path, :alert => exception.message end + helper_method :organizer_or_admin? end diff --git a/app/views/proposal/_proposal_form.html.haml b/app/views/proposal/_proposal_form.html.haml index df960068..d309b55a 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -1,17 +1,19 @@ = semantic_form_for(@event, :url => @url) do |f| %section#basic = f.inputs :name => "Session Information" do - - if !@conference.call_for_papers.schedule_changes && @event.state == "confirmed" - Title - %br - = @event.title + - if !@conference.call_for_papers.schedule_changes && @event.state == "confirmed" && !organizer_or_admin? + Title: #{@event.title} %br %br - else = f.input :title, :as => :string, :required => true = f.input :subtitle, :as => :string %section#details - - unless @event.state === "unconfirmed" || @event.state === "confirmed" + - if (@event.state === "unconfirmed" || @event.state === "confirmed") && !organizer_or_admin? && !@conference.call_for_papers.schedule_changes + Event type: #{@event.event_type.title} + %br + %br + - else = f.input :event_type_id,:as => :select, :collection => @event_types, :include_blank => false, :label => "Session Type" = f.input :require_registration = f.input :abstract, :input_html => {:rows => 5, :class => "span11"},