2020-08-23 08:06:16 +00:00
|
|
|
{% extends "member/base.html" %}
|
2020-08-25 14:30:02 +00:00
|
|
|
{% comment %}
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
{% endcomment %}
|
|
|
|
{% load crispy_forms_tags i18n pretty_money %}
|
2020-03-25 16:42:54 +00:00
|
|
|
|
2020-03-31 21:54:14 +00:00
|
|
|
{% block profile_content %}
|
2020-08-25 14:30:02 +00:00
|
|
|
<div class="card bg-light">
|
|
|
|
<h3 class="card-header text-center">
|
|
|
|
{{ title }}
|
|
|
|
</h3>
|
|
|
|
<div class="card-body">
|
|
|
|
{% if additional_fee_renewal %}
|
2020-08-04 18:04:41 +00:00
|
|
|
<div class="alert alert-warning">
|
|
|
|
{% if renewal %}
|
2020-09-18 10:35:36 +00:00
|
|
|
{% if club.name == "Kfet" %} {# Auto-renewal #}
|
|
|
|
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
|
|
|
The user is not a member of the club·s {{ clubs }}. An additional fee of {{ pretty_fee }}
|
|
|
|
will be charged to renew automatically the membership in this/these club·s.
|
|
|
|
{% endblocktrans %}
|
|
|
|
{% else %}
|
|
|
|
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
|
|
|
The user is not a member of the club·s {{ clubs }}. Please create the required memberships,
|
|
|
|
otherwise it will fail.
|
|
|
|
{% endblocktrans %}
|
|
|
|
{% endif %}
|
2020-08-04 18:04:41 +00:00
|
|
|
{% else %}
|
2020-09-18 10:35:36 +00:00
|
|
|
{% if club.name == "Kfet" %}
|
|
|
|
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
|
|
|
This club has parents {{ clubs }}. An additional fee of {{ pretty_fee }}
|
|
|
|
will be charged to adhere automatically to this/these club·s.
|
|
|
|
{% endblocktrans %}
|
|
|
|
{% else %}
|
|
|
|
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
|
|
|
This club has parents {{ clubs }}. Please make sure that the user is a member of this or these club·s,
|
|
|
|
otherwise the creation of this membership will fail.
|
|
|
|
{% endblocktrans %}
|
|
|
|
{% endif %}
|
2020-08-04 18:04:41 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2020-08-25 14:30:02 +00:00
|
|
|
{% endif %}
|
2020-08-04 18:04:41 +00:00
|
|
|
|
2020-08-25 14:30:02 +00:00
|
|
|
<form method="post" action="">
|
|
|
|
{% csrf_token %}
|
|
|
|
{{ form|crispy }}
|
|
|
|
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-25 16:42:54 +00:00
|
|
|
{% endblock %}
|
2019-08-14 16:47:46 +00:00
|
|
|
|
2020-03-25 16:42:54 +00:00
|
|
|
{% block extrajavascript %}
|
2020-08-25 14:30:02 +00:00
|
|
|
<script>
|
|
|
|
function autocompleted(user) {
|
|
|
|
$("#id_last_name").val(user.last_name);
|
|
|
|
$("#id_first_name").val(user.first_name);
|
|
|
|
$.getJSON("/api/members/profile/" + user.id + "/", function (profile) {
|
|
|
|
let fee = profile.paid ? "{{ club.membership_fee_paid }}" : "{{ club.membership_fee_unpaid }}";
|
|
|
|
$("#id_credit_amount").val((Number(fee) / 100).toFixed(2));
|
|
|
|
});
|
|
|
|
}
|
2020-04-05 20:35:56 +00:00
|
|
|
|
2020-08-25 14:30:02 +00:00
|
|
|
soge_field = $("#id_soge");
|
2020-04-05 20:35:56 +00:00
|
|
|
|
2020-08-25 14:30:02 +00:00
|
|
|
function fillFields() {
|
|
|
|
let checked = soge_field.is(':checked');
|
|
|
|
if (!checked) {
|
|
|
|
$("input").attr('disabled', false);
|
|
|
|
$("#id_user").attr('disabled', true);
|
|
|
|
$("select").attr('disabled', false);
|
|
|
|
return;
|
|
|
|
}
|
2020-04-05 20:35:56 +00:00
|
|
|
|
2020-08-25 14:30:02 +00:00
|
|
|
let credit_type = $("#id_credit_type");
|
|
|
|
credit_type.attr('disabled', true);
|
|
|
|
credit_type.val(4);
|
2020-04-05 20:35:56 +00:00
|
|
|
|
2020-08-25 14:30:02 +00:00
|
|
|
let credit_amount = $("#id_credit_amount");
|
|
|
|
credit_amount.attr('disabled', true);
|
|
|
|
credit_amount.val('{{ total_fee }}');
|
2020-04-05 20:35:56 +00:00
|
|
|
|
2020-08-25 14:30:02 +00:00
|
|
|
let bank = $("#id_bank");
|
|
|
|
bank.attr('disabled', true);
|
|
|
|
bank.val('Société générale');
|
|
|
|
}
|
2020-04-05 20:35:56 +00:00
|
|
|
|
2020-08-25 14:30:02 +00:00
|
|
|
soge_field.change(fillFields);
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|