Merge pull request #129 from snap-cloud/submission-reviewer-comments

Support Committee Review
This commit is contained in:
Michael Ball 2021-04-17 17:46:21 -07:00 committed by GitHub
commit 0d8a06184b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 76 additions and 22 deletions

View file

@ -46,7 +46,7 @@ jobs:
- name: spec/${{ matrix.suite }} - name: spec/${{ matrix.suite }}
run: bundle exec rake spec:${{ matrix.suite }} run: bundle exec rake spec:${{ matrix.suite }}
- name: coverage upload ${{ matrix.suite }} - name: coverage upload ${{ matrix.suite }}
uses: codacy/codacy-coverage-reporter-action@master uses: codacy/codacy-coverage-reporter-action@v1
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
with: with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}

View file

@ -169,11 +169,11 @@ class ProposalsController < ApplicationController
private private
def event_params def event_params
# TODO-SNAPCON: Restrict committee review to admins.
params.require(:event).permit(:event_type_id, :track_id, :difficulty_level_id, params.require(:event).permit(:event_type_id, :track_id, :difficulty_level_id,
:title, :subtitle, :abstract, :submission_text, :description, :title, :subtitle, :abstract, :submission_text, :description,
:require_registration, :max_attendees, :language, :require_registration, :max_attendees, :language,
speaker_ids: [], volunteer_ids: [] :committee_review, speaker_ids: [], volunteer_ids: [])
)
end end
def user_params def user_params

View file

@ -91,6 +91,8 @@ class EmailSettings < ApplicationRecord
h['eventtitle'] = event.title h['eventtitle'] = event.title
h['proposalslink'] = Rails.application.routes.url_helpers.conference_program_proposals_url( h['proposalslink'] = Rails.application.routes.url_helpers.conference_program_proposals_url(
conference.short_title, host: (ENV['OSEM_HOSTNAME'] || 'localhost:3000')) conference.short_title, host: (ENV['OSEM_HOSTNAME'] || 'localhost:3000'))
h['committee_review'] = event.committee_review
h['committee_review_html'] = ApplicationController.helpers.markdown(event.committee_review)
end end
if booth if booth

View file

@ -17,6 +17,12 @@
%tr %tr
%td {eventtitle} %td {eventtitle}
%td The title of an accepted or rejected proposal %td The title of an accepted or rejected proposal
%tr
%td {committee_review}
%td The raw text in the committee review for the proposal
%tr
%td {committee_review_html}
%td The committee review markdown rendered as HTML.
%tr %tr
%td {conference_start_date} %td {conference_start_date}
%td The start date of the conference %td The start date of the conference
@ -56,9 +62,6 @@
%td {conference_splash_link} %td {conference_splash_link}
%td The link to conference splash page %td The link to conference splash page
- if @conference.booths - if @conference.booths
%tr
%td {submitter_name}
%td Submitter's name
%tr %tr
%td {booth_title} %td {booth_title}
%td Booth's title %td Booth's title

View file

@ -73,9 +73,7 @@
%td %td
= link_to @event.submitter.name, admin_user_path(@event.submitter) = link_to @event.submitter.name, admin_user_path(@event.submitter)
- if @event.submitter.email_public - if @event.submitter.email_public
( (#{mail_to(@event.submitter.email)})
= link_to @event.submitter.email, "mailto: #{@event.submitter.email}"
)
%tr %tr
%td %td
%b Speakers %b Speakers
@ -84,9 +82,7 @@
%div %div
= link_to speaker.name, admin_user_path(speaker) = link_to speaker.name, admin_user_path(speaker)
- if speaker.email_public - if speaker.email_public
( (#{mail_to(speaker.email)})
= link_to speaker.email, "mailto: #{speaker.email}"
)
%tr %tr
%td %td
%b Volunteers %b Volunteers
@ -117,11 +113,17 @@
%td %td
%b Submission Description %b Submission Description
%td= markdown(@event.submission_text) %td= markdown(@event.submission_text)
%tr %tr
%td %td
%b Requirements %b Requirements
%td= simple_format(@event.description) %td= simple_format(@event.description)
%tr
%td
%b Committee Review
%td= markdown(@event.committee_review)
- if @conference.program.rating_enabled? - if @conference.program.rating_enabled?
= render 'voting', = render 'voting',
event: @event, event: @event,

View file

@ -1,7 +1,7 @@
<%= render partial: "layouts/mailbot_header" %> <%= render partial: "layouts/mailbot_header" %>
<div id="content"> <div id="content">
<span style="white-space: pre-line"> <span style="white-space: pre-line">
<%= @email_body %> <%= @email_body.html_safe %>
</span> </span>
</div> </div>
<%= render partial: "layouts/mailbot_footer" %> <%= render partial: "layouts/mailbot_footer" %>

View file

@ -27,6 +27,20 @@
= render 'proposals/submission_type_content_form', f: f, program: @program = render 'proposals/submission_type_content_form', f: f, program: @program
-# TODO-SNAPCON: Extract this to be a `conference_committee_role?`
- 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' } },
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? - if @program.cfp&.enable_registrations?
= f.inputs 'Enable pre-registration' do = f.inputs 'Enable pre-registration' do
= f.input :require_registration, label: 'Require participants to register to your event' = f.input :require_registration, label: 'Require participants to register to your event'

View file

@ -138,3 +138,22 @@
- if @surveys_after_event.any? && @event.ended? - if @surveys_after_event.any? && @event.ended?
.page-header .page-header
= render partial: 'surveys/list', locals: { surveys: @surveys_after_event, conference: @conference } = 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)

View file

@ -167,6 +167,7 @@ Osem::Application.routes.draw do
end end
end end
resource :program, only: [] do resource :program, only: [] do
get 'event/:id', to: 'proposals#show', as: :conference_program_event
get 'proposal/:id', to: 'proposals#show' # For backward compatibility get 'proposal/:id', to: 'proposals#show' # For backward compatibility
resources :proposals, except: :destroy do resources :proposals, except: :destroy do
get 'commercials/render_commercial' => 'commercials#render_commercial' get 'commercials/render_commercial' => 'commercials#render_commercial'
@ -220,9 +221,11 @@ Osem::Application.routes.draw do
end end
end end
get '/admin' => redirect('/admin/conferences') # Handle conferences on custom domains.
# This *must* come before any other root definition.
get '/calendar' => 'conferences#calendar' constraints DomainConstraint do
root to: 'conferences#show'
end
unless ENV['OSEM_ROOT_CONFERENCE'].blank? unless ENV['OSEM_ROOT_CONFERENCE'].blank?
root to: redirect("/conferences/#{ENV['OSEM_ROOT_CONFERENCE']}") root to: redirect("/conferences/#{ENV['OSEM_ROOT_CONFERENCE']}")
@ -230,9 +233,10 @@ Osem::Application.routes.draw do
root to: 'conferences#index', via: [:get, :options] root to: 'conferences#index', via: [:get, :options]
end end
constraints DomainConstraint do get '/admin' => redirect('/admin/conferences')
root to: 'conferences#show' get '/calendar' => 'conferences#calendar'
end
get '/.well-known/apple-developer-merchantid-domain-association', to: 'application#apple_pay' get '/.well-known/apple-developer-merchantid-domain-association', to: 'application#apple_pay'
# A Short Fallback Route
get '/:id', to: 'conferences#show'
end end

View file

@ -0,0 +1,5 @@
class AddCommitteeReviewToEvents < ActiveRecord::Migration[5.2]
def change
add_column :events, :committee_review, :text
end
end

View file

@ -134,7 +134,12 @@ describe EmailSettings do
context 'conference has event' do context 'conference has event' do
before do before do
event_hash = { 'eventtitle' => 'Talk about talks', 'proposalslink' => 'http://localhost:3000/conferences/goto/program/proposals' } event_hash = {
'eventtitle' => 'Talk about talks',
'proposalslink' => 'http://localhost:3000/conferences/goto/program/proposals',
'committee_review' => nil,
'committee_review_html' => ''
}
expected_hash.merge!(event_hash) expected_hash.merge!(event_hash)
end end