1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-23 02:38:21 +02:00

Update calendar

This commit is contained in:
Yohann D'ANELLO
2020-10-20 14:21:16 +02:00
parent 2d467ef3af
commit 42e1abd9aa
7 changed files with 94 additions and 43 deletions

View File

@ -3,7 +3,7 @@
{% load crispy_forms_filters i18n %}
{% block content %}
<form method="post">
<form method="post" action="{% url "participation:update_phase" pk=object.pk %}">
<div id="form-content">
{% csrf_token %}
{{ form|crispy }}

View File

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