mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-04-11 22:31:16 +00:00
188 lines
9.5 KiB
HTML
188 lines
9.5 KiB
HTML
{% extends request.content_only|yesno:"empty.html,base.html" %}
|
|
|
|
{% load crispy_forms_filters i18n %}
|
|
|
|
{% block content %}
|
|
{% if payment.valid is False %}
|
|
<div class="alert alert-info">
|
|
<p>
|
|
{% blocktrans trimmed with amount=payment.amount %}
|
|
You must pay {{ amount }} € for your registration.
|
|
{% endblocktrans %}
|
|
{% if payment.grouped %}
|
|
{% blocktrans trimmed %}
|
|
This price includes the registrations of all members of your team.
|
|
{% endblocktrans %}
|
|
{% else %}
|
|
{% blocktrans trimmed %}
|
|
This price includes only your own registration.
|
|
You are exempt from payment if you have a scholarship,
|
|
but you must then send us a proof of your scholarship.
|
|
{% endblocktrans %}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if payment.grouped %}
|
|
{% blocktrans trimmed %}
|
|
You want finally that each member pays its own registration? Then click on the button:
|
|
{% endblocktrans %}
|
|
<div class="text-center">
|
|
<a href="{% url 'registration:update_payment_group_mode' pk=payment.pk %}" class="btn btn-warning">
|
|
<i class="fas fa-user"></i> {% trans "Back to single payments" %}
|
|
</a>
|
|
</div>
|
|
{% else %}
|
|
{% blocktrans trimmed %}
|
|
You want to pay for the registrations of all members of your team,
|
|
or your school will pay for all registrations? Then click on the button:
|
|
{% endblocktrans %}
|
|
<div class="text-center">
|
|
<a href="{% url 'registration:update_payment_group_mode' pk=payment.pk %}" class="btn btn-warning">
|
|
<i class="fas fa-users"></i> {% trans "Group the payments of my team" %}
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</p>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<nav>
|
|
<div class="nav nav-tabs card-header-tabs" id="payment-method-tab" role="tablist">
|
|
<button class="nav-link active" id="credit-card-tab" data-bs-toggle="tab"
|
|
data-bs-target="#credit-card" type="button" role="tab"
|
|
aria-controls="credit-card" aria-selected="true">
|
|
<i class="fas fa-credit-card"></i> {% trans "Credit card" %}
|
|
</button>
|
|
<button class="nav-link" id="bank-transfer-tab" data-bs-toggle="tab"
|
|
data-bs-target="#bank-transfer" type="button" role="tab"
|
|
aria-controls="bank-transfer" aria-selected="true">
|
|
<i class="fas fa-money-check"></i> {% trans "Bank transfer" %}
|
|
</button>
|
|
{% if not payment.grouped %}
|
|
<button class="nav-link" id="scholarship-tab" data-bs-toggle="tab"
|
|
data-bs-target="#scholarship" type="button" role="tab"
|
|
aria-controls="scholarship" aria-selected="true">
|
|
<i class="fas fa-file-invoice"></i> {% trans "I have a scholarship" %}
|
|
</button>
|
|
{% endif %}
|
|
<button class="nav-link" id="other-tab" data-bs-toggle="tab"
|
|
data-bs-target="#other" type="button" role="tab"
|
|
aria-controls="other" aria-selected="true">
|
|
<i class="fas fa-question"></i> {% trans "Other" %}
|
|
</button>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
<div class="tab-content" id="payment-form">
|
|
<div class="tab-pane fade show active" id="credit-card" role="tabpanel" aria-labelledby="credit-card-tab">
|
|
<p>
|
|
Le paiement par carte bancaire s'effectue via Hello Asso. Pour cela, vous pouvez cliquer sur
|
|
le bouton ci-dessous, qui vous redirigera vers la page de paiement sécurisée de Hello Asso.
|
|
La validation du paiement sera ensuite faite automatiquement, sous quelques minutes.
|
|
</p>
|
|
|
|
<div class="text-center">
|
|
<a href="{% url "registration:payment_hello_asso" pk=payment.pk %}" class="btn btn-primary">
|
|
<i class="fas fa-credit-card"></i> Aller sur la page Hello Asso
|
|
</a>
|
|
</div>
|
|
|
|
<p>
|
|
Si un tiers doit payer pour vous (parents, lycée,…), vous pouvez lui transmettre le lien pour
|
|
payer pour vous :
|
|
</p>
|
|
|
|
<div class="text-center border border-1 my-3 p-2 border-danger bg-body-tertiary shadow-lg rounded">
|
|
{% url "registration:payment_hello_asso" pk=payment.pk as payment_url %}
|
|
{{ request.scheme }}://{{ request.site.domain }}{{ payment_url }}?token={{ payment.token }}
|
|
<a id="copyIcon" href="#"
|
|
data-bs-title="Copié !"
|
|
onclick="event.preventDefault();copyToClipboard('{{ request.scheme }}://{{ request.site.domain }}{{ payment_url }}?token={{ payment.token }}')">
|
|
<i class="fas fa-copy"></i> Copier
|
|
</a>
|
|
</div>
|
|
|
|
<p>
|
|
Si tel est le cas et si une facture est nécessaire, merci de contacter les organisateur⋅ices
|
|
du tournoi en transmettant le nom de l'équipe, le nombre de participant⋅es, le nom de
|
|
l'établissement payeur, l'adresse mail de l'établissement et/ou l'adresse mail du ou de la
|
|
gestionnaire de l'établissement.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="bank-transfer" role="tabpanel" aria-labelledby="bank-transfer-tab">
|
|
<form id="bank-transfer-form" method="post" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
{{ bank_transfer_form|crispy }}
|
|
<input type="submit" class="btn btn-primary" />
|
|
</form>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="scholarship" role="tabpanel" aria-labelledby="scholarship-tab">
|
|
<form id="scholarship-form" method="post" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
{{ scholarship_form|crispy }}
|
|
<input type="submit" class="btn btn-primary" />
|
|
</form>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="other" role="tabpanel" aria-labelledby="other-tab">
|
|
<form id="other-form" method="post" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
{{ other_form|crispy }}
|
|
<input type="submit" class="btn btn-primary" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock content %}
|
|
|
|
{% block extrajavascript %}
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
if (document.location.hash) {
|
|
// Open the tab of the tournament that is present in the hash
|
|
document.querySelectorAll('button[data-bs-toggle="tab"]').forEach(elem => {
|
|
if ('#' + elem.getAttribute('aria-controls') === document.location.hash.toLowerCase()) {
|
|
elem.click()
|
|
}
|
|
})
|
|
}
|
|
|
|
// When a tab is opened, add the tournament name in the hash
|
|
document.querySelectorAll('button[data-bs-toggle="tab"]').forEach(
|
|
elem => elem.addEventListener(
|
|
'click', () => document.location.hash = '#' + elem.getAttribute('aria-controls')))
|
|
})
|
|
|
|
function copyToClipboard(text) {
|
|
const copyIcon = document.getElementById('copyIcon')
|
|
if (navigator.clipboard) {
|
|
navigator.clipboard.writeText(text).then(() => {
|
|
const tooltip = bootstrap.Tooltip.getOrCreateInstance(copyIcon)
|
|
tooltip.setContent('Copied!')
|
|
tooltip.show()
|
|
}
|
|
)
|
|
} else {
|
|
const input = document.createElement('input')
|
|
input.value = text
|
|
document.body.appendChild(input)
|
|
input.select()
|
|
document.execCommand('copy')
|
|
document.body.removeChild(input)
|
|
const tooltip = bootstrap.Tooltip.getOrCreateInstance(copyIcon)
|
|
tooltip.enable()
|
|
tooltip.show()
|
|
setTimeout(() => {tooltip.disable(); tooltip.hide()}, 2000)
|
|
}
|
|
}
|
|
</script>
|
|
{% endblock %}
|