hackathon_manager 0.5.9 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/manage/questionnaires_controller.rb +1 -1
- data/app/controllers/rsvps_controller.rb +5 -0
- data/app/models/message.rb +1 -0
- data/app/views/bus_lists/show.html.haml +0 -1
- data/app/views/manage/admins/show.html.haml +0 -2
- data/app/views/manage/bus_lists/show.html.haml +0 -1
- data/app/views/manage/messages/show.html.haml +6 -2
- data/app/views/manage/questionnaires/index.html.haml +3 -3
- data/app/views/manage/questionnaires/show.html.haml +0 -3
- data/app/views/manage/schools/show.html.haml +0 -1
- data/app/views/questionnaires/show.html.haml +2 -0
- data/app/workers/bulk_message_worker.rb +6 -6
- data/lib/hackathon_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b559e8c65a13ad6d2ba8ac77b4e8dbed6945c743
|
4
|
+
data.tar.gz: 6a3188bb8f656931e763d6696e931c71ec3ee925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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['
|
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
|
|
data/app/models/message.rb
CHANGED
@@ -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)",
|
@@ -1,6 +1,7 @@
|
|
1
1
|
%section.section.manage
|
2
2
|
%h1.section-title= title "Message"
|
3
|
-
|
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 »".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
|
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['
|
4
|
+
- if ENV['INVITE_TO_SLACK_UPON_RSVP']
|
5
5
|
%p
|
6
6
|
%small
|
7
|
-
%span.fa.fa-
|
8
|
-
Slack invites will be sent upon
|
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
|
@@ -24,6 +24,8 @@
|
|
24
24
|
%br
|
25
25
|
%p.center
|
26
26
|
= btn_link_to "RSVP NOW »".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
|
-
|
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 = '
|
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"
|
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.
|
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
|
+
date: 2018-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|