Only administrators can update the calendar

This commit is contained in:
Yohann D'ANELLO 2020-10-20 14:23:38 +02:00
parent 072ba3b2a3
commit 9571cfc19d
1 changed files with 11 additions and 11 deletions

View File

@ -18,16 +18,16 @@
{% include "base_modal.html" with modal_id="updatePhase" %} {% include "base_modal.html" with modal_id="updatePhase" %}
{% endblock %} {% endblock %}
{% block extrajavascript %}
{% if user.registration.is_admin %} {% if user.registration.is_admin %}
{% block extrajavascript %} <script>
<script> $("tr").click(function () {
$("tr").click(function () { let modalBody = $("#updatePhaseModal div.modal-body");
let modalBody = $("#updatePhaseModal div.modal-body"); if (!modalBody.html().trim())
if (!modalBody.html().trim()) modalBody.load("{% url "participation:calendar" %}" + $(this).data("id") + "/ #form-content");
modalBody.load("{% url "participation:calendar" %}" + $(this).data("id") + "/ #form-content"); $("#updatePhase-form").attr("action", "{% url "participation:calendar" %}" + $(this).data("id") + "/")
$("#updatePhase-form").attr("action", "{% url "participation:calendar" %}" + $(this).data("id") + "/") $("#updatePhaseModal").modal();
$("#updatePhaseModal").modal(); })
}) </script>
</script>
{% endblock %}
{% endif %} {% endif %}
{% endblock %}