On met un tag pour indiquer la visibilité, et on fixe le passage vers le visible
This commit is contained in:
parent
52b5830c87
commit
47c8dba260
3 changed files with 32 additions and 1 deletions
|
@ -41,6 +41,26 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="level-right">
|
<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="level-item">
|
||||||
<div class="dropdown is-right">
|
<div class="dropdown is-right">
|
||||||
<div class="dropdown-trigger">
|
<div class="dropdown-trigger">
|
||||||
|
|
|
@ -49,6 +49,17 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="level-right">
|
<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 %}
|
{% if e.tallied %}
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<span class="tag is-success is-light">{% trans "Élection dépouillée" %}</span>
|
<span class="tag is-success is-light">{% trans "Élection dépouillée" %}</span>
|
||||||
|
|
|
@ -93,7 +93,7 @@ class ElectionAdminView(CreatorOnlyMixin, DetailView):
|
||||||
return super().get_queryset().prefetch_related("questions__options")
|
return super().get_queryset().prefetch_related("questions__options")
|
||||||
|
|
||||||
|
|
||||||
class ElectionSetVisibleView(CreatorOnlyEditMixin, BackgroundUpdateView):
|
class ElectionSetVisibleView(CreatorOnlyMixin, BackgroundUpdateView):
|
||||||
model = Election
|
model = Election
|
||||||
pattern_name = "election.admin"
|
pattern_name = "election.admin"
|
||||||
success_message = _("Élection visible !")
|
success_message = _("Élection visible !")
|
||||||
|
|
Loading…
Reference in a new issue