Skip to content

Commit 2b27536

Browse files
committed
Merged in [14057] from rjsparks@nostrum.com:
Improve the nominee status table to serve as a nomcom dashboard. Fixes ietf-tools#2261. - Legacy-Id: 14067 Note: SVN reference [14057] has been migrated to Git commit 2dbb076
2 parents 2ad08d6 + 2dbb076 commit 2b27536

2 files changed

Lines changed: 61 additions & 10 deletions

File tree

ietf/nomcom/views.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
get_hash_nominee_position, send_reminder_to_nominees,
3232
HOME_TEMPLATE, NOMINEE_ACCEPT_REMINDER_TEMPLATE,NOMINEE_QUESTIONNAIRE_REMINDER_TEMPLATE)
3333
from ietf.ietfauth.utils import role_required
34+
from ietf.person.models import Person
3435

3536
import debug # pyflakes:ignore
3637

@@ -184,13 +185,33 @@ def private_index(request, year):
184185
else:
185186
s[state['slug']] = all_nominee_positions.filter(position__name=s['position__name'],
186187
state=state['slug']).count()
187-
s['total'] = all_nominee_positions.filter(position__name=s['position__name']).count()
188+
s['nominations'] = Feedback.objects.filter(positions__id=s['position__id'], type='nomina').count()
189+
s['nominees'] = all_nominee_positions.filter(position__name=s['position__name']).count()
190+
s['comments'] = Feedback.objects.filter(positions__id=s['position__id'], type='comment').count()
191+
192+
totals = dict()
193+
totals['nominations'] = Feedback.objects.filter(nomcom=nomcom, type='nomina').count()
194+
totals['nominees'] = all_nominee_positions.count()
195+
for state in states:
196+
if state['slug'] == questionnaire_state:
197+
totals[state['slug']] = Feedback.objects.filter(nomcom=nomcom, type='questio').count()
198+
else:
199+
totals[state['slug']] = all_nominee_positions.filter(state=state['slug']).count()
200+
totals['comments'] = Feedback.objects.filter(nomcom=nomcom, type='comment').count()
201+
202+
unique_totals = dict()
203+
unique_totals['nominees'] = Person.objects.filter(nominee__nomcom=nomcom).distinct().count()
204+
for state in states:
205+
if state['slug'] != questionnaire_state:
206+
unique_totals[state['slug']] = len(set(all_nominee_positions.filter(state=state['slug']).values_list('nominee__person',flat=True)))
188207

189208
return render(request, 'nomcom/private_index.html',
190209
{'nomcom': nomcom,
191210
'year': year,
192211
'nominee_positions': nominee_positions,
193212
'stats': stats,
213+
'totals': totals,
214+
'unique_totals': unique_totals,
194215
'states': states,
195216
'positions': positions,
196217
'selected_state': selected_state,

ietf/templates/nomcom/private_index.html

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,58 @@
88
{% origin %}
99
<h2>Nomination status</h2>
1010

11-
<table class="table table-condensed table-striped">
11+
<div class="table-responsive">
12+
<table class="table table-condensed table-striped table-hover col-sm-10">
1213
<thead>
1314
<tr>
14-
<th>Position</th>
15-
<th>Accepted</th>
16-
<th>Declined</th>
17-
<th>Pending</th>
18-
<th>Questionnaire response</th>
19-
<th>Total</th>
15+
<th class="col-sm-3">Position</th>
16+
<th class="col-sm-1">Nominations</th>
17+
<th class="col-sm-1">Unique Nominees</th>
18+
<th class="col-sm-1">Accepted</th>
19+
<th class="col-sm-1">Declined</th>
20+
<th class="col-sm-1">Pending</th>
21+
<th class="col-sm-1">Questionnaire responses</th>
22+
<th class="col-sm-1">Comments</th>
2023
</tr>
2124
</thead>
2225
<tbody>
2326
{% for item in stats %}
2427
<tr>
2528
<td>{{ item.position__name }}</td>
29+
<td>{{ item.nominations }}</td>
30+
<td>{{ item.nominees }}</td>
2631
<td>{{ item.accepted }}</td>
2732
<td>{{ item.declined }}</td>
2833
<td>{{ item.pending }}</td>
2934
<td>{{ item.questionnaire }}</td>
30-
<td>{{ item.total }}</td>
35+
<td>{{ item.comments }}</td>
3136
</tr>
3237
{% endfor %}
3338
</tbody>
39+
<tfoot>
40+
<tr>
41+
<th>Totals</th>
42+
<th>{{ totals.nominations }}</th>
43+
<th>{{ totals.nominees }}</th>
44+
<th>{{ totals.accepted }}</th>
45+
<th>{{ totals.declined }}</th>
46+
<th>{{ totals.pending }}</th>
47+
<th>{{ totals.questionnaire }}</th>
48+
<th>{{ totals.comments }}</th>
49+
</tr>
50+
<tr>
51+
<th>Unique Nominee Totals</th>
52+
<th>-</th>
53+
<th>{{ unique_totals.nominees }}</th>
54+
<th>{{ unique_totals.accepted }}</th>
55+
<th>{{ unique_totals.declined }}</th>
56+
<th>{{ unique_totals.pending }}</th>
57+
<th>-</th>
58+
<th>-</th>
59+
</tr>
60+
</tfoot>
3461
</table>
62+
</div>
3563

3664
<h2>Nominees by position</h2>
3765

@@ -66,11 +94,12 @@ <h2>Nominees by position</h2>
6694
</form>
6795

6896

97+
<div class="table-responsive">
6998
{% if is_chair and nomcom.group.state_id == 'active' %}
7099
<form class="form-inline" id="batch-action-form" method="post">{% csrf_token %}
71100
{% endif %}
72101

73-
<table class="table table-condensed table-striped">
102+
<table class="table table-condensed table-striped table-hover">
74103
<thead>
75104
<tr>
76105
{% if is_chair and nomcom.group.state_id == 'active' %}<th colspan="2"><span class="fa fa-check"></span></th>{% endif %}
@@ -117,5 +146,6 @@ <h2>Nominees by position</h2>
117146
</form>
118147
{% endif %}
119148
{% endif %}
149+
</div>
120150

121151
{% endblock %}

0 commit comments

Comments
 (0)