hackathon_manager 0.12.1 → 0.12.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38ec6a89224e9425dbbf6a08e05dc282517ce6a9ecf6c5905967c7a71acbdd62
4
- data.tar.gz: 461e4c1c853153cade1c635e92939e8f4207b06c13b39a5ba5559110d14beeb6
3
+ metadata.gz: 220ec7094ad0a190a71e4064736d8c707558cbd48775941022294f9aa6b4b14f
4
+ data.tar.gz: 36170ae1c9b391f39aa44a0abd3aeefec5eed045b3bfd24822114d76e5ee5392
5
5
  SHA512:
6
- metadata.gz: 787250f12418e9824e8a87ea77d026116623e4b1d56c5f1e1d00dbe2a43d94393adc48326e55590514ed7f08eb9fe0f4cf0e72277e8fc3085159b1f00b246633
7
- data.tar.gz: a8572e718b57f1c3bc45b1854e9b6f9bf4a3b6c5b22b78c52069c0f277fd71e751fe7fb6386b7d4f92f459184eb0edc45c2e36e49597d536a8d587f78f078227
6
+ metadata.gz: 87b23b3213fe9e6be20e4abb2d9649d615dbf48ff01c2a711bd938e4b15f5076f311ee524e5470f46ada7119a3bd952034f2d8b58ba4699cc17b908578a97df9
7
+ data.tar.gz: 259d7ca3386713bc78a14d09ff8f0610833d14fd606c3ca36389204be3d9a5681604bdebb1089e9b5f90fa2f988e2ea16608caae2bc41f9f2ec5a3da609d1176
@@ -1,6 +1,12 @@
1
1
  $(document).ready(function() {
2
+
2
3
  $checkboxes = $('[data-boarded-bus]');
3
4
 
5
+ function updateCount() {
6
+ var count = $checkboxes.filter(':checked').length
7
+ $('#boarded-bus-count').text(count + ' boarded')
8
+ }
9
+
4
10
  if ($checkboxes.length < 1) {
5
11
  return;
6
12
  }
@@ -24,6 +30,7 @@ $(document).ready(function() {
24
30
  alert("Request failed, please refresh the page or try again later.");
25
31
  }).always(function() {
26
32
  $('[type=submit][data-bulk-row-edit]').prop('disabled', false);
33
+ updateCount()
27
34
  });
28
35
  });
29
36
  });
@@ -25,7 +25,7 @@ class QuestionnaireDatatable < AjaxDatatablesRails::Base
25
25
  def note(record)
26
26
  output = ''
27
27
  output += '<i class="fa fa-exclamation-triangle icon-space-r"></i> <small>Minor</small>' if record.minor?
28
- output += '<i class="fa fa-bus icon-space-r" title="Bus Captain"></i>' if record.bus_list_id?
28
+ output += '<i class="fa fa-bus icon-space-r" title="Riding bus"></i>' if record.bus_list_id?
29
29
  output += '<small>Captain</small>' if record.is_bus_captain?
30
30
  output = '<div class="center">' + output + '</div>' if output.present?
31
31
  output.html_safe
@@ -22,6 +22,10 @@ class BusList < ApplicationRecord
22
22
  passengers.select(&:checked_in?)
23
23
  end
24
24
 
25
+ def boarded_passengers
26
+ passengers.select(&:boarded_bus?)
27
+ end
28
+
25
29
  def captains
26
30
  passengers.where(is_bus_captain: true)
27
31
  end
@@ -22,7 +22,9 @@
22
22
 
23
23
  %p
24
24
  %strong Passengers:
25
- = "(#{@bus_list.passengers.count} total, #{@bus_list.checked_in_passengers.count} checked in)"
25
+ (#{@bus_list.passengers.count} total,
26
+ <span id="boarded-bus-count">#{@bus_list.boarded_passengers.count} boarded</span>,
27
+ #{@bus_list.checked_in_passengers.count} checked in)
26
28
 
27
29
  %table.table
28
30
  %thead
@@ -46,7 +46,7 @@
46
46
  .col
47
47
  %h4.pb-2
48
48
  Passengers
49
- %small.text-muted (#{@bus_list.passengers.count} total, #{@bus_list.checked_in_passengers.count} checked in)
49
+ %small.text-muted (#{@bus_list.passengers.count} total, #{@bus_list.boarded_passengers.count} boarded, #{@bus_list.checked_in_passengers.count} checked in)
50
50
 
51
51
  %table.table
52
52
  %thead
@@ -101,6 +101,13 @@
101
101
  = link_to @questionnaire.bus_list.name, manage_bus_list_path(@questionnaire.bus_list_id)
102
102
  - else
103
103
  %span.text-muted (none)
104
+ - if @questionnaire.bus_list_id?
105
+ %dt.col-md-4 Boarded bus?
106
+ %dd.col-md-8
107
+ - if @questionnaire.boarded_bus?
108
+ Yes
109
+ - else
110
+ No
104
111
  %dt.col-md-4 Bus captain
105
112
  %dd.col-md-8
106
113
  - if @questionnaire.is_bus_captain?
@@ -1,3 +1,3 @@
1
1
  module HackathonManager
2
- VERSION = '0.12.1'.freeze
2
+ VERSION = '0.12.2'.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.12.1
4
+ version: 0.12.2
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-01-16 00:00:00.000000000 Z
11
+ date: 2019-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails