mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 01:58:23 +02:00
Add buttons to hide notes from public if needed
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -109,22 +109,6 @@
|
||||
</div>
|
||||
{% if user.registration.is_admin or user.registration in tournament.organizers.all %}
|
||||
<div class="card-footer text-center">
|
||||
{% if not available_notes_1 or not available_notes_2 %}
|
||||
<div class="btn-group">
|
||||
{% if not available_notes_1 %}
|
||||
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=1 %}" class="btn btn-info">
|
||||
<i class="fas fa-upload"></i>
|
||||
{% trans "Publish notes for first round" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if not available_notes_2 %}
|
||||
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=2 %}" class="btn btn-info">
|
||||
<i class="fas fa-upload"></i>
|
||||
{% trans "Publish notes for second round" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="btn-group">
|
||||
<a href="{% url 'participation:tournament_harmonize' pk=tournament.pk round=1 %}" class="btn btn-secondary">
|
||||
<i class="fas fa-ranking-star"></i>
|
||||
@ -136,6 +120,32 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<div class="btn-group">
|
||||
{% if not available_notes_1 %}
|
||||
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=1 %}" class="btn btn-sm btn-info">
|
||||
<i class="fas fa-eye"></i>
|
||||
{% trans "Publish notes for first round" %}
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=1 %}?hide" class="btn btn-sm btn-danger">
|
||||
<i class="fas fa-eye-slash"></i>
|
||||
{% trans "Unpublish notes for first round" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if not available_notes_2 %}
|
||||
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=2 %}" class="btn btn-sm btn-info">
|
||||
<i class="fas fa-eye"></i>
|
||||
{% trans "Publish notes for second round" %}
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=2 %}?hide" class="btn btn-sm btn-danger">
|
||||
<i class="fas fa-eye-slash"></i>
|
||||
{% trans "Unpublish notes for second round" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -703,8 +703,11 @@ class TournamentPublishNotesView(VolunteerMixin, SingleObjectMixin, RedirectView
|
||||
raise Http404
|
||||
|
||||
tournament = Tournament.objects.get(pk=kwargs["pk"])
|
||||
tournament.pools.filter(round=kwargs["round"]).update(results_available=True)
|
||||
messages.success(request, _("Notes published!"))
|
||||
tournament.pools.filter(round=kwargs["round"]).update(results_available='hide' not in request.GET)
|
||||
if 'hide' not in request.GET:
|
||||
messages.success(request, _("Notes published!"))
|
||||
else:
|
||||
messages.success(request, _("Notes hidden!"))
|
||||
return super().get(request, *args, **kwargs)
|
||||
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
|
Reference in New Issue
Block a user