mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-30 18:01:25 +02:00
Remove jquery dependency code (keep it for bootstrap-select)
This commit is contained in:
@ -1,4 +0,0 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
default_app_config = 'eastereggs.apps.EastereggsConfig'
|
@ -1,8 +0,0 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class EastereggsConfig(AppConfig):
|
||||
name = 'eastereggs'
|
@ -1,2 +0,0 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
@ -1,19 +0,0 @@
|
||||
{% extends "index.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div id="index-content"></div>
|
||||
{% include "eastereggs/xp_modal.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#index-content").load("{% url "index" %} #content");
|
||||
function displayModal() {
|
||||
$("#xpModal").modal('toggle');
|
||||
setTimeout(displayModal, 400);
|
||||
}
|
||||
displayModal();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
@ -1,18 +0,0 @@
|
||||
{% load crispy_forms_filters i18n %}
|
||||
|
||||
<div id="xpModal" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{% trans "Error" %}</h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{% trans "This task failed successfully." %}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,11 +0,0 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from django.urls import path
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
app_name = "eastereggs"
|
||||
|
||||
urlpatterns = [
|
||||
path("xp/", TemplateView.as_view(template_name="eastereggs/xp.html")),
|
||||
]
|
@ -63,12 +63,8 @@
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('button[data-bs-target="#uploadSolutionModal"]').click(function() {
|
||||
let modalBody = $("#uploadSolutionModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:upload_solution" pk=participation.pk %} #form-content")
|
||||
});
|
||||
});
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
initModal("uploadSolution", "{% url "participation:upload_solution" pk=participation.pk %}")
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -119,27 +119,15 @@
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
{% if notes is not None %}
|
||||
$('button[data-bs-target="#updatePassageModal"]').click(function() {
|
||||
let modalBody = $("#updatePassageModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:passage_update" pk=passage.pk %} #form-content")
|
||||
});
|
||||
initModal("updatePassage", "{% url "participation:passage_update" pk=passage.pk %}")
|
||||
|
||||
{% if my_note is not None %}
|
||||
$('button[data-bs-target="#updateNotesModal"]').click(function() {
|
||||
let modalBody = $("#updateNotesModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:update_notes" pk=my_note.pk %} #form-content")
|
||||
});
|
||||
initModal("updateNotesModal", "{% url "participation:update_notes" pk=my_note.pk %}")
|
||||
{% endif %}
|
||||
{% elif user.registration.participates %}
|
||||
$('button[data-bs-target="#uploadSynthesisModal"]').click(function() {
|
||||
let modalBody = $("#uploadSynthesisModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:upload_synthesis" pk=passage.pk %} #form-content")
|
||||
});
|
||||
initModal("uploadSynthesis", "{% url "participation:upload_synthesis" pk=passage.pk %}")
|
||||
{% endif %}
|
||||
});
|
||||
</script>
|
||||
|
@ -88,30 +88,11 @@
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('button[data-bs-target="#updatePoolModal"]').click(function() {
|
||||
let modalBody = $("#updatePoolModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:pool_update" pk=pool.pk %} #form-content")
|
||||
});
|
||||
|
||||
$('button[data-bs-target="#updateTeamsModal"]').click(function() {
|
||||
let modalBody = $("#updateTeamsModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:pool_update_teams" pk=pool.pk %} #form-content")
|
||||
});
|
||||
|
||||
$('button[data-bs-target="#addPassageModal"]').click(function() {
|
||||
let modalBody = $("#addPassageModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:passage_create" pk=pool.pk %} #form-content")
|
||||
});
|
||||
|
||||
$('button[data-bs-target="#uploadNotesModal"]').click(function() {
|
||||
let modalBody = $("#uploadNotesModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:pool_upload_notes" pk=pool.pk %} #form-content")
|
||||
});
|
||||
});
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
initModal("updatePool", "{% url "participation:pool_update" pk=pool.pk %}")
|
||||
initModal("updateTeams", "{% url "participation:pool_update_teams" pk=pool.pk %}")
|
||||
initModal("addPassage", "{% url "participation:passage_create" pk=pool.pk %}")
|
||||
initModal("uploadNotes", "{% url "participation:pool_upload_notes" pk=pool.pk %}")
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -199,22 +199,10 @@
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('button[data-bs-target="#uploadMotivationLetterModal"]').click(function() {
|
||||
let modalBody = $("#uploadMotivationLetterModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:upload_team_motivation_letter" pk=team.pk %} #form-content");
|
||||
});
|
||||
$('button[data-bs-target="#updateTeamModal"]').click(function() {
|
||||
let modalBody = $("#updateTeamModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:update_team" pk=team.pk %} #form-content");
|
||||
});
|
||||
$('button[data-bs-target="#leaveTeamModal"]').click(function() {
|
||||
let modalBody = $("#leaveTeamModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:team_leave" %} #form-content");
|
||||
});
|
||||
});
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
initModal("uploadMotivationLetter", "{% url "participation:upload_team_motivation_letter" pk=team.pk %}")
|
||||
initModal("updateTeam", "{% url "participation:update_team" pk=team.pk %}")
|
||||
initModal("leaveTeam", "{% url "participation:team_leave" %}")
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -116,13 +116,9 @@
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
{% if user.registration.is_admin %}
|
||||
$('button[data-bs-target="#addPoolModal"]').click(function() {
|
||||
let modalBody = $("#addPoolModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:pool_create" %} #form-content")
|
||||
});
|
||||
initModal("addPool", "{% url "participation:pool_create" %}")
|
||||
{% endif %}
|
||||
});
|
||||
</script>
|
||||
|
@ -29,17 +29,3 @@
|
||||
{{ admin_registration_form|crispy }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$("#id_type").change(function() {
|
||||
let selected_role = $("#id_type :selected");
|
||||
if (selected_role.val() === "volunteer") {
|
||||
$("#registration_form").html($("#volunteer_registration_form").html());
|
||||
}
|
||||
else {
|
||||
$("#registration_form").html($("#admin_registration_form").html());
|
||||
}
|
||||
}).change();
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -30,14 +30,17 @@
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$("#id_role").change(function() {
|
||||
let selected_role = $("#id_role :selected");
|
||||
if (selected_role.val() === "participant") {
|
||||
$("#registration_form").html($("#student_registration_form").html());
|
||||
}
|
||||
else {
|
||||
$("#registration_form").html($("#coach_registration_form").html());
|
||||
}
|
||||
}).change();
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
let role_elem = document.getElementById("id_role")
|
||||
function updateView () {
|
||||
let selected_role = role_elem.options[role_elem.selectedIndex].value
|
||||
if (selected_role === "participant")
|
||||
document.getElementById("registration_form").innerHTML = document.getElementById("student_registration_form").innerHTML
|
||||
else
|
||||
document.getElementById("registration_form").innerHTML = document.getElementById("coach_registration_form").innerHTML
|
||||
}
|
||||
role_elem.addEventListener('change', updateView)
|
||||
updateView()
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -209,35 +209,16 @@
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
{% if user_object.registration.team and not user_object.registration.team.participation.valid %}
|
||||
$('button[data-bs-target="#uploadPhotoAuthorizationModal"]').click(function() {
|
||||
let modalBody = $("#uploadPhotoAuthorizationModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "registration:upload_user_photo_authorization" pk=user_object.registration.pk %} #form-content");
|
||||
});
|
||||
$('button[data-bs-target="#uploadHealthSheetModal"]').click(function() {
|
||||
let modalBody = $("#uploadHealthSheetModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "registration:upload_user_health_sheet" pk=user_object.registration.pk %} #form-content");
|
||||
});
|
||||
$('button[data-bs-target="#uploadVaccineSheetModal"]').click(function() {
|
||||
let modalBody = $("#uploadVaccineSheetModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "registration:upload_user_vaccine_sheet" pk=user_object.registration.pk %} #form-content");
|
||||
});
|
||||
$('button[data-bs-target="#uploadParentalAuthorizationModal"]').click(function() {
|
||||
let modalBody = $("#uploadParentalAuthorizationModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "registration:upload_user_parental_authorization" pk=user_object.registration.pk %} #form-content");
|
||||
});
|
||||
initModal("uploadPhotoAuthorization", "{% url "registration:upload_user_photo_authorization" pk=user_object.registration.pk %}")
|
||||
initModal("uploadHealthSheet", "{% url "registration:upload_user_health_sheet" pk=user_object.registration.pk %}")
|
||||
initModal("uploadVaccineSheet", "{% url "registration:upload_user_vaccine_sheet" pk=user_object.registration.pk %}")
|
||||
initModal("uploadParentalAuthorization", "{% url "registration:upload_user_parental_authorization" pk=user_object.registration.pk %}")
|
||||
{% endif %}
|
||||
|
||||
{% if user_object.registration.team.participation.valid %}
|
||||
$('button[data-bs-target="#updatePaymentModal"]').click(function() {
|
||||
let modalBody = $("#updatePaymentModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "registration:update_payment" pk=user_object.registration.payment.pk %} #form-content");
|
||||
});
|
||||
initModal("updatePaymentModal", "{% url "registration:update_payment" pk=user_object.registration.payment.pk %}")
|
||||
{% endif %}
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user