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

Register pools

This commit is contained in:
Yohann D'ANELLO
2021-01-13 17:00:50 +01:00
parent 4faec03efb
commit 4d83664c0d
10 changed files with 91 additions and 12 deletions

View File

@ -50,7 +50,6 @@
<script>
$(document).ready(function () {
$('button[data-target="#uploadSolutionModal"]').click(function() {
console.log(42)
let modalBody = $("#uploadSolutionModal div.modal-body");
if (!modalBody.html().trim())
modalBody.load("{% url "participation:upload_solution" pk=participation.pk %} #form-content")

View File

@ -0,0 +1 @@
{% extends "base.html" %}

View File

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% load crispy_forms_filters i18n %}
{% block content %}
<form method="post" enctype="multipart/form-data">
<div id="form-content">
{% csrf_token %}
{{ form|crispy }}
</div>
<button class="btn btn-primary" type="submit">{% trans "Update pool" %}</button>
</form>
{% endblock content %}

View File

@ -69,6 +69,23 @@
</div>
{% if user.registration.is_admin %}
<a class="btn btn-block btn-success" href="#">{% trans "Add new pool" %}</a>
<button class="btn btn-block btn-success" data-toggle="modal" data-target="#addPoolModal">{% trans "Add new pool" %}</button>
{% endif %}
{% trans "Add pool" as modal_title %}
{% trans "Add" as modal_button %}
{% url "participation:pool_create" as modal_action %}
{% include "base_modal.html" with modal_id="addPool" %}
{% endblock %}
{% block extrajavascript %}
<script>
$(document).ready(function () {
$('button[data-target="#addPoolModal"]').click(function() {
let modalBody = $("#addPoolModal div.modal-body");
if (!modalBody.html().trim())
modalBody.load("{% url "participation:pool_create" %} #form-content")
});
});
</script>
{% endblock %}