diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index bf1b3adc..404178ea 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -169,11 +169,11 @@ class ProposalsController < ApplicationController private def event_params - params.require(:event).permit(:event_type_id, :track_id, :difficulty_level_id, - :title, :subtitle, :abstract, :submission_text, :description, - :require_registration, :max_attendees, :language, - speaker_ids: [], volunteer_ids: [] - ) + # TODO-SNAPCON: Restrict committee review to admins. + params.require(:event).permit(:event_type_id, :track_id, :difficulty_level_id, + :title, :subtitle, :abstract, :submission_text, :description, + :require_registration, :max_attendees, :language, + :committee_review, speaker_ids: [], volunteer_ids: []) end def user_params diff --git a/app/views/proposals/_proposal_form.html.haml b/app/views/proposals/_proposal_form.html.haml index f5ef752f..b54f074c 100644 --- a/app/views/proposals/_proposal_form.html.haml +++ b/app/views/proposals/_proposal_form.html.haml @@ -28,11 +28,18 @@ = render 'proposals/submission_type_content_form', f: f, program: @program -# TODO-SNAPCON: Extract this to be a `conference_committee_role?` - - read_only = !current_user.has_any_role? :admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference } + - if current_user.has_any_role?(:admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference }) %br = f.input :committee_review, - input_html: { rows: 5, data: { provide: 'markdown' }, readonly: read_only }, + input_html: { rows: 5, data: { provide: 'markdown' } }, hint: markdown_hint('This field is shared with the submission authors.') + - elsif @event.committee_review.present? + %br + %strong.control-label Committee Review + %small + Use this feedback to improve your submission. + .well + = markdown(@event.committee_review) - if @program.cfp&.enable_registrations? = f.inputs 'Enable pre-registration' do diff --git a/app/views/proposals/show.html.haml b/app/views/proposals/show.html.haml index 5d2dd948..9d5cfe73 100644 --- a/app/views/proposals/show.html.haml +++ b/app/views/proposals/show.html.haml @@ -138,3 +138,22 @@ - if @surveys_after_event.any? && @event.ended? .page-header = render partial: 'surveys/list', locals: { surveys: @surveys_after_event, conference: @conference } + + - if @event.committee_review.present? || @event.submission_text.present? && can?(:edit, @event) + %hr + %p Information for event authors only: + .panel.panel-info + .panel-heading + Committee Review + %button.btn.btn-primary.btn-xs{ type: "button", 'data-toggle': "collapse", 'data-target': "#committee-panel", 'aria-expanded': "false", 'aria-controls': "committee-panel" } + Toggle + .panel-body.collapse#committee-panel + = markdown(@event.committee_review) + + .panel.panel-info + .panel-heading + Submission Details + %button.btn.btn-primary.btn-xs{ type: "button", 'data-toggle': "collapse", 'data-target': "#submission-panel", 'aria-expanded': "false", 'aria-controls': "submission-panel" } + Toggle + .panel-body.collapse#submission-panel + = markdown(@event.submission_text)