The user detail page is on a separate page since custom JS can't be loaded

This commit is contained in:
Yohann D'ANELLO 2021-01-24 23:40:05 +01:00
parent 6898e9413a
commit 8212568fee
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 1 additions and 11 deletions

View File

@ -150,7 +150,7 @@
</div> </div>
{% if user.pk == user_object.pk or user.registration.is_admin %} {% if user.pk == user_object.pk or user.registration.is_admin %}
<div class="card-footer text-center"> <div class="card-footer text-center">
<button class="btn btn-primary" data-toggle="modal" data-target="#updateUserModal">{% trans "Update" %}</button> <a class="btn btn-primary" href="{% url "registration:update_user" pk=user_object.pk %}">{% trans "Update" %}</a>
{% if user.registration.is_admin %} {% if user.registration.is_admin %}
<a class="btn btn-info" href="{% url "registration:user_impersonate" pk=user_object.pk %}">{% trans "Impersonate" %}</a> <a class="btn btn-info" href="{% url "registration:user_impersonate" pk=user_object.pk %}">{% trans "Impersonate" %}</a>
{% endif %} {% endif %}
@ -158,11 +158,6 @@
{% endif %} {% endif %}
</div> </div>
{% trans "Update user" as modal_title %}
{% trans "Update" as modal_button %}
{% url "registration:update_user" pk=user_object.pk as modal_action %}
{% include "base_modal.html" with modal_id="updateUser" %}
{% if user_object.registration.team and not user_object.registration.team.participation.valid %} {% if user_object.registration.team and not user_object.registration.team.participation.valid %}
{% trans "Upload photo authorization" as modal_title %} {% trans "Upload photo authorization" as modal_title %}
{% trans "Upload" as modal_button %} {% trans "Upload" as modal_button %}
@ -196,11 +191,6 @@
{% block extrajavascript %} {% block extrajavascript %}
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('button[data-target="#updateUserModal"]').click(function() {
let modalBody = $("#updateUserModal div.modal-body");
if (!modalBody.html().trim())
modalBody.load("{% url "registration:update_user" pk=user_object.pk %} #form-content");
});
{% if user_object.registration.team and not user_object.registration.team.participation.valid %} {% if user_object.registration.team and not user_object.registration.team.participation.valid %}
$('button[data-target="#uploadPhotoAuthorizationModal"]').click(function() { $('button[data-target="#uploadPhotoAuthorizationModal"]').click(function() {
let modalBody = $("#uploadPhotoAuthorizationModal div.modal-body"); let modalBody = $("#uploadPhotoAuthorizationModal div.modal-body");