hackathon_manager 0.13.5 → 0.13.6

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
  SHA256:
3
- metadata.gz: 10df4760297b3fcc6238b3fd35a83c159b947c21eb14101c54d280d4a854cdda
4
- data.tar.gz: 4c78b6cf6a3ebf95a1173158177684802fc66ae7701b4e7cae90550b2f668d1e
3
+ metadata.gz: a50c74dea6f853d5ea2620cc7210cc46a3b28fb805fd8dfabe3803be0a0f6e1e
4
+ data.tar.gz: 9d682aa4ac8e3ee8c9505614e7299844860b1af9ed7354cdd7d4367ffb6a7b95
5
5
  SHA512:
6
- metadata.gz: a51c0aa9f0456518e9fbaa0c169982eba71ddbcafeb189f91aa49adb7c2fced6a07d1a505cdf473f7deaad0f98ef566204280735f791abe16c788ead884d47d4
7
- data.tar.gz: 43d73ce9e9d541823e6d827681fe5effce5e7b6b02034dccfb5256a2e3acf470ea8a8d07ff14031fd412fcefd8b953a4552f36040851fefa27e44077c8f0a3aa
6
+ metadata.gz: a1def16072afb2f8839f36cec90c0cc1a4a29d15dbb7ba790d6937d019ea25b32d6a739d3c9ad47435df177289ad51af9ebc529048b73098db20be8ff7728601
7
+ data.tar.gz: b66ee556952f3e49ce9b0475d531b651b47490c0e1cdb4a6cb1ec123b97ca1f99396dc61787415e0d761c2f90dd553b3a8e149c3c3b8164db64ccfc2a486a9fc
@@ -1,63 +1,73 @@
1
1
  var setupDataTables = function() {
2
+ window.questionnairesDataTable = $(".datatable.questionnaires").DataTable({
3
+ order: [3, "desc"],
4
+ columns: [
5
+ { orderable: false, data: "bulk" },
6
+ { orderable: false, data: "link" },
7
+ { orderable: false, data: "note" },
8
+ { orderable: true, data: "id", visible: false },
9
+ { orderable: true, data: "first_name" },
10
+ { orderable: true, data: "last_name" },
11
+ { orderable: true, data: "email", visible: false },
12
+ { orderable: true, data: "phone", visible: false },
13
+ { orderable: true, data: "gender", visible: false },
14
+ { orderable: true, data: "date_of_birth", visible: false },
15
+ { orderable: true, data: "acc_status" },
16
+ { orderable: true, data: "checked_in" },
17
+ { orderable: true, data: "school" },
18
+ { orderable: true, data: "created_at" },
19
+ { orderable: true, data: "dietary_restrictions", visible: false },
20
+ { orderable: true, data: "special_needs", visible: false }
21
+ ]
22
+ });
2
23
 
3
- window.questionnairesDataTable = $('.datatable.questionnaires').DataTable({
4
- order : [3, 'desc'],
5
- columns : [
6
- { orderable: false, data: 'bulk' },
7
- { orderable: false, data: 'link' },
8
- { orderable: false, data: 'note' },
9
- { orderable: true, data: 'id', visible: false },
10
- { orderable: true, data: 'first_name' },
11
- { orderable: true, data: 'last_name' },
12
- { orderable: true, data: 'email', visible: false },
13
- { orderable: true, data: 'phone', visible: false },
14
- { orderable: true, data: 'gender', visible: false },
15
- { orderable: true, data: 'date_of_birth', visible: false },
16
- { orderable: true, data: 'acc_status' },
17
- { orderable: true, data: 'checked_in' },
18
- { orderable: true, data: 'school' },
19
- { orderable: true, data: 'created_at' },
20
- { orderable: true, data: 'dietary_restrictions', visible: false },
21
- { orderable: true, data: 'special_needs', visible: false },
24
+ $(".datatable.checkins").DataTable({
25
+ order: [1, "asc"],
26
+ columns: [
27
+ { orderable: true, data: "first_name", visible: false },
28
+ { orderable: true, data: "last_name", visible: false },
29
+ { orderable: false, data: "about" },
30
+ { orderable: true, data: "checked_in" },
31
+ { orderable: false, data: "actions" }
22
32
  ]
23
33
  });
24
34
 
25
- $('.datatable.users').DataTable({
26
- order : [1, 'asc'],
27
- columns : [
28
- { orderable: true, data: 'id', visible: false },
29
- { orderable: true, data: 'email' },
30
- { orderable: true, data: 'role' },
31
- { orderable: true, data: 'created_at' }
35
+ $(".datatable.users").DataTable({
36
+ order: [1, "asc"],
37
+ columns: [
38
+ { orderable: true, data: "id", visible: false },
39
+ { orderable: true, data: "email" },
40
+ { orderable: true, data: "role" },
41
+ { orderable: true, data: "created_at" }
32
42
  ]
33
43
  });
34
44
 
35
- $('.datatable.bulk-messages').DataTable({
36
- order : [4, 'desc'],
37
- columns : [
38
- { orderable: true, data: 'id', visible: false},
39
- { orderable: true, data: 'name'},
40
- { orderable: true, data: 'subject'},
41
- { orderable: false, data: 'status'},
42
- { orderable: true, data: 'created_at'},
43
- { orderable: true, data: 'updated_at', visible: false},
44
- { orderable: true, data: 'delivered_at'}
45
+ $(".datatable.bulk-messages").DataTable({
46
+ order: [4, "desc"],
47
+ columns: [
48
+ { orderable: true, data: "id", visible: false },
49
+ { orderable: true, data: "name" },
50
+ { orderable: true, data: "subject" },
51
+ { orderable: false, data: "status" },
52
+ { orderable: true, data: "created_at" },
53
+ { orderable: true, data: "updated_at", visible: false },
54
+ { orderable: true, data: "delivered_at" }
45
55
  ]
46
56
  });
47
57
 
48
- $('.datatable.schools').DataTable({
49
- order : [4, 'desc'],
50
- columns : [
51
- { orderable: true, data: 'id', visible: false },
52
- { orderable: true, data: 'name' },
53
- { orderable: true, data: 'city' },
54
- { orderable: true, data: 'state' },
55
- { orderable: true, data: 'questionnaire_count' }
58
+ $(".datatable.schools").DataTable({
59
+ order: [4, "desc"],
60
+ columns: [
61
+ { orderable: true, data: "id", visible: false },
62
+ { orderable: true, data: "name" },
63
+ { orderable: true, data: "city" },
64
+ { orderable: true, data: "state" },
65
+ { orderable: true, data: "questionnaire_count" }
56
66
  ]
57
67
  });
58
68
 
59
- $('.datatable.stats').DataTable({
60
- processing : false,
61
- serverSide : false
69
+ $(".datatable.stats").DataTable({
70
+ processing: false,
71
+ serverSide: false
62
72
  });
63
73
  };
@@ -0,0 +1,23 @@
1
+ class Manage::CheckinsController < Manage::ApplicationController
2
+ before_action :set_questionnaire, only: [:show]
3
+
4
+ respond_to :html, :json
5
+
6
+ def index
7
+ respond_with(:manage, Questionnaire.all)
8
+ end
9
+
10
+ def datatable
11
+ render json: CheckinDatatable.new(view_context)
12
+ end
13
+
14
+ def show
15
+ respond_with(:manage, @questionnaire)
16
+ end
17
+
18
+ private
19
+
20
+ def set_questionnaire
21
+ @questionnaire = ::Questionnaire.find(params[:id])
22
+ end
23
+ end
@@ -57,6 +57,9 @@ class Manage::QuestionnairesController < Manage::ApplicationController
57
57
  end
58
58
 
59
59
  def check_in
60
+ redirect_to_checkins = params[:redirect_to_checkins] || false
61
+ show_redirect_path = redirect_to_checkins ? manage_checkin_path(@questionnaire) : manage_questionnaire_path(@questionnaire)
62
+ index_redirect_path = redirect_to_checkins ? manage_checkins_path : manage_questionnaires_path
60
63
  if params[:check_in] == "true"
61
64
  if params[:questionnaire]
62
65
  q_params = params.require(:questionnaire).permit(:agreement_accepted, :phone, :can_share_info, :email)
@@ -66,7 +69,7 @@ class Manage::QuestionnairesController < Manage::ApplicationController
66
69
  end
67
70
  unless @questionnaire.valid?
68
71
  flash[:notice] = @questionnaire.errors.full_messages.join(", ")
69
- redirect_to manage_questionnaire_path @questionnaire
72
+ redirect_to show_redirect_path
70
73
  return
71
74
  end
72
75
  @questionnaire.update_attribute(:checked_in_at, Time.now)
@@ -78,10 +81,10 @@ class Manage::QuestionnairesController < Manage::ApplicationController
78
81
  flash[:notice] = "#{@questionnaire.full_name} no longer checked in."
79
82
  else
80
83
  flash[:notice] = "No check-in action provided!"
81
- redirect_to manage_questionnaire_path @questionnaire
84
+ redirect_to show_redirect_path
82
85
  return
83
86
  end
84
- redirect_to manage_questionnaires_path
87
+ redirect_to index_redirect_path
85
88
  end
86
89
 
87
90
  def convert_to_admin
@@ -65,6 +65,6 @@ class Manage::TrackableTagsController < Manage::ApplicationController
65
65
 
66
66
  # Only allow a trusted parameter "white list" through.
67
67
  def trackable_tag_params
68
- params.require(:trackable_tag).permit(:name)
68
+ params.require(:trackable_tag).permit(:name, :allow_duplicate_band_events)
69
69
  end
70
70
  end
@@ -0,0 +1,39 @@
1
+ class CheckinDatatable < AjaxDatatablesRails::Base
2
+ def_delegators :@view, :link_to, :manage_checkin_path, :display_datetime, :bold
3
+
4
+ def view_columns
5
+ @view_columns ||= {
6
+ first_name: { source: 'Questionnaire.first_name' },
7
+ last_name: { source: 'Questionnaire.last_name' },
8
+ checked_in: { source: 'Questionnaire.checked_in_at', searchable: false },
9
+ }
10
+ end
11
+
12
+ private
13
+
14
+ def about(record)
15
+ output = ''
16
+ output += [record.first_name, record.last_name].join(' ') + ' '
17
+ output += '<span class="badge badge-warning"><i class="fa fa-exclamation-triangle icon-space-r"></i>Minor</span>' if record.minor?
18
+ output += '<br /><small>' + record.school.name + '</small>'
19
+ output.html_safe
20
+ end
21
+
22
+ def data
23
+ records.map do |record|
24
+ {
25
+ first_name: record.first_name,
26
+ last_name: record.last_name,
27
+ about: about(record),
28
+ checked_in: record.checked_in? ? "<span class=\"text-success\">Yes</span>".html_safe : 'No',
29
+ actions: "<a class=\"btn btn-primary btn-sm\" href=\"#{manage_checkin_path(record)}\">View</a>".html_safe
30
+ }
31
+ end
32
+ end
33
+
34
+ # rubocop:disable Naming/AccessorMethodName
35
+ def get_raw_records
36
+ Questionnaire.includes(:user, :school).references(:user, :school)
37
+ end
38
+ # rubocop:enable Naming/AccessorMethodName
39
+ end
@@ -204,8 +204,10 @@ class Questionnaire < ApplicationRecord
204
204
  "Accepted & Attending"
205
205
  elsif acc_status == "accepted"
206
206
  "Accepted, Awaiting RSVP"
207
- elsif ["pending", "waitlist", "late_waitlist"].include? acc_status
207
+ elsif acc_status == "pending"
208
208
  "Pending Review"
209
+ elsif ["waitlist", "late_waitlist"].include? acc_status
210
+ "Waitlisted"
209
211
  elsif acc_status == "denied"
210
212
  "Denied"
211
213
  end
@@ -1,5 +1,6 @@
1
1
  class TrackableEvent < ApplicationRecord
2
2
  validates_presence_of :band_id, :trackable_tag, :user
3
+ validates_uniqueness_of :band_id, scope: :trackable_tag_id, if: -> { !trackable_tag&.allow_duplicate_band_events }
3
4
 
4
5
  strip_attributes
5
6
 
@@ -35,6 +35,10 @@
35
35
  = active_link_to manage_questionnaires_path, class: "nav-link" do
36
36
  .fa.fa-inbox.fa-fw.icon-space-r-half
37
37
  Questionnaires
38
+ %li.nav-item
39
+ = active_link_to manage_checkins_path, class: "nav-link" do
40
+ .fa.fa-drivers-license-o.fa-fw.icon-space-r-half
41
+ Check-in
38
42
  %li.nav-item
39
43
  = active_link_to manage_admins_path, class: "nav-link" do
40
44
  .fa.fa-users.fa-fw.icon-space-r-half
@@ -0,0 +1,12 @@
1
+ = render "layouts/manage/page_title", title: "Check-in"
2
+
3
+ %div
4
+ %table.checkins.datatable.table.table-striped.table-hover{ "data-source" => datatable_manage_checkins_path(format: :json) }
5
+ %thead
6
+ %tr
7
+ %th First name
8
+ %th Last name
9
+ %th About
10
+ %th In?
11
+ %th Actions
12
+ %tbody
@@ -0,0 +1,59 @@
1
+ .d-flex.justify-content-between.flex-wrap.flex-md-nowrap.align-items-center.pt-3.pb-2.mb-3.border-bottom
2
+ .d-flex.align-items-center.flex-wrap
3
+ %h1.h2.mr-3
4
+ = title @questionnaire.full_name
5
+ %div
6
+ %span.mr-1
7
+ = render 'manage/questionnaires/acc_status_badge'
8
+ %span
9
+ = render 'manage/questionnaires/check_in_badge'
10
+
11
+ .btn-group{role: "group"}
12
+ = link_to 'View Full', manage_questionnaire_path(@questionnaire), class: 'btn btn-sm btn-outline-secondary'
13
+
14
+ .row
15
+ .col-md-6
16
+ = render 'manage/questionnaires/top_alerts'
17
+ .card.mb-3
18
+ .card-header Summary
19
+ .card-body
20
+ .row
21
+ %dt.col-md-4 Name
22
+ %dd.col-md-8= @questionnaire.full_name
23
+ %dt.col-md-4 School
24
+ %dd.col-md-8
25
+ - school = @questionnaire.school
26
+ = link_to school.name, manage_school_path(school)
27
+ %dt.col-md-4 Email
28
+ %dd.col-md-8= @questionnaire.email
29
+ %dt.col-md-4 Phone
30
+ %dd.col-md-8= @questionnaire.phone
31
+ %dt.col-md-4 Date of birth
32
+ %dd.col-md-8
33
+ = @questionnaire.date_of_birth_formatted
34
+ %span.badge.badge-pill.badge-dark{"data-container" => "body", "data-toggle" => "popover", "data-placement" => "right", "data-content" => "Age at time of event", "data-trigger" => "hover"}
35
+ = @questionnaire.age_at_time_of_event / 1.year
36
+
37
+ = render 'manage/questionnaires/checkin_compliance_card'
38
+
39
+ .card.mb-3
40
+ .card-header Special notices
41
+ .card-body
42
+ .row
43
+ %dt.col-md-4 Dietary restrictions
44
+ %dd.col-md-8
45
+ - if @questionnaire.dietary_restrictions.present?
46
+ %span.fa.fa-exclamation-triangle.text-warning.icon-space-r-half
47
+ = @questionnaire.dietary_restrictions
48
+ - else
49
+ %span.text-muted (none)
50
+ %dt.col-md-4 Special needs
51
+ %dd.col-md-8
52
+ - if @questionnaire.special_needs.present?
53
+ %span.fa.fa-exclamation-triangle.text-warning.icon-space-r-half
54
+ = @questionnaire.special_needs
55
+ - else
56
+ %span.text-muted (none)
57
+
58
+ .col-md-6
59
+ = render 'manage/questionnaires/checkin_card', redirect_to_checkins: true
@@ -0,0 +1,24 @@
1
+ .card.mb-3
2
+ .card-body
3
+ %h5.card-title.mb-1 Check-in
4
+ %p.card-text
5
+ = render 'manage/questionnaires/check_in_badge'
6
+ - if @questionnaire.checked_in_at
7
+ %small
8
+ = @questionnaire.checked_in_by_id ? @questionnaire.checked_in_by.email : "(never checked in)"
9
+ = @questionnaire.checked_in_at ? display_datetime(@questionnaire.checked_in_at, in_sentence: true) : "(not checked in)"
10
+ - if !@questionnaire.checked_in_at
11
+ %p.card-text
12
+ Please confirm their phone number and email address before checking in.
13
+ - if !@questionnaire.can_rsvp?
14
+ %br
15
+ %span.text-danger
16
+ Note: This applicant has not been accepted.
17
+ = bs_horizontal_simple_form_for @questionnaire, url: url_for(action: "check_in", controller: "questionnaires", method: :put), html: { "data-validate" => "form" } do |f|
18
+ - if !@questionnaire.checked_in?
19
+ = f.input :phone, input_html: { "data-validate" => "presence" }
20
+ = f.input :email, input_html: { "data-validate" => "presence email", value: @questionnaire.user.try(:email) }, required: true
21
+ = hidden_field_tag("check_in", !@questionnaire.checked_in?)
22
+ - if defined?(redirect_to_checkins) && redirect_to_checkins
23
+ = hidden_field_tag("redirect_to_checkins", "1")
24
+ = f.button :submit, value: ( @questionnaire.checked_in? ? "Remove check-in" : "Check In" ), class: 'btn-primary'
@@ -0,0 +1,44 @@
1
+ .card.mb-3
2
+ .card-header Check-in Compliance
3
+ .card-body.px-0.py-0
4
+ %ul.list-group.list-group-flush
5
+ - if ['rsvp_confirmed', 'accepted'].include?(@questionnaire.acc_status)
6
+ %li.list-group-item
7
+ .text-success
8
+ %span.fa.fa-check.fa-fw.icon-space-r
9
+ Has been accepted
10
+ - else
11
+ %li.list-group-item.list-group-item-danger
12
+ %span.fa.fa-exclamation-circle.fa-fw.icon-space-r
13
+ Has not been accepted.
14
+ Status:
15
+ %strong= @questionnaire.verbal_status
16
+ - if 'rsvp_confirmed' == @questionnaire.acc_status
17
+ %li.list-group-item
18
+ .text-success
19
+ %span.fa.fa-check.fa-fw.icon-space-r
20
+ RSVP'd as attending
21
+ - else
22
+ %li.list-group-item.list-group-item-warning
23
+ %span.fa.fa-exclamation-circle.fa-fw.icon-space-r
24
+ Did not RSVP as attending.
25
+ Status:
26
+ %strong= @questionnaire.verbal_status
27
+ - if !@questionnaire.minor?
28
+ %li.list-group-item
29
+ .text-success
30
+ %span.fa.fa-check.fa-fw.icon-space-r
31
+ 18 years or older
32
+ - else
33
+ %li.list-group-item.list-group-item-warning
34
+ %span.fa.fa-exclamation-circle.fa-fw.icon-space-r
35
+ 18 years or older
36
+ - if @questionnaire.agreement_accepted && @questionnaire.code_of_conduct_accepted && @questionnaire.data_sharing_accepted
37
+ %li.list-group-item
38
+ .text-success
39
+ %span.fa.fa-check.fa-fw.icon-space-r
40
+ Event agreement, MLH Code of Conduct, and MLH Data Sharing
41
+ - else
42
+ %li.list-group-item.list-group-item-danger
43
+ %span.fa.fa-close.fa-fw.icon-space-r
44
+ One or more of the following was not accepted: Event agreement, MLH Code of Conduct, and/or MLH Data Sharing
@@ -2,16 +2,7 @@
2
2
 
3
3
  .row
4
4
  .col-md-6
5
- - if @questionnaire.minor?
6
- .alert.alert-warning
7
- %p.mb-1
8
- %strong
9
- %span.fa.fa-exclamation-triangle.icon-space-r-half
10
- Applicant is a minor
11
- %p.mb-0
12
- Will be
13
- = format_age(@questionnaire.age_at_time_of_event)
14
- old at the start of the event.
5
+ = render 'top_alerts'
15
6
 
16
7
  .card.mb-3
17
8
  .card-header Personal Information
@@ -35,46 +26,7 @@
35
26
  %dt.col-md-4 Shirt size
36
27
  %dd.col-md-8= @questionnaire.shirt_size
37
28
 
38
- .card.mb-3
39
- .card-header Compliance
40
- .card-body.px-0.py-0
41
- %ul.list-group.list-group-flush
42
- - if !@questionnaire.minor?
43
- %li.list-group-item
44
- .text-success
45
- %span.fa.fa-check.fa-fw.icon-space-r
46
- 18 years or older
47
- - else
48
- %li.list-group-item.list-group-item-warning
49
- %span.fa.fa-exclamation-circle.fa-fw.icon-space-r
50
- 18 years or older
51
- - if @questionnaire.agreement_accepted
52
- %li.list-group-item
53
- .text-success
54
- %span.fa.fa-check.fa-fw.icon-space-r
55
- Event Agreement
56
- - else
57
- %li.list-group-item.list-group-item-danger
58
- %span.fa.fa-close.fa-fw.icon-space-r
59
- Event Agreement
60
- - if @questionnaire.code_of_conduct_accepted
61
- %li.list-group-item
62
- .text-success
63
- %span.fa.fa-check.fa-fw.icon-space-r
64
- MLH Code of Conduct
65
- - else
66
- %li.list-group-item.list-group-item-danger
67
- %span.fa.fa-close.fa-fw.icon-space-r
68
- MLH Code of Conduct
69
- - if @questionnaire.data_sharing_accepted
70
- %li.list-group-item
71
- .text-success
72
- %span.fa.fa-check.fa-fw.icon-space-r
73
- MLH Data Sharing
74
- - else
75
- %li.list-group-item.list-group-item-danger
76
- %span.fa.fa-close.fa-fw.icon-space-r
77
- MLH Data Sharing
29
+ = render 'checkin_compliance_card'
78
30
 
79
31
  .col-md-6
80
32
  .card.mb-3
@@ -0,0 +1,10 @@
1
+ - if @questionnaire.minor?
2
+ .alert.alert-warning
3
+ %p.mb-1
4
+ %strong
5
+ %span.fa.fa-exclamation-triangle.icon-space-r-half
6
+ Applicant is a minor
7
+ %p.mb-0
8
+ Will be
9
+ = format_age(@questionnaire.age_at_time_of_event)
10
+ old at the start of the event.
@@ -24,7 +24,22 @@
24
24
  .col
25
25
  %h3.mt-3.pb-2.border-bottom.mb-3 Admissions
26
26
 
27
- = render 'checkin'
27
+ .row
28
+ .col-md-6
29
+ .card.mb-3
30
+ .card-body
31
+ %h5.card-title.mb-1 Acceptance
32
+ %p.card-text
33
+ = render 'acc_status_badge'
34
+ %small
35
+ = @questionnaire.acc_status_author_id ? @questionnaire.acc_status_author.email : "(no author)"
36
+ = @questionnaire.acc_status_date ? display_datetime(@questionnaire.acc_status_date, in_sentence: true) : "(no date)"
37
+ - if current_user.admin?
38
+ = bs_vertical_simple_form @questionnaire, url: url_for(action: "update_acc_status", controller: "questionnaires") do |f|
39
+ = f.input :acc_status, as: :select, collection: Questionnaire::POSSIBLE_ACC_STATUS.invert, include_blank: false, label: "Acceptance Status:", hint: "Updating this status may trigger an automatic email to the applicant - see #{link_to('messages', manage_messages_path(anchor: 'triggered-email-overview'))} for details.".html_safe
40
+ = f.button :submit, value: "Update Status", class: 'btn-primary'
41
+ .col-md-6
42
+ = render 'checkin_card'
28
43
 
29
44
  .row
30
45
  .col
@@ -4,6 +4,7 @@
4
4
 
5
5
  .form-inputs
6
6
  = f.input :name
7
+ = f.input :allow_duplicate_band_events
7
8
 
8
9
  .form-actions
9
10
  = f.button :submit, class: 'btn-primary'
@@ -5,6 +5,7 @@
5
5
  %thead
6
6
  %tr
7
7
  %th Name
8
+ %th Allow duplicates
8
9
  %th Events
9
10
  %th Last event
10
11
  %th Add event
@@ -13,6 +14,11 @@
13
14
  - @trackable_tags.each do |trackable_tag|
14
15
  %tr
15
16
  %td= link_to trackable_tag.name, manage_trackable_tag_path(trackable_tag)
17
+ %td
18
+ - if trackable_tag.allow_duplicate_band_events
19
+ %span Allow
20
+ - else
21
+ %span.text-danger Block
16
22
  %td= pluralize(trackable_tag.trackable_events.count, "event")
17
23
  %td= trackable_tag.trackable_events.any? ? display_datetime(trackable_tag.sorted_events.first.created_at) : ''
18
24
  %td= link_to 'Add event', new_manage_trackable_event_path(trackable_tag_id: trackable_tag.id)
@@ -7,6 +7,13 @@
7
7
  %b Name:
8
8
  = @trackable_tag.name
9
9
 
10
+ %p
11
+ %b Allow duplicate band IDs:
12
+ - if @trackable_tag.allow_duplicate_band_events
13
+ %span.text-success Allow duplicates
14
+ - else
15
+ %span.text-danger Block duplicates
16
+
10
17
  %p
11
18
  %b= link_to 'Add event', new_manage_trackable_event_path(trackable_tag_id: @trackable_tag.id)
12
19
 
@@ -55,7 +55,7 @@
55
55
  - bus_list_options = ([OpenStruct.new({ name_maybe_full: 'Not riding a sponsored bus', id: '' })] + BusList.all.to_a)
56
56
  = f.association :bus_list, as: :radio_buttons, collection: bus_list_options, label_method: :name_maybe_full, value_method: :id, label: false, wrapper_html: { class: 'radio_buttons_vertical' }
57
57
  - if BusList.where(needs_bus_captain: true).any?
58
- = f.input :bus_captain_interest, as: :radio_buttons, collection: { " Yes!" => true, " No thank you." => false }, label: "Would you be interested in being a bus captain?"
58
+ = f.input :bus_captain_interest, as: :radio_buttons, collection: { " Yes!" => true, " No, thank you." => false }, label: "Would you be interested in being a bus captain?"
59
59
  %p
60
60
  %small Busses will pick up the morning of, arriving in time for opening ceremony. They will depart shortly after closing ceremony, dropping off to the same pick-up locations.
61
61
  %p
data/config/routes.rb CHANGED
@@ -48,6 +48,9 @@ Rails.application.routes.draw do
48
48
  patch :bulk_apply, on: :collection
49
49
  get :message_events, on: :member
50
50
  end
51
+ resources :checkins do
52
+ post :datatable, on: :collection
53
+ end
51
54
  resources :admins do
52
55
  post :datatable, on: :collection
53
56
  end
@@ -0,0 +1,5 @@
1
+ class AddPreventDuplicateBandEventsToTrackableTags < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :trackable_tags, :allow_duplicate_band_events, :bool, null: false, default: true
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module HackathonManager
2
- VERSION = '0.13.5'.freeze
2
+ VERSION = '0.13.6'.freeze
3
3
  end
@@ -3,5 +3,6 @@ FactoryBot.define do
3
3
  sequence :name do |n|
4
4
  "Tag #{n}"
5
5
  end
6
+ allow_duplicate_band_events { true }
6
7
  end
7
8
  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.13.5
4
+ version: 0.13.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Olivera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-11 00:00:00.000000000 Z
11
+ date: 2019-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -525,6 +525,7 @@ files:
525
525
  - app/controllers/manage/admins_controller.rb
526
526
  - app/controllers/manage/application_controller.rb
527
527
  - app/controllers/manage/bus_lists_controller.rb
528
+ - app/controllers/manage/checkins_controller.rb
528
529
  - app/controllers/manage/configs_controller.rb
529
530
  - app/controllers/manage/dashboard_controller.rb
530
531
  - app/controllers/manage/messages_controller.rb
@@ -539,6 +540,7 @@ files:
539
540
  - app/controllers/users/registrations_controller.rb
540
541
  - app/datatables/admin_datatable.rb
541
542
  - app/datatables/bulk_message_datatable.rb
543
+ - app/datatables/checkin_datatable.rb
542
544
  - app/datatables/questionnaire_datatable.rb
543
545
  - app/datatables/school_datatable.rb
544
546
  - app/helpers/hackathon_manager_helper.rb
@@ -600,6 +602,8 @@ files:
600
602
  - app/views/manage/bus_lists/index.html.haml
601
603
  - app/views/manage/bus_lists/new.html.haml
602
604
  - app/views/manage/bus_lists/show.html.haml
605
+ - app/views/manage/checkins/index.html.haml
606
+ - app/views/manage/checkins/show.html.haml
603
607
  - app/views/manage/configs/show.html.haml
604
608
  - app/views/manage/dashboard/index.html.haml
605
609
  - app/views/manage/dashboard/map_data.tsv.erb
@@ -610,10 +614,12 @@ files:
610
614
  - app/views/manage/messages/show.html.haml
611
615
  - app/views/manage/questionnaires/_acc_status_badge.html.haml
612
616
  - app/views/manage/questionnaires/_check_in_badge.html.haml
613
- - app/views/manage/questionnaires/_checkin.html.haml
617
+ - app/views/manage/questionnaires/_checkin_card.html.haml
618
+ - app/views/manage/questionnaires/_checkin_compliance_card.html.haml
614
619
  - app/views/manage/questionnaires/_form.html.haml
615
620
  - app/views/manage/questionnaires/_history.html.haml
616
621
  - app/views/manage/questionnaires/_overview.html.haml
622
+ - app/views/manage/questionnaires/_top_alerts.html.haml
617
623
  - app/views/manage/questionnaires/edit.html.haml
618
624
  - app/views/manage/questionnaires/index.html.haml
619
625
  - app/views/manage/questionnaires/new.html.haml
@@ -709,6 +715,7 @@ files:
709
715
  - db/migrate/20190113231044_refactor_bus_lists.rb
710
716
  - db/migrate/20190118204143_add_role_to_users.rb
711
717
  - db/migrate/20190125021648_change_questionnaire_dietary_special_needs_string_to_text.rb
718
+ - db/migrate/20190213233902_add_prevent_duplicate_band_events_to_trackable_tags.rb
712
719
  - db/schools.csv
713
720
  - db/seed_messages/questionnaire--accepted.md
714
721
  - db/seed_messages/questionnaire--denied.md
@@ -1,36 +0,0 @@
1
- .row
2
- .col-md-6
3
- .card.mb-3
4
- .card-body
5
- %h5.card-title.mb-1 Acceptance
6
- %p.card-text
7
- = render 'acc_status_badge'
8
- %small
9
- = @questionnaire.acc_status_author_id ? @questionnaire.acc_status_author.email : "(no author)"
10
- = @questionnaire.acc_status_date ? display_datetime(@questionnaire.acc_status_date, in_sentence: true) : "(no date)"
11
- - if current_user.admin?
12
- = bs_vertical_simple_form @questionnaire, url: url_for(action: "update_acc_status", controller: "questionnaires") do |f|
13
- = f.input :acc_status, as: :select, collection: Questionnaire::POSSIBLE_ACC_STATUS.invert, include_blank: false, label: "Acceptance Status:", hint: "Updating this status may trigger an automatic email to the applicant - see #{link_to('messages', manage_messages_path(anchor: 'triggered-email-overview'))} for details.".html_safe
14
- = f.button :submit, value: "Update Status", class: 'btn-primary'
15
- .col-md-6
16
- .card.mb-3
17
- .card-body
18
- %h5.card-title.mb-1 Check-in
19
- %p.card-text
20
- = render 'check_in_badge'
21
- - if @questionnaire.checked_in_at
22
- %small
23
- = @questionnaire.checked_in_by_id ? @questionnaire.checked_in_by.email : "(never checked in)"
24
- = @questionnaire.checked_in_at ? display_datetime(@questionnaire.checked_in_at, in_sentence: true) : "(not checked in)"
25
- %p
26
- Please confirm their phone number and email address before checking in.
27
- - if !@questionnaire.can_rsvp?
28
- %br
29
- %span.text-danger
30
- Note: This applicant has not been accepted.
31
- = bs_horizontal_simple_form_for @questionnaire, url: url_for(action: "check_in", controller: "questionnaires", method: :put), html: { "data-validate" => "form" } do |f|
32
- - if !@questionnaire.checked_in?
33
- = f.input :phone, input_html: { "data-validate" => "presence" }
34
- = f.input :email, input_html: { "data-validate" => "presence email", value: @questionnaire.user.try(:email) }, required: true
35
- = hidden_field_tag("check_in", !@questionnaire.checked_in?)
36
- = f.button :submit, value: ( @questionnaire.checked_in? ? "Remove check-in" : "Check In" ), class: 'btn-primary'