diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 83f1aca4..b2e7d847 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -46,7 +46,7 @@ jobs: - name: spec/${{ matrix.suite }} run: bundle exec rake spec:${{ 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' with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index bf1b3adc..87636b2c 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -169,11 +169,11 @@ class ProposalsController < ApplicationController private def event_params + # 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, - speaker_ids: [], volunteer_ids: [] - ) + :committee_review, speaker_ids: [], volunteer_ids: []) end def user_params diff --git a/app/models/email_settings.rb b/app/models/email_settings.rb index 8a8ab0b5..e5b64801 100644 --- a/app/models/email_settings.rb +++ b/app/models/email_settings.rb @@ -91,6 +91,8 @@ class EmailSettings < ApplicationRecord h['eventtitle'] = event.title h['proposalslink'] = Rails.application.routes.url_helpers.conference_program_proposals_url( 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 if booth diff --git a/app/views/admin/emails/_help.html.haml b/app/views/admin/emails/_help.html.haml index 371bac7b..d62589b0 100644 --- a/app/views/admin/emails/_help.html.haml +++ b/app/views/admin/emails/_help.html.haml @@ -17,6 +17,12 @@ %tr %td {eventtitle} %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 %td {conference_start_date} %td The start date of the conference @@ -56,9 +62,6 @@ %td {conference_splash_link} %td The link to conference splash page - if @conference.booths - %tr - %td {submitter_name} - %td Submitter's name %tr %td {booth_title} %td Booth's title diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 05d48bb7..c21f364f 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -73,9 +73,7 @@ %td = link_to @event.submitter.name, admin_user_path(@event.submitter) - if @event.submitter.email_public - ( - = link_to @event.submitter.email, "mailto: #{@event.submitter.email}" - ) + (#{mail_to(@event.submitter.email)}) %tr %td %b Speakers @@ -84,9 +82,7 @@ %div = link_to speaker.name, admin_user_path(speaker) - if speaker.email_public - ( - = link_to speaker.email, "mailto: #{speaker.email}" - ) + (#{mail_to(speaker.email)}) %tr %td %b Volunteers @@ -117,11 +113,17 @@ %td %b Submission Description %td= markdown(@event.submission_text) + %tr %td %b Requirements %td= simple_format(@event.description) + %tr + %td + %b Committee Review + %td= markdown(@event.committee_review) + - if @conference.program.rating_enabled? = render 'voting', event: @event, diff --git a/app/views/mailbot/email_template.html.erb b/app/views/mailbot/email_template.html.erb index 6176cf08..8dd249a0 100644 --- a/app/views/mailbot/email_template.html.erb +++ b/app/views/mailbot/email_template.html.erb @@ -1,7 +1,7 @@ <%= render partial: "layouts/mailbot_header" %>
- <%= @email_body %> + <%= @email_body.html_safe %>
-<%= render partial: "layouts/mailbot_footer" %> \ No newline at end of file +<%= render partial: "layouts/mailbot_footer" %> diff --git a/app/views/proposals/_proposal_form.html.haml b/app/views/proposals/_proposal_form.html.haml index 8d16f9a9..b54f074c 100644 --- a/app/views/proposals/_proposal_form.html.haml +++ b/app/views/proposals/_proposal_form.html.haml @@ -27,6 +27,20 @@ = 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? = f.inputs 'Enable pre-registration' do = f.input :require_registration, label: 'Require participants to register to your event' 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) diff --git a/config/routes.rb b/config/routes.rb index e2332ce2..1c31e0d0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -167,6 +167,7 @@ Osem::Application.routes.draw do end end resource :program, only: [] do + get 'event/:id', to: 'proposals#show', as: :conference_program_event get 'proposal/:id', to: 'proposals#show' # For backward compatibility resources :proposals, except: :destroy do get 'commercials/render_commercial' => 'commercials#render_commercial' @@ -220,9 +221,11 @@ Osem::Application.routes.draw do end end - get '/admin' => redirect('/admin/conferences') - - get '/calendar' => 'conferences#calendar' + # Handle conferences on custom domains. + # This *must* come before any other root definition. + constraints DomainConstraint do + root to: 'conferences#show' + end unless ENV['OSEM_ROOT_CONFERENCE'].blank? root to: redirect("/conferences/#{ENV['OSEM_ROOT_CONFERENCE']}") @@ -230,9 +233,10 @@ Osem::Application.routes.draw do root to: 'conferences#index', via: [:get, :options] end - constraints DomainConstraint do - root to: 'conferences#show' - end - + get '/admin' => redirect('/admin/conferences') + get '/calendar' => 'conferences#calendar' get '/.well-known/apple-developer-merchantid-domain-association', to: 'application#apple_pay' + + # A Short Fallback Route + get '/:id', to: 'conferences#show' end diff --git a/db/migrate/20210303052026_add_committee_review_to_events.rb b/db/migrate/20210303052026_add_committee_review_to_events.rb new file mode 100644 index 00000000..9f2757c9 --- /dev/null +++ b/db/migrate/20210303052026_add_committee_review_to_events.rb @@ -0,0 +1,5 @@ +class AddCommitteeReviewToEvents < ActiveRecord::Migration[5.2] + def change + add_column :events, :committee_review, :text + end +end diff --git a/spec/models/email_settings_spec.rb b/spec/models/email_settings_spec.rb index b594c60c..3ac6598d 100644 --- a/spec/models/email_settings_spec.rb +++ b/spec/models/email_settings_spec.rb @@ -134,7 +134,12 @@ describe EmailSettings do context 'conference has event' 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) end