2020-12-27 10:49:54 +00:00
{% 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 >
2021-01-18 14:43:17 +00:00
{% if user_object == user %}
< dt class = "col-sm-6 text-right" > {% trans "Password:" %}< / dt >
< dd class = "col-sm-6" >
< a href = "{% url 'password_change' %}" class = "btn-sm btn-secondary" data-turbolinks = "false" >
< i class = "fas fa-edit" > < / i > {% trans "Change password" %}
< / a >
< / dd >
{% endif %}
2020-12-29 15:14:56 +00:00
{% if user_object.registration.participates %}
2020-12-27 10:49:54 +00:00
< 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 >
2020-12-29 15:14:56 +00:00
< dt class = "col-sm-6 text-right" > {% trans "Birth date:" %}< / dt >
< dd class = "col-sm-6" > {{ user_object.registration.birth_date }}< / dd >
2020-12-27 10:49:54 +00:00
2020-12-29 15:14:56 +00:00
< 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 >
2020-12-27 10:49:54 +00:00
< 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 %}
2021-01-18 19:02:49 +00:00
{% if user_object.registration.team and not user_object.registration.team.participation.valid %}
2020-12-27 10:49:54 +00:00
< button class = "btn btn-primary" data-toggle = "modal" data-target = "#uploadPhotoAuthorizationModal" > {% trans "Replace" %}< / button >
{% endif %}
< / dd >
2020-12-29 15:14:56 +00:00
{% endif %}
{% if user_object.registration.studentregistration %}
{% if user_object.registration.under_18 %}
2021-01-21 20:55:19 +00:00
< 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.registration.team and not user_object.registration.team.participation.valid %}
< button class = "btn btn-primary" data-toggle = "modal" data-target = "#uploadHealthSheetModal" > {% trans "Replace" %}< / button >
{% endif %}
< / dd >
2020-12-29 15:14:56 +00:00
< 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 %}
2021-01-18 19:02:49 +00:00
{% if user_object.registration.team and not user_object.registration.team.participation.valid %}
2020-12-29 15:14:56 +00:00
< 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 %}
2021-01-18 22:49:27 +00:00
{% elif user_object.registration.is_admin %}
2020-12-27 10:49:54 +00:00
< dt class = "col-sm-6 text-right" > {% trans "Role:" %}< / dt >
< dd class = "col-sm-6" > {{ user_object.registration.role }}< / dd >
2021-01-18 22:49:27 +00:00
{% elif user_object.registration.coachregistration or user_object.registration.is_volunteer %}
< dt class = "col-sm-6 text-right" > {% trans "Profesional activity:" %}< / dt >
< dd class = "col-sm-6" > {{ user_object.registration.professional_activity }}< / dd >
2020-12-27 10:49:54 +00:00
{% 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 >
2021-01-18 17:13:58 +00:00
{% if user_object.registration.participates and user_object.registration.team.participation.valid %}
< hr >
< dl class = "row" >
< dt class = "col-sm-6 text-right" > {% trans "Payment information:" %}< / dt >
< dd class = "col-sm-6" >
{% trans "yes,no,pending" as yesnodefault %}
{% with info=user_object.registration.payment.additional_information %}
{% if info %}
< abbr title = "{{ info }}" >
{{ user_object.registration.payment.get_type_display }}, {% trans "valid:" %} {{ user_object.registration.payment.valid|yesno:yesnodefault }}
< / abbr >
{% else %}
{{ user_object.registration.payment.get_type_display }}, {% trans "valid:" %} {{ user_object.registration.payment.valid|yesno:yesnodefault }}
{% endif %}
2021-01-18 19:02:49 +00:00
{% if user.registration.is_admin or user_object.registration.payment.valid is False %}
< button class = "btn-sm btn-secondary" data-toggle = "modal" data-target = "#updatePaymentModal" >
< i class = "fas fa-money-bill-wave" > < / i > {% trans "Update payment" %}
< / button >
{% endif %}
2021-01-18 22:39:02 +00:00
{% if user_object.registration.payment.type == "scholarship" %}
{% if user.registration.is_admin or user == user_object %}
< a href = "{{ user_object.registration.payment.scholarship_file.url }}" class = "btn btn-info" data-turbolinks = "false" >
< i class = "fas fa-file-pdf" > < / i > {% trans "Download scholarship attestation" %}
< / a >
{% endif %}
{% endif %}
2021-01-18 17:13:58 +00:00
{% endwith %}
< / dd >
< / dl >
{% endif %}
2020-12-27 10:49:54 +00:00
< / 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" %}
2021-01-18 19:02:49 +00:00
{% if user_object.registration.team and not user_object.registration.team.participation.valid %}
{% 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" %}
{% 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" %}
{% endif %}
2020-12-29 15:14:56 +00:00
2021-01-18 19:02:49 +00:00
{% if user_object.registration.team.participation.valid %}
{% trans "Update payment" as modal_title %}
{% trans "Update" as modal_button %}
{% url "registration:update_payment" pk=user_object.registration.payment.pk as modal_action %}
{% include "base_modal.html" with modal_id="updatePayment" modal_additional_class="modal-xl" modal_enctype="multipart/form-data" %}
{% endif %}
2020-12-27 10:49:54 +00:00
{% 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");
});
2021-01-18 19:02:49 +00:00
{% if user_object.registration.team and not user_object.registration.team.participation.valid %}
$('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");
});
{% endif %}
{% if user_object.registration.team.participation.valid %}
$('button[data-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");
});
{% endif %}
2020-12-27 10:49:54 +00:00
});
< / script >
{% endblock %}