diff --git a/colleges/templates/colleges/potentialfellowship_list.html b/colleges/templates/colleges/potentialfellowship_list.html index 6154aa24b78339ccbbafc6784882547b961e3886..89e06dab9485af28eeb498db6d4dfbf8fd00fc6c 100644 --- a/colleges/templates/colleges/potentialfellowship_list.html +++ b/colleges/templates/colleges/potentialfellowship_list.html @@ -121,7 +121,7 @@ $(document).ready(function($) { <div class="single d-inline" data-specialization="{{expertise|lower}}" data-toggle="tooltip" data-placement="bottom" title="{{expertise|get_specialization_display}}">{{expertise|get_specialization_code}}</div> {% endfor %} </td> - <td style="color: #ffffff; background-color:{{ potfel.status|potfelstatuscolor }};">{{ potfel.get_status_display }}</td> + <td style="color: #ffffff; background-color:{{ potfel.status|potfelstatuscolor }};">{{ potfel.get_status_display }} <small>{% voting_results_display potfel %}</small></td> <td>{{ potfel.latest_event_details }}</td> </tr> {% empty %} diff --git a/colleges/templatetags/colleges_extras.py b/colleges/templatetags/colleges_extras.py index edabc06203d95acbf93e7630d979f79366c7ae99..13a510c612de262bff017503d69c40950cb34f5d 100644 --- a/colleges/templatetags/colleges_extras.py +++ b/colleges/templatetags/colleges_extras.py @@ -57,3 +57,13 @@ def potfelstatuscolor(status): elif status == POTENTIAL_FELLOWSHIP_SCIPOST_EMERITUS: color = hslColorWheel(12, 4, 40, 40) return color + + +@register.simple_tag +def voting_results_display(potfel): + if potfel.status == POTENTIAL_FELLOWSHIP_ELECTION_VOTE_ONGOING: + return ' Agree: %s, Abstain: %s, Disagree: %s' % ( + potfel.in_agreement.count(), + potfel.in_abstain.count(), + potfel.in_disagreement.count()) + return ''