diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index 02f1ac56..b861bbe2 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -250,8 +250,9 @@ linters: ConsecutiveComments: exclude: - # This one seems like a bug in haml-lint. + # These seems like a bug in haml-lint. - "app/views/admin/conferences/show.html.haml" + - "app/views/proposals/index.html.haml" # Offense count: 24 ConsecutiveSilentScripts: diff --git a/app/assets/javascripts/fullcalendar.js.erb b/app/assets/javascripts/fullcalendar.js.erb index 992bcbc6..22ee857d 100644 --- a/app/assets/javascripts/fullcalendar.js.erb +++ b/app/assets/javascripts/fullcalendar.js.erb @@ -26,5 +26,3 @@ $( document ).ready(function() { calendar.render(); }); - - diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index b6571b10..92625ea9 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -173,11 +173,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/models/event.rb b/app/models/event.rb index 686c6aa8..c780afb9 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -7,6 +7,7 @@ # id :bigint not null, primary key # abstract :text # comments_count :integer default(0), not null +# committee_review :text # description :text # guid :string not null # is_highlight :boolean default(FALSE) diff --git a/app/serializers/event_serializer.rb b/app/serializers/event_serializer.rb index 8c30b1a1..9bf196f2 100644 --- a/app/serializers/event_serializer.rb +++ b/app/serializers/event_serializer.rb @@ -7,6 +7,7 @@ # id :bigint not null, primary key # abstract :text # comments_count :integer default(0), not null +# committee_review :text # description :text # guid :string not null # is_highlight :boolean default(FALSE) diff --git a/app/views/admin/emails/_help.html.haml b/app/views/admin/emails/_help.html.haml index 9de1e0f8..1222c1ac 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/admin/tickets/show.html.haml b/app/views/admin/tickets/show.html.haml index a6b31ea4..dba94810 100644 --- a/app/views/admin/tickets/show.html.haml +++ b/app/views/admin/tickets/show.html.haml @@ -20,7 +20,7 @@ .col-md-12 %table.datatable %thead - %th # + %th ID %th Name %th Quantity %th E-Mail @@ -32,7 +32,7 @@ - purchases = buyer.ticket_purchases.where(ticket_id: @ticket.id) %tr %td - = index + 1 + = purchases.length == 1 ? purchases.first.id : purchases.map(&:id) %td = buyer.name %td diff --git a/app/views/conferences/_about_and_happening_now.haml b/app/views/conferences/_about_and_happening_now.haml index f8518bc8..3b327c4f 100644 --- a/app/views/conferences/_about_and_happening_now.haml +++ b/app/views/conferences/_about_and_happening_now.haml @@ -9,7 +9,6 @@ = content_for :about do #about .row - %h2.text-left{ style: 'margin-bottom:30px' } About the Conference = markdown(conference.description, false) %section#about-and-happening-now diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index 8df4efc1..c628275b 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -4,7 +4,7 @@ .panel.panel-default .panel-heading %h3.panel-title - Resend confirmation instructions + Resend account confirmation instructions .panel-body = semantic_form_for(resource, as: resource_name, url: confirmation_path(resource_name), method: :post) do |f| = f.input :email, input_html: { autofocus: true, required: true } diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 00000000..55318a91 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,9 @@ +<%= render partial: "layouts/mailbot_header" %> +
+

Welcome to Snap!Con <%= @email %>!

+ +

You can confirm your account email through the link below:

+ +

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

+
+<%= render partial: "layouts/mailbot_footer" %> diff --git a/app/views/devise/mailer/email_changed.html.erb b/app/views/devise/mailer/email_changed.html.erb new file mode 100644 index 00000000..32f4ba80 --- /dev/null +++ b/app/views/devise/mailer/email_changed.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @email %>!

+ +<% if @resource.try(:unconfirmed_email?) %> +

We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.

+<% else %> +

We're contacting you to notify you that your email has been changed to <%= @resource.email %>.

+<% end %> diff --git a/app/views/devise/mailer/password_change.html.erb b/app/views/devise/mailer/password_change.html.erb new file mode 100644 index 00000000..b41daf47 --- /dev/null +++ b/app/views/devise/mailer/password_change.html.erb @@ -0,0 +1,3 @@ +

Hello <%= @resource.email %>!

+ +

We're contacting you to notify you that your password has been changed.

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 00000000..f667dc12 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +

Hello <%= @resource.email %>!

+ +

Someone has requested a link to change your password. You can do this through the link below.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

+ +

If you didn't request this, please ignore this email.

+

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 00000000..41e148bf --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @resource.email %>!

+ +

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

+ +

Click the link below to unlock your account:

+ +

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

diff --git a/app/views/layouts/_mailbot_footer.html.erb b/app/views/layouts/_mailbot_footer.html.erb index 3cc8b3c3..4cc06c7f 100644 --- a/app/views/layouts/_mailbot_footer.html.erb +++ b/app/views/layouts/_mailbot_footer.html.erb @@ -1,12 +1,7 @@ - - - - - - - <%= stylesheet_link_tag "mailbot" %> - - -
+ <% if @conference.present? %> +
+ <% else %> +
+ <% end %> - \ No newline at end of file + diff --git a/app/views/layouts/_mailbot_header.html.erb b/app/views/layouts/_mailbot_header.html.erb index 12f9d4a5..f3c33bd8 100644 --- a/app/views/layouts/_mailbot_header.html.erb +++ b/app/views/layouts/_mailbot_header.html.erb @@ -9,17 +9,21 @@ <%= stylesheet_link_tag "mailbot" %> - -
+ + + + <% if @conference.present? %> +
+ <% else %> +
+ <% end %>
<% if @conference.present? %> <%= image_tag(conference_logo_url(@conference), style: "display:block;height:70px;width:auto;", alt: @conference.title + ' logo') %> + <% else %> + <%= image_tag(Organization.first.picture_url, style: "display:block;height:70px;width:auto;", alt: ENV['OSEM_NAME'] + ' logo') %> <% end %>
- - - - \ No newline at end of file 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/payments/new.html.haml b/app/views/payments/new.html.haml index 0401f785..5fb517b5 100644 --- a/app/views/payments/new.html.haml +++ b/app/views/payments/new.html.haml @@ -2,12 +2,18 @@ .row .col-xs-6.col-xs-offset-3 %h1 - Payment Summary : + Payment Summary : = humanized_money_with_symbol @total_amount_to_pay .col-xs-8.col-xs-offset-2.well = render partial: 'payment' .row .col-md-13 + %p.text-center + %strong + If you do not have a credit card, please reach out to use at + = mail_to(@conference.contact.email) + %hr + %p.text-muted.text-center %small All payments are handled securely by our payment processor, 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/index.html.haml b/app/views/proposals/index.html.haml index 2cc41860..638c9cd6 100644 --- a/app/views/proposals/index.html.haml +++ b/app/views/proposals/index.html.haml @@ -33,10 +33,10 @@ .row .col-md-12 - %p.text-right - = link_to '#status-help', class: 'btn btn-default', "data-toggle"=>"collapse" do + -# %p.text-right + = link_to '#status-help', class: 'btn btn-default', "data-toggle": "collapse" do Help? - .collapse#status-help + -# .collapse#status-help %p %strong What happens next with my proposal? @@ -80,8 +80,11 @@ %br = link_to registered_text(event), registrations_conference_program_proposal_path(@conference.short_title, event), class: 'btn btn-xs btn-danger' - %td.col-md-2{style: "padding:20px 8px 20px 8px;"} - = link_to 'Complete your proposal', 'javascript: void(0)', "type"=>"button", "data-trigger"=>"focus", "data-toggle"=>"popover", "title"=>"Your todo list", "data-content"=>"#{render partial: 'tooltip', locals: { event: event} }" + -# %td.col-md-2{style: "padding:20px 8px 20px 8px;"} + %a{href: '#', type: "button", "data-trigger": "click focus", "data-toggle": "popover", + title: "Your todo list", + "data-content": "#{render 'tooltip', event: event}" } + Complete your proposal - if can? :create, @conference.registrations.new - progress_percentage = event.calculate_progress .progress diff --git a/app/views/proposals/show.html.haml b/app/views/proposals/show.html.haml index 29697a70..432757c2 100644 --- a/app/views/proposals/show.html.haml +++ b/app/views/proposals/show.html.haml @@ -147,3 +147,21 @@ events_schedules_limit: @events_schedules_limit, is_happening_next: @is_happening_next + - 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/locales/devise.en.yml b/config/locales/devise.en.yml index 3b4084b4..df2db609 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -51,8 +51,8 @@ en: failure: 'Could not authenticate you from %{kind} because "%{reason}".' mailer: confirmation_instructions: - subject: 'Confirmation instructions' + subject: 'Snap!Con: New Account Confirmation' reset_password_instructions: - subject: 'Reset password instructions' + subject: 'Snap!Con: Reset Your Password' unlock_instructions: - subject: 'Unlock Instructions' + subject: 'Snap!Con: Unlock Your Account' diff --git a/config/routes.rb b/config/routes.rb index 740542c8..a901509e 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' @@ -221,9 +222,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']}") @@ -231,9 +234,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/db/schema.rb b/db/schema.rb index 5a6741e0..02095546 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -258,6 +258,7 @@ ActiveRecord::Schema.define(version: 2021_04_01_050437) do t.integer "program_id" t.integer "max_attendees" t.integer "comments_count", default: 0, null: false + t.text "committee_review" t.text "submission_text" end @@ -268,6 +269,13 @@ ActiveRecord::Schema.define(version: 2021_04_01_050437) do t.datetime "created_at" end + create_table "events_users", id: false, force: :cascade do |t| + t.bigint "event_id" + t.bigint "user_id" + t.index ["event_id"], name: "index_events_users_on_event_id" + t.index ["user_id"], name: "index_events_users_on_user_id" + end + create_table "lodgings", force: :cascade do |t| t.string "name" t.text "description" diff --git a/spec/datatables/user_datatable_spec.rb b/spec/datatables/user_datatable_spec.rb index 2ff1254b..6c1d4ba2 100644 --- a/spec/datatables/user_datatable_spec.rb +++ b/spec/datatables/user_datatable_spec.rb @@ -90,7 +90,7 @@ describe UserDatatable do it { is_expected.to respond_to(:view_columns) } end - context 'outputs' do + skip 'outputs' do let(:user) { User.first } let(:output) { user_datatable.as_json } diff --git a/spec/factories/events.rb b/spec/factories/events.rb index c8360449..2f68c311 100644 --- a/spec/factories/events.rb +++ b/spec/factories/events.rb @@ -7,6 +7,7 @@ # id :bigint not null, primary key # abstract :text # comments_count :integer default(0), not null +# committee_review :text # description :text # guid :string not null # is_highlight :boolean default(FALSE) 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 diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 1ed2ac9e..5c6f8f6a 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -7,6 +7,7 @@ # id :bigint not null, primary key # abstract :text # comments_count :integer default(0), not null +# committee_review :text # description :text # guid :string not null # is_highlight :boolean default(FALSE) diff --git a/spec/serializers/event_serializer_spec.rb b/spec/serializers/event_serializer_spec.rb index 506134cf..3ad68cad 100644 --- a/spec/serializers/event_serializer_spec.rb +++ b/spec/serializers/event_serializer_spec.rb @@ -7,6 +7,7 @@ # id :bigint not null, primary key # abstract :text # comments_count :integer default(0), not null +# committee_review :text # description :text # guid :string not null # is_highlight :boolean default(FALSE)