Merge branch 'snap-cloud-master'

This commit is contained in:
CactusPuppy 2021-05-01 18:12:02 -07:00
commit 07eb7114ca
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82
32 changed files with 161 additions and 55 deletions

View file

@ -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:

View file

@ -26,5 +26,3 @@ $( document ).ready(function() {
calendar.render();
});

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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 }

View file

@ -0,0 +1,9 @@
<%= render partial: "layouts/mailbot_header" %>
<div id="content">
<p>Welcome to Snap!Con <%= @email %>!</p>
<p>You can confirm your account email through the link below:</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
</div>
<%= render partial: "layouts/mailbot_footer" %>

View file

@ -0,0 +1,7 @@
<p>Hello <%= @email %>!</p>
<% if @resource.try(:unconfirmed_email?) %>
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
<% else %>
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
<% end %>

View file

@ -0,0 +1,3 @@
<p>Hello <%= @resource.email %>!</p>
<p>We're contacting you to notify you that your password has been changed.</p>

View file

@ -0,0 +1,8 @@
<p>Hello <%= @resource.email %>!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>

View file

@ -0,0 +1,7 @@
<p>Hello <%= @resource.email %>!</p>
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
<p>Click the link below to unlock your account:</p>
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>

View file

@ -1,12 +1,7 @@
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="Snap!Con -- A conference all about Snap!, a programing language from UC Berkeley." name="description"/>
<meta content="Michael Ball, Brian Harvey, Jens Moenig, Bernat Romagosa, Dan Garcia, Lauren Mock" name="author"/>
<%= stylesheet_link_tag "mailbot" %>
</head>
<body>
<div id="border" style="background-color: <%= conference_color(@conference) %>"></div>
<% if @conference.present? %>
<div id="border" style="background-color: <%= conference_color(@conference) %>">
<% else %>
<div id="border" style="background-color: #003262">
<% end %>
</body>
</html>
</html>

View file

@ -9,17 +9,21 @@
<meta content="Michael Ball, Brian Harvey, Jens Moenig, Bernat Romagosa, Dan Garcia, Lauren Mock" name="author"/>
<%= stylesheet_link_tag "mailbot" %>
</head>
<body>
<div id="border" style="background-color: <%= conference_color(@conference) %>">
<body>
<% if @conference.present? %>
<div id="border" style="background-color: <%= conference_color(@conference) %>">
<% else %>
<div id="border" style="background-color: #003262">
<% end %>
<div class="row">
<div class="col-md-2">
<% 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 %>
</div>
</div>
</div>
</body>

View file

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

View file

@ -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,

View file

@ -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'

View file

@ -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

View file

@ -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)

View file

@ -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'

View file

@ -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

View file

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

View file

@ -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"

View file

@ -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 }

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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)