On met un tag pour indiquer la visibilité, et on fixe le passage vers le visible

This commit is contained in:
Tom Hubrecht 2021-06-17 21:42:00 +02:00
parent 52b5830c87
commit 47c8dba260
3 changed files with 32 additions and 1 deletions

View file

@ -41,6 +41,26 @@
</div>
<div class="level-right">
{# Visibilité de l'élection #}
<div class="level-item">
{% if not election.visible %}
<span class="tag is-medium is-outlined is-warning is-light">
<span class="icon">
<i class="fas fa-eye-slash"></i>
</span>
<span>{% trans "Élection invisible" %}</span>
</span>
{% else %}
<span class="tag is-medium is-outlined is-primary is-light">
<span class="icon">
<i class="fas fa-eye"></i>
</span>
<span>{% trans "Élection visible" %}</span>
</span>
{% endif %}
</div>
{# Menu d'actions #}
<div class="level-item">
<div class="dropdown is-right">
<div class="dropdown-trigger">

View file

@ -49,6 +49,17 @@
</div>
<div class="level-right">
{% if not e.visible %}
<div class="level-item">
<span class="tag is-warning is-light">
<span class="icon">
<i class="fas fa-eye-slash"></i>
</span>
<span>{% trans "Élection invisible" %}</span>
</span>
</div>
{% endif %}
{% if e.tallied %}
<div class="level-item">
<span class="tag is-success is-light">{% trans "Élection dépouillée" %}</span>

View file

@ -93,7 +93,7 @@ class ElectionAdminView(CreatorOnlyMixin, DetailView):
return super().get_queryset().prefetch_related("questions__options")
class ElectionSetVisibleView(CreatorOnlyEditMixin, BackgroundUpdateView):
class ElectionSetVisibleView(CreatorOnlyMixin, BackgroundUpdateView):
model = Election
pattern_name = "election.admin"
success_message = _("Élection visible !")