gvot/gvot/templates/modeladmin/index_results.html

83 lignes
3.1 KiB
HTML

{% extends "wagtailadmin/base.html" %}
{% load static i18n accessors %}
{% block titletag %}Résultats pour « {{ object.title }} »{% endblock %}
{% block content %}
<header class="nice-padding" role="banner">
<div class="row">
<div class="left">
<div class="col header-title">
<h1 class="icon icon-form">
Résultats pour « {{ object.title }} »
</h1>
<div class="row">
{% include "includes/participation.html" with participation=object.get_participation %}
</div>
</div>
</div>
<div class="right">
<a href="?action=CSV{% if split_by %}&split-by={{ split_by|slugify }}{% endif %}" class="button bicolor icon icon-download">{% trans 'Download CSV' %}</a>
{% if can_split_by %}
<div style="margin-top: 1em">
<div class="dropdown dropdown-button match-width">
<button value="drop down" class="button bicolor icon icon-cogs">Séparer par</button>
<div class="dropdown-toggle icon icon-arrow-down" style="background-color: #00676a;" ></div>
<ul>
{% for link, item in can_split_by.items %}
<li><a href="?split-by={{ link }}">{{ item }}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
</div>
</div>
</header>
<div class="nice-padding">
{% if has_results %}
<div class="overflow">
{% for header, listing, participation in results %}
{% if listing %}
{% if split_by %}
<section id="{{ split_by|slugify }}">
<h2>{{ split_by }} : {{ header | default_if_none:"Indéfini" }}</h2>
<div class="row">
{% include "includes/participation.html" %}
</div>
{% endif %}
<table class="listing">
<col />
<col style="text-align:right"/>
<col width="90%"/>
<thead>
<tr>
<th>Champs de formulaire</th>
<th>Occurences</th>
<th>Valeurs</th>
</tr>
</thead>
<tbody>
{% for field, field_results in listing.items %}
<tr>
<td class="title"><h2>{{ field | title }}</h2></td><td /><td />
</tr>
{% for choice, count in field_results %}
<tr>
<td /><td style="text-align:right;padding-right:2em;"><strong>{{ count }}</strong></td><td>{{ choice | default_if_none:"Aucun(e)" }}</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
{% if split_by %}
<hr>
</section>
{% endif %}
{% endif %}
{% endfor %}
</div>
{% else %}
<p class="no-results-message">Il n'y a pas encore de réponse à ce scrutin.</p>
{% endif %}
</div>
{% endblock %}