Added a new UI feature which now shows all of the event results (once decrypted) in a basic but easy to read table which can be enhanced at a later point
This commit is contained in:
parent
0ff10474c4
commit
33398b9993
8 changed files with 79 additions and 25 deletions
|
@ -1 +1 @@
|
|||
© 2014-2015 See LICENSE
|
||||
© DĒMOS 2, Lancaster University 2014-2018.
|
||||
|
|
|
@ -44,17 +44,32 @@
|
|||
<br/>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="{% block event_nav_details %}{% endblock %}">
|
||||
<a href="{% url 'polls:view-event' event.uuid %}"><strong>Summary</strong></a>
|
||||
<a href="{% url 'polls:view-event' event.uuid %}">
|
||||
<span class="glyphicon glyphicon-dashboard"></span> <strong>Summary</strong>
|
||||
</a>
|
||||
</li>
|
||||
<li class="{% block event_nav_polls %}{% endblock %}">
|
||||
<a href="{% url 'polls:event-polls' event.uuid %}"><strong>Polls ({{ object.polls.count }})</strong></a>
|
||||
<a href="{% url 'polls:event-polls' event.uuid %}">
|
||||
<span class="glyphicon glyphicon-list-alt"></span> <strong>Polls ({{ object.polls.count }})</strong>
|
||||
</a>
|
||||
</li>
|
||||
<li class="{% block event_nav_organisers %}{% endblock %}">
|
||||
<a href="{% url 'polls:event-entities' event.uuid %}"><strong>Entities</strong></a>
|
||||
<a href="{% url 'polls:event-entities' event.uuid %}">
|
||||
<span class="glyphicon glyphicon-user"></span> <strong>Entities</strong>
|
||||
</a>
|
||||
</li>
|
||||
{% if decrypted == True and object.ended == True %}
|
||||
<li class="{% block event_nav_results %}{% endblock %}">
|
||||
<a href="{% url 'polls:event-results' event.uuid %}">
|
||||
<span class="glyphicon glyphicon-stats"></span> <strong>Results</strong>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if is_organiser %}
|
||||
<li class="{% block event_nav_launch %}{% endblock %}">
|
||||
<a href="{% url 'polls:event-advanced' event.uuid %}"><strong>Advanced</strong></a>
|
||||
<a href="{% url 'polls:event-advanced' event.uuid %}">
|
||||
<span class="glyphicon glyphicon-info-sign"></span> <strong>Advanced</strong>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{% block event_nav_organisers %}active{% endblock %}
|
||||
{% block event_content %}
|
||||
<h2>Event Organisers</h2>
|
||||
<h2>Event Organisers ({{ object.users_organisers.all.count }})</h2>
|
||||
<hr/>
|
||||
{% if object.users_organisers.all %}
|
||||
<ul class="list-group">
|
||||
|
@ -16,7 +16,7 @@
|
|||
<p>No organisers for this Event.</p>
|
||||
{% endif %}
|
||||
<hr/>
|
||||
<h2>Event Trustees</h2>
|
||||
<h2>Event Trustees ({{ object.users_trustees.all.count }})</h2>
|
||||
<hr/>
|
||||
{% if object.users_trustees.all %}
|
||||
<ul class="list-group">
|
||||
|
@ -28,7 +28,7 @@
|
|||
<p>No trustees for this Event.</p>
|
||||
{% endif %}
|
||||
<hr/>
|
||||
<h2>Voters</h2>
|
||||
<h2>Voters ({{ object.voters.all.count }})</h2>
|
||||
<hr/>
|
||||
{% if object.voters.all %}
|
||||
<ul class="list-group">
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
<th class="text-center">No. Polls</th>
|
||||
<th class="text-center">Actions</th>
|
||||
<th class="text-center">Status</th>
|
||||
<!-- Could also add a delete column to easily remove an event -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
28
allauthdemo/templates/polls/event_results.html
Normal file
28
allauthdemo/templates/polls/event_results.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
{% extends "polls/event_detail_base.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load bootstrap3 %}
|
||||
|
||||
{% block event_nav_results %}active{% endblock %}
|
||||
{% block event_content %}
|
||||
{% for poll_result in event_results %}
|
||||
<div class="form-group">
|
||||
<h3 class="marginTopResultTable">{{ poll_result.name }}</h3>
|
||||
<table id="results-table-{{ forloop.counter }}" class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="resultsCol text-center">Option</th>
|
||||
<th class="resultsCol text-center">Votes</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for option in poll_result.options %}
|
||||
<tr>
|
||||
<td class="resultsCol text-center">{{ option.option }}</td>
|
||||
<td class="resultsCol text-center">{{ option.votes }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
Reference in a new issue