forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreview_stats.html
More file actions
263 lines (225 loc) · 8.27 KB
/
review_stats.html
File metadata and controls
263 lines (225 loc) · 8.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
{% extends "base.html" %}
{% load origin %}{% origin %}
{% load ietf_filters static bootstrap3 %}
{% block pagehead %}
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
<link rel="stylesheet" href="{% static 'bootstrap-datepicker/css/bootstrap-datepicker3.min.css' %}">
{% endblock %}
{% block content %}
{% origin %}
<h1>
{% block title %}
{% if level == "team" %}
Statistics for review teams
{% elif level == "reviewer" %}
Statistics for reviewers in {{ reviewers_for_team.name }}
{% endif %}
{% endblock %}
</h1>
{% if level == "reviewer" %}
<p><a href="{{ team_level_url }}">« Back to teams</a></p>
{% endif %}
<div class="stats-options well">
<div>
Show:
<div class="btn-group">
{% for slug, label, url in possible_stats_types %}
<a class="btn btn-default {% if slug == stats_type %}active{% endif %}" href="{{ url }}">{{ label }}</a>
{% endfor %}
</div>
</div>
<div>
Count:
<div class="btn-group">
{% for slug, label, url in possible_count_choices %}
<a class="btn btn-default {% if slug == count %}active{% endif %}" href="{{ url }}">{{ label }}</a>
{% endfor %}
</div>
</div>
<form class="form-inline date-range">
Request time:
<input class="form-control" type="text" name="from" value="{{ from_date }}" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-autoclose="1" data-date-end-date="{{ today.isoformat }}" data-date-start-view="months">
-
<input class="form-control" type="text" name="to" value="{{ to_date }}" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-autoclose="1" data-date-end-date="{{ today.isoformat }}" data-date-start-view="months">
{% for name, value in request.GET.iteritems %}
{% if name != "from" and name != "to" %}
<input type="hidden" name="{{ name }}" value="{{ value }}">
{% endif %}
{% endfor %}
<button class="btn btn-default" type="submit">Set</button>
</form>
{% if stats_type == "time" %}
<hr>
<div>
Team:
<div class="btn-group">
{% for slug, label, url in possible_teams %}
<a class="btn btn-default {% if slug in selected_teams %}active{% endif %}" href="{{ url }}">{{ label }}</a>
{% endfor %}
</div>
</div>
{% if selected_teams %}
<div>
Completion:
<div class="btn-group">
{% for slug, label, url in possible_completion_types %}
<a class="btn btn-default {% if slug == selected_completion_type %}active{% endif %}" href="{{ url }}">{{ label }}</a>
{% endfor %}
</div>
</div>
<div>
Result:
<div class="btn-group">
{% for slug, label, url in possible_results %}
<a class="btn btn-default {% if slug == selected_result %}active{% endif %}" href="{{ url }}">{{ label }}</a>
{% endfor %}
</div>
</div>
<div>
State:
<div class="btn-group">
{% for slug, label, url in possible_states %}
<a class="btn btn-default {% if slug == selected_state %}active{% endif %}" href="{{ url }}">{{ label }}</a>
{% endfor %}
</div>
</div>
{% endif %}
{% endif %}
</div>
{% if stats_type == "completion" %}
<h3>Completion status and completion time</h3>
<table class="review-stats table tablesorter">
<thead>
<th>
{% if level == "team" %}
Team
{% elif level == "reviewer" %}
Reviewer
{% endif %}
</th>
<th title="Requests that are currently requested or accepted by reviewer">Open in time</th>
<th title="Requests that are currently requested or accepted by reviewer and past the deadline">Open late</th>
<th title="Requests that have been completed partially or completely">Completed in time</th>
<th title="Requests that have been completed partially or completely past the deadline">Completed late</th>
<th title="Requests that are rejected by the reviewer, withdrawn, overtaken by events or with no response from reviewer">Not completed</th>
<th title="Average time between assignment and completion for completed reviews, in days">Avg. compl. days{% if count == "pages" %}/page{% endif %}</th>
</thead>
<tbody>
{% for row in data %}
<tr {% if row.obj == "Totals" %}class="totals"{% endif %}>
<td>{{ row.obj }}</td>
<td>{{ row.open_in_time }}</td>
<td>{{ row.open_late }}</td>
<td>{{ row.completed_in_time }}</td>
<td>{{ row.completed_late }}</td>
<td>{{ row.not_completed }}</td>
<td>
{% if row.average_assignment_to_closure_days != None %}
{{ row.average_assignment_to_closure_days|floatformat }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% elif stats_type == "results" %}
<h3>Results of completed reviews</h3>
<table class="review-stats table tablesorter">
<thead>
<th>
{% if level == "team" %}
Team
{% elif level == "reviewer" %}
Reviewer
{% endif %}
</th>
{% for r in results %}
<th>{{ r.name }}</th>
{% endfor %}
</thead>
<tbody>
{% for row in data %}
<tr {% if row.obj == "Totals" %}class="totals"{% endif %}>
<td>{{ row.obj }}</td>
{% for c in row.result_list %}
<td>{{ c }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% elif stats_type == "states" %}
<h3>Specific request states</h3>
<table class="review-stats table tablesorter">
<thead>
<th>
{% if level == "team" %}
Team
{% elif level == "reviewer" %}
Reviewer
{% endif %}
</th>
{% for s in states %}
<th>{{ s.name }}</th>
{% endfor %}
</thead>
<tbody>
{% for row in data %}
<tr {% if row.obj == "Totals" %}class="totals"{% endif %}>
<td>{{ row.obj }}</td>
{% for c in row.state_list %}
<td>{{ c }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% elif stats_type == "time" and selected_teams %}
<h3>Counts per month</h3>
<div class="stats-time-graph"></div>
<script>
var timeSeriesData = {{ data|safe }};
var timeSeriesOptions = {
xaxis: {
mode: "time",
tickLength: 0
},
yaxis: {
tickDecimals: {% if selected_completion_type == "average_assignment_to_closure_days" %}null{% else %}0{% endif %}
},
series: {
stack: true,
bars: {
show: true,
barWidth: 20 * 24 * 60 * 60 * 1000,
align: "center",
lineWidth: 1,
fill: 0.6
}
}
};
</script>
{% endif %}
{% if stats_type != "time" %}
<p class="text-muted text-right">Note: {% if level == "team" %}teams{% elif level == "reviewer" %}reviewers{% endif %}
with no requests in the period are omitted.</p>
{% endif %}
{% if level == "team" and stats_type != "time" %}
<p>Statistics for individual reviewers:</p>
<div class="review-stats-teams">
{% for t in teams %}
<a href="{{ t.reviewer_stats_url }}">{{ t.name }}</a>
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% block js %}
<script src="{% static "jquery.tablesorter/js/jquery.tablesorter.combined.min.js" %}"></script>
<script src="{% static 'bootstrap-datepicker/js/bootstrap-datepicker.min.js' %}"></script>
{% if stats_type == "time" %}
<script src="{% static 'flot/jquery.flot.min.js' %}"></script>
<script src="{% static 'flot/jquery.flot.time.min.js' %}"></script>
<script src="{% static 'flot/jquery.flot.stack.min.js' %}"></script>
<script src="{% static 'ietf/js/review-stats.js' %}"></script>
{% endif %}
{% endblock %}