hackathon_manager 0.13.8 → 0.13.9
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 +4 -4
- data/app/controllers/manage/dashboard_controller.rb +22 -10
- data/app/controllers/manage/trackable_tags_controller.rb +1 -1
- data/app/views/manage/dashboard/index.html.haml +1 -1
- data/app/views/manage/schools/show.html.haml +22 -1
- data/lib/hackathon_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2a08f6072d0cd24110a7713e93b2d51f638d6d5db69b4161a5ac3b435ff110a
|
4
|
+
data.tar.gz: dd293ca99e1691f209cc2805b16d4622eea6873fafeefba89b1037d0b8191898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 245becf5bdc9914218fcc6f20e4f00a19b6ff1dc5e4f66221e053d032070c8ac9917b64b929ebc32ff59516909d441ff6919bc5f8763981177f6ea7ef9970774
|
7
|
+
data.tar.gz: e376e3324f1ce9bf63a1706ef22f0f637a6252e42c9e96cb08b6a2e2135259a89815742116eccc44260140eafeee440dd44affbed1760aa466ac41be8df4bd47
|
@@ -10,7 +10,14 @@ class Manage::DashboardController < Manage::ApplicationController
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def todays_activity_data
|
13
|
-
|
13
|
+
where_filter = nil
|
14
|
+
types = ["Applications", "Confirmations", "Denials"]
|
15
|
+
if params[:school_id]
|
16
|
+
where_filter = { school_id: params[:school_id] }
|
17
|
+
else
|
18
|
+
types << "Non-Applied Users"
|
19
|
+
end
|
20
|
+
render json: activity_chart_data(types, "hour", Time.zone.today.beginning_of_day..Time.zone.today.end_of_day, where_filter)
|
14
21
|
end
|
15
22
|
|
16
23
|
def todays_stats_data
|
@@ -24,7 +31,11 @@ class Manage::DashboardController < Manage::ApplicationController
|
|
24
31
|
end
|
25
32
|
|
26
33
|
def confirmation_activity_data
|
27
|
-
|
34
|
+
where_filter = nil
|
35
|
+
if params[:school_id]
|
36
|
+
where_filter = { school_id: params[:school_id] }
|
37
|
+
end
|
38
|
+
render json: activity_chart_data(["Confirmations", "Denials"], "day", 3.week.ago..Time.zone.now, where_filter)
|
28
39
|
end
|
29
40
|
|
30
41
|
def application_activity_data
|
@@ -95,24 +106,25 @@ class Manage::DashboardController < Manage::ApplicationController
|
|
95
106
|
|
96
107
|
private
|
97
108
|
|
98
|
-
def activity_chart_data(types, group_type, range)
|
109
|
+
def activity_chart_data(types, group_type, range, where_filter = nil)
|
99
110
|
chart_data = []
|
100
111
|
types.each do |type|
|
101
112
|
case type
|
102
113
|
when "Applications"
|
103
|
-
data = Questionnaire.send("group_by_#{group_type}", :created_at, range: range)
|
114
|
+
data = Questionnaire.send("group_by_#{group_type}", :created_at, range: range)
|
104
115
|
when "RIT Applications"
|
105
|
-
data = Questionnaire.where("school_id = \"2304\"").send("group_by_#{group_type}", :created_at, range: range)
|
116
|
+
data = Questionnaire.where("school_id = \"2304\"").send("group_by_#{group_type}", :created_at, range: range)
|
106
117
|
when "Non-RIT Applications"
|
107
|
-
data = Questionnaire.where("school_id != \"2304\"").send("group_by_#{group_type}", :created_at, range: range)
|
118
|
+
data = Questionnaire.where("school_id != \"2304\"").send("group_by_#{group_type}", :created_at, range: range)
|
108
119
|
when "Confirmations"
|
109
|
-
data = Questionnaire.where(acc_status: "rsvp_confirmed").send("group_by_#{group_type}", :acc_status_date, range: range)
|
120
|
+
data = Questionnaire.where(acc_status: "rsvp_confirmed").send("group_by_#{group_type}", :acc_status_date, range: range)
|
110
121
|
when "Denials"
|
111
|
-
data = Questionnaire.where(acc_status: "rsvp_denied").send("group_by_#{group_type}", :acc_status_date, range: range)
|
122
|
+
data = Questionnaire.where(acc_status: "rsvp_denied").send("group_by_#{group_type}", :acc_status_date, range: range)
|
112
123
|
when "Non-Applied Users"
|
113
|
-
data = User.without_questionnaire.send("group_by_#{group_type}", "users.created_at", range: range)
|
124
|
+
data = User.without_questionnaire.send("group_by_#{group_type}", "users.created_at", range: range)
|
114
125
|
end
|
115
|
-
|
126
|
+
data = data.where(where_filter) if where_filter && type != "Non-Applied Users"
|
127
|
+
chart_data << { name: type, data: data.count }
|
116
128
|
end
|
117
129
|
chart_data
|
118
130
|
end
|
@@ -22,7 +22,7 @@
|
|
22
22
|
.col-7
|
23
23
|
%h5.dashboard-container-title Today's Activity
|
24
24
|
= area_chart todays_activity_data_manage_dashboard_index_path, colors: [blue, green, red, grey]
|
25
|
-
.col
|
25
|
+
.col-5
|
26
26
|
%h5.dashboard-container-title Today's Stats
|
27
27
|
= pie_chart todays_stats_data_manage_dashboard_index_path, colors: [blue, green, red, grey]
|
28
28
|
|
@@ -1,3 +1,9 @@
|
|
1
|
+
- blue = "#4886C2"
|
2
|
+
- green = "#7FEC8D"
|
3
|
+
- red = "#E44646"
|
4
|
+
- orange = "#F49C54"
|
5
|
+
- grey = "#A6A6A6"
|
6
|
+
|
1
7
|
= render "layouts/manage/page_title", title: @school.name, subtitle: "School" do
|
2
8
|
.btn-group
|
3
9
|
= link_to 'Edit', edit_manage_school_path(@school), class: 'btn btn-sm btn-outline-secondary'
|
@@ -56,9 +62,24 @@
|
|
56
62
|
%span.fa.fa-info-circle.icon-space-l.icon-space-r-half
|
57
63
|
If someone attempts to apply using a name above, they'll automatically be converted to this school.
|
58
64
|
|
65
|
+
.row.mt-2.mb-4
|
66
|
+
.col-7
|
67
|
+
%h4.border-bottom.pb-2.mb-4 Today's Activity
|
68
|
+
= area_chart todays_activity_data_manage_dashboard_index_path(school_id: @school.id), colors: [blue, green, red, grey]
|
69
|
+
.col-5
|
70
|
+
%h4.border-bottom.pb-2.mb-4 Total Distribution
|
71
|
+
= pie_chart @school.questionnaires.group('acc_status').count
|
72
|
+
|
73
|
+
.row.mt-2.mb-4
|
74
|
+
.col
|
75
|
+
%h4.border-bottom.pb-2.mb-4 Confirmation Activity
|
76
|
+
= area_chart confirmation_activity_data_manage_dashboard_index_path(school_id: @school.id), colors: [green, red], library: { legend: { enabled: false } }
|
77
|
+
|
59
78
|
.row.mt-2
|
60
79
|
.col
|
61
|
-
%h4.pb-0
|
80
|
+
%h4.pb-0
|
81
|
+
Questionnaires
|
82
|
+
%small.text-muted (#{@school.questionnaires.count} total)
|
62
83
|
%table.table
|
63
84
|
%caption #{@school.questionnaires.count} total
|
64
85
|
%thead
|
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.
|
4
|
+
version: 0.13.9
|
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
|
+
date: 2019-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|