mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-27 13:02:23 +00:00
161 lines
8.9 KiB
HTML
161 lines
8.9 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% load i18n %}
|
|
|
|
{% block content %}
|
|
{% trans "any" as any %}
|
|
|
|
<div class="card bg-light shadow">
|
|
<div class="card-header text-center">
|
|
<h4>{{ user_object.first_name }} {{ user_object.last_name }}</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<dl class="row">
|
|
<dt class="col-sm-6 text-right">{% trans "Last name:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.last_name }}</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "First name:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.first_name }}</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Email:" %}</dt>
|
|
<dd class="col-sm-6"><a href="mailto:{{ user_object.email }}">{{ user_object.email }}</a>
|
|
{% if not user_object.registration.email_confirmed %} (<em>{% trans "Not confirmed" %}, <a href="{% url "registration:email_validation_resend" pk=user_object.pk %}">{% trans "resend the validation link" %}</a></em>){% endif %}</dd>
|
|
|
|
{% if user_object.registration.participates %}
|
|
<dt class="col-sm-6 text-right">{% trans "Team:" %}</dt>
|
|
{% trans "any" as any %}
|
|
<dd class="col-sm-6">
|
|
<a href="{% if user_object.registration.team %}{% url "participation:team_detail" pk=user_object.registration.team.pk %}{% else %}#{% endif %}">
|
|
{{ user_object.registration.team|default:any }}
|
|
</a>
|
|
</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Birth date:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.birth_date }}</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Address:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.address }}</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Phone number:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.phone_number }}</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Photo authorization:" %}</dt>
|
|
<dd class="col-sm-6">
|
|
{% if user_object.registration.photo_authorization %}
|
|
<a href="{{ user_object.registration.photo_authorization.url }}" data-turbolinks="false">{% trans "Download" %}</a>
|
|
{% endif %}
|
|
{% if user_object.pk == user.pk %}
|
|
<button class="btn btn-primary" data-toggle="modal" data-target="#uploadPhotoAuthorizationModal">{% trans "Replace" %}</button>
|
|
{% endif %}
|
|
</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Health sheet:" %}</dt>
|
|
<dd class="col-sm-6">
|
|
{% if user_object.registration.health_sheet %}
|
|
<a href="{{ user_object.registration.health_sheet.url }}" data-turbolinks="false">{% trans "Download" %}</a>
|
|
{% endif %}
|
|
{% if user_object.pk == user.pk %}
|
|
<button class="btn btn-primary" data-toggle="modal" data-target="#uploadHealthSheetModal">{% trans "Replace" %}</button>
|
|
{% endif %}
|
|
</dd>
|
|
{% endif %}
|
|
|
|
{% if user_object.registration.studentregistration %}
|
|
{% if user_object.registration.under_18 %}
|
|
<dt class="col-sm-6 text-right">{% trans "Parental authorization:" %}</dt>
|
|
<dd class="col-sm-6">
|
|
{% if user_object.registration.parental_authorization %}
|
|
<a href="{{ user_object.registration.parental_authorization.url }}" data-turbolinks="false">{% trans "Download" %}</a>
|
|
{% endif %}
|
|
{% if user_object.pk == user.pk %}
|
|
<button class="btn btn-primary" data-toggle="modal" data-target="#uploadParentalAuthorizationModal">{% trans "Replace" %}</button>
|
|
{% endif %}
|
|
</dd>
|
|
{% endif %}
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Student class:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.get_student_class_display }}</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "School:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.school }}</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Responsible name:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.responsible_name }}</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Responsible phone number:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.responsible_phone }}</dd>
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Responsible email address:" %}</dt>
|
|
{% with user_object.registration.responsible_email as email %}
|
|
<dd class="col-sm-6"><a href="mailto:{{ email }}">{{ email }}</a></dd>
|
|
{% endwith %}
|
|
{% elif user_object.registration.coachregistration %}
|
|
<dt class="col-sm-6 text-right">{% trans "Profesional activity:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.professional_activity }}</dd>
|
|
{% elif user_object.registration.adminregistration %}
|
|
<dt class="col-sm-6 text-right">{% trans "Role:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.role }}</dd>
|
|
{% endif %}
|
|
|
|
<dt class="col-sm-6 text-right">{% trans "Grant Animath to contact me in the future about other actions:" %}</dt>
|
|
<dd class="col-sm-6">{{ user_object.registration.give_contact_to_animath|yesno }}</dd>
|
|
</dl>
|
|
</div>
|
|
{% if user.pk == user_object.pk or user.registration.is_admin %}
|
|
<div class="card-footer text-center">
|
|
<button class="btn btn-primary" data-toggle="modal" data-target="#updateUserModal">{% trans "Update" %}</button>
|
|
{% if user.registration.is_admin %}
|
|
<a class="btn btn-info" href="{% url "registration:user_impersonate" pk=user_object.pk %}">{% trans "Impersonate" %}</a>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</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" %}
|
|
|
|
{% trans "Upload photo authorization" as modal_title %}
|
|
{% trans "Upload" as modal_button %}
|
|
{% url "registration:upload_user_photo_authorization" pk=user_object.registration.pk as modal_action %}
|
|
{% include "base_modal.html" with modal_id="uploadPhotoAuthorization" modal_enctype="multipart/form-data" %}
|
|
|
|
{% trans "Upload health sheet" as modal_title %}
|
|
{% trans "Upload" as modal_button %}
|
|
{% url "registration:upload_user_health_sheet" pk=user_object.registration.pk as modal_action %}
|
|
{% include "base_modal.html" with modal_id="uploadHealthSheet" modal_enctype="multipart/form-data" %}
|
|
|
|
{% trans "Upload parental authorization" as modal_title %}
|
|
{% trans "Upload" as modal_button %}
|
|
{% url "registration:upload_user_parental_authorization" pk=user_object.registration.pk as modal_action %}
|
|
{% include "base_modal.html" with modal_id="uploadParentalAuthorization" modal_enctype="multipart/form-data" %}
|
|
{% endblock %}
|
|
|
|
{% block extrajavascript %}
|
|
<script>
|
|
$(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");
|
|
});
|
|
$('button[data-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-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-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");
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|