hackathon_manager 0.5.9 → 0.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2e21c09fe4f13fff062eb78c01cca1a70f528ea
4
- data.tar.gz: e3358739189286f47332e13d7a835fad10db34d1
3
+ metadata.gz: b559e8c65a13ad6d2ba8ac77b4e8dbed6945c743
4
+ data.tar.gz: 6a3188bb8f656931e763d6696e931c71ec3ee925
5
5
  SHA512:
6
- metadata.gz: b247e8aca8d851af7b9eb59865f9fe690fdbdcff20835e6c0f575952192321867381e74523c955be90b55b0e8fccfe955ee95343806d2c530cc19ca25c2628de
7
- data.tar.gz: 063cc9f56440ca9f82bcca75585bd1b077fb425f92dfa197eb226c23c727309b2304325849cb5ff54156cbb1646b20791abf45935201cb50cf310d1347b21a1d
6
+ metadata.gz: 9729f692a84b2299c8448a22e9e8d0ed0f0a37a67991912f9f4cf875c5c8c34cbbb4182c54fe739ffd8fbfb1407a6c1ceed2a1bc732932c7a855531c5b5163d9
7
+ data.tar.gz: 8a201491d32bda0907cf34988543633677957e067ae977621c9d746605a81cadd5bd46c4b03ca591a05614b8ab1ac4c687a0d7e6b36e3eca201327b34a6689e1
@@ -167,6 +167,6 @@ class Manage::QuestionnairesController < Manage::ApplicationController
167
167
  Mailer.delay.rsvp_confirmation_email(questionnaire.id) if new_status == "rsvp_confirmed"
168
168
  Mailer.delay.denied_email(questionnaire.id) if new_status == "denied"
169
169
 
170
- questionnaire.invite_to_slack if ENV['INVITE_TO_SLACK_WHEN_ACCEPTED'] == 'true' && ['accepted', 'rsvp_confirmed'].include?(new_status)
170
+ questionnaire.invite_to_slack if ENV['INVITE_TO_SLACK_UPON_RSVP'] == 'true' && new_status == 'rsvp_confirmed'
171
171
  end
172
172
  end
@@ -20,6 +20,8 @@ class RsvpsController < ApplicationController
20
20
  @questionnaire.acc_status_author_id = current_user.id
21
21
  @questionnaire.acc_status_date = Time.now
22
22
  if @questionnaire.save
23
+ flash[:notice] = "Thank you for confirming your attendance! "
24
+ flash[:notice] += @questionnaire.eligible_for_a_bus? ? "See below for additional bus information." : "You're all set to attend."
23
25
  Mailer.delay.rsvp_confirmation_email(@questionnaire.id)
24
26
  else
25
27
  flash[:notice] = rsvp_error_notice
@@ -35,6 +37,7 @@ class RsvpsController < ApplicationController
35
37
  unless @questionnaire.save
36
38
  flash[:notice] = rsvp_error_notice
37
39
  end
40
+ flash[:notice] = "Your RSVP has been updated." if flash[:notice].blank?
38
41
  redirect_to rsvp_path
39
42
  end
40
43
 
@@ -79,6 +82,8 @@ class RsvpsController < ApplicationController
79
82
 
80
83
  Mailer.delay.rsvp_confirmation_email(@questionnaire.id) if acc_status_changed && @questionnaire.acc_status == "rsvp_confirmed"
81
84
 
85
+ flash[:notice] = "Your RSVP has been updated." if flash[:notice].blank?
86
+
82
87
  redirect_to rsvp_path
83
88
  end
84
89
 
@@ -18,6 +18,7 @@ class Message < ApplicationRecord
18
18
  "rsvp-denied" => "RSVP Denied Attendees",
19
19
  "checked-in" => "Checked-In Attendees",
20
20
  "non-checked-in" => "Non-Checked-In, Accepted & RSVP'd Applications",
21
+ "non-checked-in-excluding" => "Non-Checked-In Applications, Excluding Accepted & RSVP'd",
21
22
  "bus-list-cornell-bing" => "Bus List: Cornell + Binghamton (Confirmed)",
22
23
  "bus-list-buffalo" => "Bus List: Buffalo (Confirmed)",
23
24
  "bus-list-albany" => "Bus List: Albany (Confirmed)",
@@ -3,7 +3,6 @@
3
3
  %h1.section-title
4
4
  Bus
5
5
  %span.emphasized Captain
6
- %p#notice= notice
7
6
 
8
7
  %p Thank you for being a bus captain! Below is any information you may need about your passengers.
9
8
 
@@ -2,8 +2,6 @@
2
2
  %h1.section-title= title "Edit Admin"
3
3
 
4
4
  .form-container
5
- %p#notice= notice
6
-
7
5
  %p
8
6
  %b Email Address:
9
7
  = @user.email
@@ -1,6 +1,5 @@
1
1
  %section.section.manage
2
2
  %h1.section-title= title "Bus List"
3
- %p#notice= notice
4
3
 
5
4
  %p
6
5
  %b Name:
@@ -1,6 +1,7 @@
1
1
  %section.section.manage
2
2
  %h1.section-title= title "Message"
3
- %p#notice= notice
3
+
4
+ - recipient_count = pluralize(BulkMessageWorker.build_recipients(@message.recipients).count, "recipient")
4
5
 
5
6
  %p
6
7
  %b Name:
@@ -14,6 +15,9 @@
14
15
  %p
15
16
  %b Recipients:
16
17
  = @message.recipients_list
18
+ %br
19
+ %small
20
+ %em #{recipient_count} currently match this query.
17
21
  %p
18
22
  %b Preview:
19
23
  = link_to "Open full preview &raquo;".html_safe, preview_manage_message_path
@@ -38,7 +42,7 @@
38
42
 
39
43
  - unless current_user.admin_limited_access
40
44
  - if @message.status == "drafted"
41
- = btn_link_to 'Deliver', deliver_manage_message_path(@message), method: :patch, data: { confirm: "Are you sure? The message \"#{@message.name}\" will be sent out to all recipients." }
45
+ = btn_link_to 'Deliver', deliver_manage_message_path(@message), method: :patch, data: { confirm: "Are you sure? The message \"#{@message.name}\" will be sent to #{recipient_count}." }
42
46
  \|
43
47
  - if @message.can_edit?
44
48
  = link_to 'Edit', edit_manage_message_path(@message)
@@ -1,11 +1,11 @@
1
1
  %section.section.manage
2
2
  %h1.section-title= title "Listing Questionnaires"
3
3
 
4
- - if ENV['INVITE_TO_SLACK_WHEN_ACCEPTED']
4
+ - if ENV['INVITE_TO_SLACK_UPON_RSVP']
5
5
  %p
6
6
  %small
7
- %span.fa.fa-warning.icon-space-r
8
- Slack invites will be sent upon acceptance.
7
+ %span.fa.fa-info-circle.icon-space-r
8
+ Slack invites will automatically be sent upon RSVP confirmation.
9
9
 
10
10
  %table.questionnaires.datatable.row-border.stripe.hover.order-column{ "data-source" => datatable_manage_questionnaires_path(format: :json) }
11
11
  %thead
@@ -1,7 +1,4 @@
1
1
  %section.section.manage
2
- - if notice
3
- #disclaimer= notice
4
-
5
2
  .container.container-half
6
3
  = render partial: 'questionnaire_summary'
7
4
 
@@ -1,6 +1,5 @@
1
1
  %section.section{ style: "padding-left: 20px; padding-right: 20px" }
2
2
  %h1.section-title= title "School"
3
- %p#notice= notice
4
3
 
5
4
  %p
6
5
  %b Name:
@@ -24,6 +24,8 @@
24
24
  %br
25
25
  %p.center
26
26
  = btn_link_to "RSVP NOW &raquo;".html_safe, rsvp_path
27
+ - elsif @questionnaire.acc_status == "denied"
28
+ %p
27
29
  - else
28
30
  - if Rails.configuration.hackathon['registration_is_open']
29
31
  - if Rails.configuration.hackathon['thanks_for_applying']
@@ -6,7 +6,7 @@ class BulkMessageWorker
6
6
  return unless message.present? && message.status == "queued"
7
7
  message.update_attribute(:started_at, Time.now)
8
8
 
9
- recipients = build_recipients(message.recipients)
9
+ recipients = self.class.build_recipients(message.recipients)
10
10
 
11
11
  recipients.each do |recipient|
12
12
  Mailer.delay.bulk_message_email(message.id, recipient)
@@ -15,9 +15,7 @@ class BulkMessageWorker
15
15
  message.update_attribute(:delivered_at, Time.now)
16
16
  end
17
17
 
18
- private
19
-
20
- def build_recipients(recipient_types)
18
+ def self.build_recipients(recipient_types)
21
19
  recipients = Set.new
22
20
  recipient_types.each do |type|
23
21
  recipients += recipients_query(type)
@@ -26,7 +24,7 @@ class BulkMessageWorker
26
24
  end
27
25
 
28
26
  # rubocop:disable CyclomaticComplexity
29
- def recipients_query(type)
27
+ def self.recipients_query(type)
30
28
  case type
31
29
  when "all"
32
30
  User.where(admin: false).pluck(:id)
@@ -49,7 +47,9 @@ class BulkMessageWorker
49
47
  when "checked-in"
50
48
  Questionnaire.where("checked_in_at IS NOT NULL").pluck(:user_id)
51
49
  when "non-checked-in"
52
- Questionnaire.where("(acc_status = 'accepted' OR acc_status = 'accepted' OR acc_status = 'rsvp_denied') AND checked_in_at IS NULL").pluck(:user_id)
50
+ Questionnaire.where("(acc_status = 'accepted' OR acc_status = 'rsvp_confirmed' OR acc_status = 'rsvp_denied') AND checked_in_at IS NULL").pluck(:user_id)
51
+ when "non-checked-in-excluding"
52
+ Questionnaire.where("acc_status != 'accepted' AND acc_status != 'rsvp_confirmed' AND acc_status != 'rsvp_denied' AND checked_in_at IS NULL").pluck(:user_id)
53
53
  when "bus-list-cornell-bing"
54
54
  BusList.find(1).passengers.pluck(:user_id)
55
55
  when "bus-list-buffalo"
@@ -1,3 +1,3 @@
1
1
  module HackathonManager
2
- VERSION = '0.5.9'.freeze
2
+ VERSION = '0.5.10'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hackathon_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Olivera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-11 00:00:00.000000000 Z
11
+ date: 2018-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails