mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-24 19:20:29 +02:00
Merge branch 'master' into tranfer_front
# Conflicts: # static/js/base.js
This commit is contained in:
138
templates/activity/activity_detail.html
Normal file
138
templates/activity/activity_detail.html
Normal file
@ -0,0 +1,138 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load pretty_money %}
|
||||
{% load perms %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="activity_info" class="card bg-light shadow">
|
||||
<div class="card-header text-center">
|
||||
<h4>{{ activity.name }}</h4>
|
||||
</div>
|
||||
<div class="card-body" id="profile_infos">
|
||||
<dl class="row">
|
||||
<dt class="col-xl-6">{% trans 'description'|capfirst %}</dt>
|
||||
<dd class="col-xl-6"> {{ activity.description }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'type'|capfirst %}</dt>
|
||||
<dd class="col-xl-6"> {{ activity.activity_type }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'start date'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ activity.date_start }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'end date'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ activity.date_end }}</dd>
|
||||
|
||||
{% if ".view_"|has_perm:activity.creater %}
|
||||
<dt class="col-xl-6">{% trans 'creater'|capfirst %}</dt>
|
||||
<dd class="col-xl-6"><a href="{% url "member:user_detail" pk=activity.creater.pk %}">{{ activity.creater }}</a></dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-xl-6">{% trans 'organizer'|capfirst %}</dt>
|
||||
<dd class="col-xl-6"><a href="{% url "member:club_detail" pk=activity.organizer.pk %}">{{ activity.organizer }}</a></dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'attendees club'|capfirst %}</dt>
|
||||
<dd class="col-xl-6"><a href="{% url "member:club_detail" pk=activity.attendees_club.pk %}">{{ activity.attendees_club }}</a></dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'can invite'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ activity.activity_type.can_invite|yesno }}</dd>
|
||||
|
||||
{% if activity.activity_type.can_invite %}
|
||||
<dt class="col-xl-6">{% trans 'guest entry fee'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ activity.activity_type.guest_entry_fee|pretty_money }}</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-xl-6">{% trans 'valid'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ activity.valid|yesno }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'opened'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ activity.open|yesno }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="card-footer text-center">
|
||||
{% if activity.open and ".change__open"|has_perm:activity %}
|
||||
<a class="btn btn-warning btn-sm my-1" href="{% url 'activity:activity_entry' pk=activity.pk %}"> {% trans "Entry page" %}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.valid and ".change__open"|has_perm:activity %}
|
||||
<a class="btn btn-warning btn-sm my-1" id="open_activity"> {% if activity.open %}{% trans "close"|capfirst %}{% else %}{% trans "open"|capfirst %}{% endif %}</a>
|
||||
{% endif %}
|
||||
{% if not activity.open and ".change__valid"|has_perm:activity %}
|
||||
<a class="btn btn-success btn-sm my-1" id="validate_activity"> {% if activity.valid %}{% trans "invalidate"|capfirst %}{% else %}{% trans "validate"|capfirst %}{% endif %}</a>
|
||||
{% endif %}
|
||||
{% if ".view_"|has_perm:activity %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'activity:activity_update' pk=activity.pk %}"> {% trans "edit"|capfirst %}</a>
|
||||
{% endif %}
|
||||
{% if activity.activity_type.can_invite and not activity_started %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'activity:activity_invite' pk=activity.pk %}"> {% trans "Invite" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if guests.data %}
|
||||
<hr>
|
||||
<h2>{% trans "Guests list" %}</h2>
|
||||
<div id="guests_table">
|
||||
{% render_table guests %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
function remove_guest(guest_id) {
|
||||
$.ajax({
|
||||
url:"/api/activity/guest/" + guest_id + "/",
|
||||
method:"DELETE",
|
||||
headers: {"X-CSRFTOKEN": CSRF_TOKEN}
|
||||
})
|
||||
.done(function() {
|
||||
addMsg('Invité supprimé','success');
|
||||
$("#guests_table").load(location.href + " #guests_table");
|
||||
})
|
||||
.fail(function(xhr, textStatus, error) {
|
||||
errMsg(xhr.responseJSON);
|
||||
});
|
||||
}
|
||||
|
||||
$("#open_activity").click(function() {
|
||||
$.ajax({
|
||||
url: "/api/activity/activity/{{ activity.pk }}/",
|
||||
type: "PATCH",
|
||||
dataType: "json",
|
||||
headers: {
|
||||
"X-CSRFTOKEN": CSRF_TOKEN
|
||||
},
|
||||
data: {
|
||||
open: {{ activity.open|yesno:'false,true' }}
|
||||
}
|
||||
}).done(function () {
|
||||
reloadWithTurbolinks();
|
||||
}).fail(function (xhr) {
|
||||
errMsg(xhr.responseJSON);
|
||||
});
|
||||
});
|
||||
|
||||
$("#validate_activity").click(function () {
|
||||
$.ajax({
|
||||
url: "/api/activity/activity/{{ activity.pk }}/",
|
||||
type: "PATCH",
|
||||
dataType: "json",
|
||||
headers: {
|
||||
"X-CSRFTOKEN": CSRF_TOKEN
|
||||
},
|
||||
data: {
|
||||
valid: {{ activity.valid|yesno:'false,true' }}
|
||||
}
|
||||
}).done(function () {
|
||||
reloadWithTurbolinks();
|
||||
}).fail(function (xhr) {
|
||||
errMsg(xhr.responseJSON);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
146
templates/activity/activity_entry.html
Normal file
146
templates/activity/activity_entry.html
Normal file
@ -0,0 +1,146 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load pretty_money %}
|
||||
{% load perms %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="btn-group btn-group-toggle" style="width: 100%; padding: 0 0 2em 0" data-toggle="buttons">
|
||||
<a href="{% url "note:transfer" %}#transfer" class="btn btn-sm btn-outline-primary">
|
||||
{% trans "Transfer" %}
|
||||
</a>
|
||||
{% if "note.notespecial"|not_empty_model_list %}
|
||||
<a href="{% url "note:transfer" %}#credit" class="btn btn-sm btn-outline-primary">
|
||||
{% trans "Credit" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% for a in activities_open %}
|
||||
<a href="{% url "activity:activity_entry" pk=a.pk %}" class="btn btn-sm btn-outline-primary{% if a.pk == activity.pk %} active{% endif %}">
|
||||
{% trans "Entries" %} {{ a.name }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{% url "activity:activity_detail" pk=activity.pk %}">
|
||||
<button class="btn btn-light">{% trans "Return to activity page" %}</button>
|
||||
</a>
|
||||
|
||||
<input id="alias" type="text" class="form-control" placeholder="Nom/note ...">
|
||||
|
||||
<hr>
|
||||
|
||||
<div id="entry_table">
|
||||
<h2 class="text-center">{{ entries.count }} {% if entries.count >= 2 %}{% trans "entries" %}{% else %}{% trans "entry" %}{% endif %}</h2>
|
||||
{% render_table table %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
old_pattern = null;
|
||||
alias_obj = $("#alias");
|
||||
|
||||
function reloadTable(force=false) {
|
||||
let pattern = alias_obj.val();
|
||||
|
||||
if ((pattern === old_pattern || pattern === "") && !force)
|
||||
return;
|
||||
|
||||
$("#entry_table").load(location.href + "?search=" + pattern.replace(" ", "%20") + " #entry_table", init);
|
||||
refreshBalance();
|
||||
}
|
||||
|
||||
alias_obj.keyup(reloadTable);
|
||||
|
||||
$(document).ready(init);
|
||||
|
||||
function init() {
|
||||
$(".table-row").click(function(e) {
|
||||
let target = e.target.parentElement;
|
||||
target = $("#" + target.id);
|
||||
|
||||
let type = target.attr("data-type");
|
||||
let id = target.attr("data-id");
|
||||
let last_name = target.attr("data-last-name");
|
||||
let first_name = target.attr("data-first-name");
|
||||
|
||||
if (type === "membership") {
|
||||
$.post("/api/activity/entry/?format=json", {
|
||||
csrfmiddlewaretoken: CSRF_TOKEN,
|
||||
activity: {{ activity.id }},
|
||||
note: id,
|
||||
guest: null
|
||||
}).done(function () {
|
||||
addMsg("Entrée effectuée !", "success", 4000);
|
||||
reloadTable(true);
|
||||
}).fail(function(xhr) {
|
||||
errMsg(xhr.responseJSON, 4000);
|
||||
});
|
||||
}
|
||||
else {
|
||||
let line_obj = $("#buttons_guest_" + id);
|
||||
if (line_obj.length || target.attr('class').includes("table-success")) {
|
||||
line_obj.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
let tr = "<tr class='text-center'>" +
|
||||
"<td id='buttons_guest_" + id + "' style='table-danger center' colspan='5'>" +
|
||||
"<button id='transaction_guest_" + id + "' class='btn btn-secondary'>Payer avec la note de l'hôte</button> " +
|
||||
"<button id='transaction_guest_" + id + "_especes' class='btn btn-secondary'>Payer en espèces</button> " +
|
||||
"<button id='transaction_guest_" + id + "_cb' class='btn btn-secondary'>Payer en CB</button></td>" +
|
||||
"<tr>";
|
||||
$(tr).insertAfter(target);
|
||||
|
||||
let makeTransaction = function() {
|
||||
$.post("/api/activity/entry/?format=json", {
|
||||
csrfmiddlewaretoken: CSRF_TOKEN,
|
||||
activity: {{ activity.id }},
|
||||
note: target.attr("data-inviter"),
|
||||
guest: id
|
||||
}).done(function () {
|
||||
addMsg("Entrée effectuée !", "success", 4000);
|
||||
reloadTable(true);
|
||||
}).fail(function (xhr) {
|
||||
errMsg(xhr.responseJSON, 4000);
|
||||
});
|
||||
};
|
||||
|
||||
let credit = function(credit_id, credit_name) {
|
||||
return function() {
|
||||
$.post("/api/note/transaction/transaction/",
|
||||
{
|
||||
"csrfmiddlewaretoken": CSRF_TOKEN,
|
||||
"quantity": 1,
|
||||
"amount": {{ activity.activity_type.guest_entry_fee }},
|
||||
"reason": "Crédit " + credit_name + " (invitation {{ activity.name }})",
|
||||
"valid": true,
|
||||
"polymorphic_ctype": {{ notespecial_ctype }},
|
||||
"resourcetype": "SpecialTransaction",
|
||||
"source": credit_id,
|
||||
"destination": target.attr('data-inviter'),
|
||||
"last_name": last_name,
|
||||
"first_name": first_name,
|
||||
"bank": ""
|
||||
}).done(function () {
|
||||
makeTransaction();
|
||||
reset();
|
||||
}).fail(function (xhr) {
|
||||
errMsg(xhr.responseJSON, 4000);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
$("#transaction_guest_" + id).click(makeTransaction);
|
||||
$("#transaction_guest_" + id + "_especes").click(credit(1, "espèces"));
|
||||
$("#transaction_guest_" + id + "_cb").click(credit(2, "carte bancaire"));
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
11
templates/activity/activity_form.html
Normal file
11
templates/activity/activity_form.html
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{form|crispy}}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
15
templates/activity/activity_invite.html
Normal file
15
templates/activity/activity_invite.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load i18n crispy_forms_tags %}
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
{% endblock %}
|
33
templates/activity/activity_list.html
Normal file
33
templates/activity/activity_list.html
Normal file
@ -0,0 +1,33 @@
|
||||
{% extends "base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load i18n crispy_forms_tags%}
|
||||
{% block content %}
|
||||
<h2>{% trans "Upcoming activities" %}</h2>
|
||||
{% if upcoming.data %}
|
||||
{% render_table upcoming %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "There is no planned activity." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<a class="btn btn-primary" href="{% url 'activity:activity_create' %}">{% trans 'New activity' %}</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2>{% trans "All activities" %}</h2>
|
||||
|
||||
{% render_table table %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function($) {
|
||||
$(".table-row").click(function() {
|
||||
window.document.location = $(this).data("href");
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
@ -84,14 +84,26 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
<a class="nav-link" href="{% url 'note:transfer' %}"><i class="fa fa-exchange"></i>{% trans 'Transfer' %} </a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if "auth.user"|model_list|length >= 2 %}
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="{% url 'member:user_list' %}"><i class="fa fa-user"></i> {% trans 'Users' %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if "member.club"|not_empty_model_list %}
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="{% url 'member:club_list' %}"><i class="fa fa-users"></i> {% trans 'Clubs' %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if "member.change_profile_registration_valid"|has_perm:user %}
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="{% url 'registration:future_user_list' %}">
|
||||
<i class="fa fa-user-plus"></i> {% trans "Registrations" %}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if "activity.activity"|not_empty_model_list %}
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#"><i class="fa fa-calendar"></i> {% trans 'Activities' %}</a>
|
||||
<a class="nav-link" href="{% url 'activity:activity_list' %}"><i class="fa fa-calendar"></i> {% trans 'Activities' %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if "treasury.invoice"|not_empty_model_change_list %}
|
||||
@ -119,7 +131,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="{% url 'member:signup' %}">
|
||||
<a class="nav-link" href="{% url 'registration:signup' %}">
|
||||
<i class="fa fa-user-plus"></i> S'inscrire
|
||||
</a>
|
||||
</li>
|
||||
@ -133,6 +145,11 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container-fluid my-3" style="max-width: 1600px;">
|
||||
{% if user.is_authenticated and not user.profile.email_confirmed %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "Your e-mail address is not validated. Please check your mail inbox and click on the validation link." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block contenttitle %}<h1>{{ title }}</h1>{% endblock %}
|
||||
<div id="messages"></div>
|
||||
{% block content %}
|
||||
|
6
templates/bootstrap_datepicker_plus/date_picker.html
Normal file
6
templates/bootstrap_datepicker_plus/date_picker.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="input-group date">
|
||||
{% include "bootstrap_datepicker_plus/input.html" %}
|
||||
<div class="input-group-addon input-group-append" data-target="#datetimepicker1" data-toggle="datetimepickerv">
|
||||
<div class="input-group-text"><i class="glyphicon glyphicon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
4
templates/bootstrap_datepicker_plus/input.html
Normal file
4
templates/bootstrap_datepicker_plus/input.html
Normal file
@ -0,0 +1,4 @@
|
||||
<input type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None and widget.value != "" %}
|
||||
value="{{ widget.value }}"{% endif %}{% for name, value in widget.attrs.items %}{% ifnotequal value False %}
|
||||
{{ name }}{% ifnotequal value True %}="{{ value|stringformat:'s' }}"{% endifnotequal %}
|
||||
{% endifnotequal %}{% endfor %}/>
|
6
templates/bootstrap_datepicker_plus/time_picker.html
Normal file
6
templates/bootstrap_datepicker_plus/time_picker.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="input-group date">
|
||||
{% include "bootstrap_datepicker_plus/input.html" %}
|
||||
<div class="input-group-addon input-group-append" data-target="#datetimepicker1" data-toggle="datetimepickerv">
|
||||
<div class="input-group-text"><i class="glyphicon glyphicon-time"></i></div>
|
||||
</div>
|
||||
</div>
|
@ -1,29 +1,55 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "member/club_info.html" %}
|
||||
{% endblock %}
|
||||
{% block profile_content %}
|
||||
|
||||
{% block profile_content %}
|
||||
<form method="post" action="">
|
||||
{% csrf_token %}
|
||||
{% crispy formset helper %}
|
||||
<div class="form-actions">
|
||||
<input type="submit" name="submit" value="Add Members" class="btn btn-primary" id="submit-save">
|
||||
</div>
|
||||
{{ form|crispy }}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script src="{% static 'js/dynamic-formset.js' %}"></script>
|
||||
<script>
|
||||
$('.formset-row').formset({
|
||||
addText: 'add another', // Text for the add link
|
||||
deleteText: 'remove', // Text for the delete link
|
||||
addCssClass: 'btn btn-primary', // CSS class applied to the add link
|
||||
deleteCssClass: 'btn btn-danger h-50 my-auto',
|
||||
});
|
||||
</script>
|
||||
<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((fee / 100).toFixed(2));
|
||||
});
|
||||
}
|
||||
|
||||
soge_field = $("#id_soge");
|
||||
|
||||
function fillFields() {
|
||||
let checked = soge_field.is(':checked');
|
||||
if (!checked) {
|
||||
$("input").attr('disabled', false);
|
||||
$("#id_user").attr('disabled', true);
|
||||
$("select").attr('disabled', false);
|
||||
return;
|
||||
}
|
||||
|
||||
let credit_type = $("#id_credit_type");
|
||||
credit_type.attr('disabled', true);
|
||||
credit_type.val(4);
|
||||
|
||||
let credit_amount = $("#id_credit_amount");
|
||||
credit_amount.attr('disabled', true);
|
||||
credit_amount.val('{{ total_fee }}');
|
||||
|
||||
let bank = $("#id_bank");
|
||||
bank.attr('disabled', true);
|
||||
bank.val('Société générale');
|
||||
}
|
||||
|
||||
soge_field.change(fillFields);
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
9
templates/member/autocomplete_model.html
Normal file
9
templates/member/autocomplete_model.html
Normal file
@ -0,0 +1,9 @@
|
||||
<input type="hidden" name="{{ widget.name }}" {% if widget.attrs.model_pk %}value="{{ widget.attrs.model_pk }}"{% endif %} id="{{ widget.attrs.id }}_pk">
|
||||
<input type="text"
|
||||
{% if widget.value != None and widget.value != "" %}value="{{ widget.value }}"{% endif %}
|
||||
name="{{ widget.name }}_name" autocomplete="off"
|
||||
{% for name, value in widget.attrs.items %}
|
||||
{% ifnotequal value False %}{{ name }}{% ifnotequal value True %}="{{ value|stringformat:'s' }}"{% endifnotequal %}{% endifnotequal %}
|
||||
{% endfor %}>
|
||||
<ul class="list-group list-group-flush" id="{{ widget.attrs.id }}_list">
|
||||
</ul>
|
@ -7,3 +7,14 @@
|
||||
{% block profile_content %}
|
||||
{% include "member/club_tables.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
function refreshHistory() {
|
||||
$("#history_list").load("{% url 'member:club_detail' pk=object.pk %} #history_list");
|
||||
$("#profile_infos").load("{% url 'member:club_detail' pk=object.pk %} #profile_infos");
|
||||
}
|
||||
|
||||
window.history.replaceState({}, document.title, location.pathname);
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -9,3 +9,25 @@
|
||||
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
require_memberships_obj = $("#id_require_memberships");
|
||||
|
||||
if (!require_memberships_obj.is(":checked")) {
|
||||
$("#div_id_membership_fee_paid").toggle();
|
||||
$("#div_id_membership_fee_unpaid").toggle();
|
||||
$("#div_id_membership_duration").toggle();
|
||||
$("#div_id_membership_start").toggle();
|
||||
$("#div_id_membership_end").toggle();
|
||||
}
|
||||
|
||||
require_memberships_obj.change(function () {
|
||||
$("#div_id_membership_fee_paid").toggle();
|
||||
$("#div_id_membership_fee_unpaid").toggle();
|
||||
$("#div_id_membership_duration").toggle();
|
||||
$("#div_id_membership_start").toggle();
|
||||
$("#div_id_membership_end").toggle();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% load i18n static pretty_money %}
|
||||
{% load i18n static pretty_money perms %}
|
||||
<div class="card bg-light shadow">
|
||||
<div class="card-header text-center">
|
||||
<h4> Club {{ club.name }} </h4>
|
||||
@ -13,34 +13,49 @@
|
||||
<dt class="col-xl-6">{% trans 'name'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.name}}</dd>
|
||||
|
||||
<dt class="col-xl-6"><a href="{% url 'member:club_detail' club.parent_club.pk %}">{% trans 'Club Parent'|capfirst %}</a></dt>
|
||||
<dd class="col-xl-6"> {{ club.parent_club.name}}</dd>
|
||||
{% if club.parent_club %}
|
||||
<dt class="col-xl-6"><a href="{% url 'member:club_detail' club.parent_club.pk %}">{% trans 'Club Parent'|capfirst %}</a></dt>
|
||||
<dd class="col-xl-6"> {{ club.parent_club.name}}</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-xl-6">{% trans 'membership start'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_start }}</dd>
|
||||
{% if club.require_memberships %}
|
||||
<dt class="col-xl-6">{% trans 'membership start'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_start }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'membership end'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_end }}</dd>
|
||||
<dt class="col-xl-6">{% trans 'membership end'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_end }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'membership duration'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_duration }}</dd>
|
||||
<dt class="col-xl-6">{% trans 'membership duration'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_duration }} {% trans "days" %}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'membership fee'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_fee|pretty_money }}</dd>
|
||||
{% if club.membership_fee_paid == club.membership_fee_unpaid %}
|
||||
<dt class="col-xl-6">{% trans 'membership fee'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_fee_paid|pretty_money }}</dd>
|
||||
{% else %}
|
||||
<dt class="col-xl-6">{% trans 'membership fee (paid students)'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_fee_paid|pretty_money }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'membership fee (unpaid students)'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_fee_unpaid|pretty_money }}</dd>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-xl-6"><a href="{% url 'member:club_alias' club.pk %}">{% trans 'aliases'|capfirst %}</a></dt>
|
||||
<dd class="col-xl-6 text-truncate">{{ object.note.alias_set.all|join:", " }}</dd>
|
||||
|
||||
<dt class="col-xl-3">{% trans 'email'|capfirst %}</dt>
|
||||
<dd class="col-xl-9"><a href="mailto:{{ club.email }}">{{ club.email}}</a></dd>
|
||||
<dd class="col-xl-9"><a href="mailto:{{ club.email }}">{{ club.email }}</a></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_add_member' pk=club.pk %}"> {% trans "Add member" %}</a>
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_update' pk=club.pk %}"> {% trans "Edit" %}</a>
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_add_member' pk=club.pk %}"> {% trans "Add roles" %}</a>
|
||||
{% if can_add_members %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_add_member' club_pk=club.pk %}"> {% trans "Add member" %}</a>
|
||||
{% endif %}
|
||||
{% if ".change_"|has_perm:club %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_update' pk=club.pk %}"> {% trans "Edit" %}</a>
|
||||
{% endif %}
|
||||
{% url 'member:club_detail' club.pk as club_detail_url %}
|
||||
{%if request.get_full_path != club_detail_url %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{{ user_profile_url }}">{% trans 'View Profile' %}</a>
|
||||
{%if request.path_info != club_detail_url %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{{ club_detail_url }}">{% trans 'View Profile' %}</a>
|
||||
{% endif %} </div>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@
|
||||
</h4>
|
||||
<input class="form-control mx-auto w-25" type="text" onkeyup="search_field_moved();return(false);" id="search_field"/>
|
||||
<hr>
|
||||
<a class="btn btn-primary text-center my-4" href="{% url 'member:club_create' %}">{% trans "Créer un club" %}</a>
|
||||
<a class="btn btn-primary text-center my-4" href="{% url 'member:club_create' %}">{% trans "Create club" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
@ -36,7 +36,6 @@ function getInfo() {
|
||||
if (asked.length >= 1) {
|
||||
$.getJSON("/api/members/club/?format=json&search="+asked, function(buttons){
|
||||
let selected_id = buttons.results.map((a => "#row-"+a.id));
|
||||
console.log(selected_id.join());
|
||||
$(".table-row,"+selected_id.join()).show();
|
||||
$(".table-row").not(selected_id.join()).hide();
|
||||
|
||||
|
@ -1,31 +1,23 @@
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load i18n %}
|
||||
<div class="accordion shadow" id="accordionProfile">
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="clubListHeading">
|
||||
<a class="btn btn-link stretched-link font-weight-bold"
|
||||
data-toggle="collapse" data-target="#clubListCollapse"
|
||||
aria-expanded="true" aria-controls="clubListCollapse">
|
||||
<i class="fa fa-users"></i> {% trans "Member of the Club" %}
|
||||
</a>
|
||||
</div>
|
||||
<div id="clubListCollapse" class="collapse show" style="overflow:auto hidden" aria-labelledby="clubListHeading" data-parent="#accordionProfile">
|
||||
{% render_table member_list %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="historyListHeading">
|
||||
<a class="btn btn-link stretched-link collapsed font-weight-bold"
|
||||
data-toggle="collapse" data-target="#historyListCollapse"
|
||||
aria-expanded="false" aria-controls="historyListCollapse">
|
||||
<i class="fa fa-euro"></i> {% trans "Transaction history" %}
|
||||
</a>
|
||||
</div>
|
||||
<div id="historyListCollapse" class="collapse" style="overflow:auto hidden" aria-labelledby="historyListHeading" data-parent="#accordionProfile">
|
||||
<div id="history_list">
|
||||
{% render_table history_list %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="clubListHeading">
|
||||
<a class="btn btn-link stretched-link font-weight-bold">
|
||||
<i class="fa fa-users"></i> {% trans "Member of the Club" %}
|
||||
</a>
|
||||
</div>
|
||||
{% render_table member_list %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="historyListHeading">
|
||||
<a class="btn btn-link stretched-link font-weight-bold">
|
||||
<i class="fa fa-euro"></i> {% trans "Transaction history" %}
|
||||
</a>
|
||||
</div>
|
||||
<div id="history_list">
|
||||
{% render_table history_list %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
function refreshhistory() {
|
||||
function refreshHistory() {
|
||||
$("#history_list").load("{% url 'member:user_detail' pk=object.pk %} #history_list");
|
||||
$("#profile_infos").load("{% url 'member:user_detail' pk=object.pk %} #profile_infos");
|
||||
}
|
||||
|
@ -7,3 +7,14 @@
|
||||
{% block profile_content %}
|
||||
{% include "member/profile_tables.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
function refreshHistory() {
|
||||
$("#history_list").load("{% url 'member:user_detail' pk=object.pk %} #history_list");
|
||||
$("#profile_infos").load("{% url 'member:user_detail' pk=object.pk %} #profile_infos");
|
||||
}
|
||||
|
||||
window.history.replaceState({}, document.title, location.pathname);
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -44,7 +44,7 @@
|
||||
<div class="card-footer text-center">
|
||||
<a class="btn btn-primary btn-sm" href="{% url 'member:user_update_profile' object.pk %}">{% trans 'Update Profile' %}</a>
|
||||
{% url 'member:user_detail' object.pk as user_profile_url %}
|
||||
{%if request.get_full_path != user_profile_url %}
|
||||
{%if request.path_info != user_profile_url %}
|
||||
<a class="btn btn-primary btn-sm" href="{{ user_profile_url }}">{% trans 'View Profile' %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -1,31 +1,34 @@
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load i18n %}
|
||||
<div class="accordion shadow" id="accordionProfile">
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="clubListHeading">
|
||||
<a class="btn btn-link stretched-link font-weight-bold"
|
||||
data-toggle="collapse" data-target="#clubListCollapse"
|
||||
aria-expanded="true" aria-controls="clubListCollapse">
|
||||
<i class="fa fa-users"></i> {% trans "View my memberships" %}
|
||||
</a>
|
||||
</div>
|
||||
<div id="clubListCollapse" class="collapse show" style="overflow:auto hidden" aria-labelledby="clubListHeading" data-parent="#accordionProfile">
|
||||
{% render_table club_list %}
|
||||
</div>
|
||||
</div>
|
||||
{% load perms %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="historyListHeading">
|
||||
<a class="btn btn-link stretched-link collapsed font-weight-bold"
|
||||
data-toggle="collapse" data-target="#historyListCollapse"
|
||||
aria-expanded="false" aria-controls="historyListCollapse">
|
||||
<i class="fa fa-euro"></i> {% trans "Transaction history" %}
|
||||
</a>
|
||||
</div>
|
||||
<div id="historyListCollapse" class="collapse" style="overflow:auto hidden" aria-labelledby="historyListHeading" data-parent="#accordionProfile">
|
||||
<div id="history_list">
|
||||
{% render_table history_list %}
|
||||
</div>
|
||||
</div>
|
||||
{% if not object.profile.email_confirmed and "member.change_profile_email_confirmed"|has_perm:object.profile %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "This user doesn't have confirmed his/her e-mail address." %}
|
||||
<a href="{% url "registration:email_validation_resend" pk=object.pk %}">{% trans "Click here to resend a validation link." %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="clubListHeading">
|
||||
<a class="btn btn-link stretched-link font-weight-bold">
|
||||
<i class="fa fa-users"></i> {% trans "View my memberships" %}
|
||||
</a>
|
||||
</div>
|
||||
{% render_table club_list %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="historyListHeading">
|
||||
<a class="btn btn-link stretched-link collapsed font-weight-bold"
|
||||
data-toggle="collapse" data-target="#historyListCollapse"
|
||||
aria-expanded="true" aria-controls="historyListCollapse">
|
||||
<i class="fa fa-euro"></i> {% trans "Transaction history" %}
|
||||
</a>
|
||||
</div>
|
||||
<div id="history_list">
|
||||
{% render_table history_list %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2,28 +2,50 @@
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load crispy_forms_tags%}
|
||||
{% block content %}
|
||||
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note/section ...">
|
||||
|
||||
<a class="btn btn-primary" href="{% url 'member:signup' %}">New User</a>
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
{% crispy filter.form filter.form.helper %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="replaceable-content" class="col-6">
|
||||
{% render_table table %}
|
||||
<div id="user_table">
|
||||
{% if table.data %}
|
||||
{% render_table table %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "There is no pending user with this pattern." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
let old_pattern = null;
|
||||
let searchbar_obj = $("#searchbar");
|
||||
|
||||
$(document).ready(function($) {
|
||||
$(".table-row").click(function() {
|
||||
window.document.location = $(this).data("href");
|
||||
function reloadTable() {
|
||||
let pattern = searchbar_obj.val();
|
||||
|
||||
if (pattern === old_pattern || pattern === "")
|
||||
return;
|
||||
|
||||
$("#user_table").load(location.href + "?search=" + pattern.replace(" ", "%20") + " #user_table", init);
|
||||
|
||||
$(".table-row").click(function() {
|
||||
window.document.location = $(this).data("href");
|
||||
});
|
||||
}
|
||||
|
||||
searchbar_obj.keyup(reloadTable);
|
||||
|
||||
function init() {
|
||||
$(".table-row").click(function() {
|
||||
window.document.location = $(this).data("href");
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
11
templates/note/amount_input.html
Normal file
11
templates/note/amount_input.html
Normal file
@ -0,0 +1,11 @@
|
||||
<div class="input-group">
|
||||
<input class="form-control mx-auto d-block" type="number" min="0" step="0.01"
|
||||
{% if widget.value != None and widget.value != "" %}value="{{ widget.value }}"{% endif %}
|
||||
name="{{ widget.name }}"
|
||||
{% for name, value in widget.attrs.items %}
|
||||
{% ifnotequal value False %}{{ name }}{% ifnotequal value True %}="{{ value|stringformat:'s' }}"{% endifnotequal %}{% endifnotequal %}
|
||||
{% endfor %}>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">€</span>
|
||||
</div>
|
||||
</div>
|
@ -28,6 +28,11 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
{% trans "Debit" %}
|
||||
</label>
|
||||
{% endif %}
|
||||
{% for activity in activities_open %}
|
||||
<a href="{% url "activity:activity_entry" pk=activity.pk %}" class="btn btn-sm btn-outline-primary">
|
||||
{% trans "Entries" %} {{ activity.name }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -126,12 +131,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="amount">{% trans "Amount" %} :</label>
|
||||
<div class="input-group">
|
||||
<input class="form-control mx-auto d-block" type="number" min="0" step="0.01" id="amount" />
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">€</span>
|
||||
</div>
|
||||
</div>
|
||||
{% include "note/amount_input.html" with widget=amount_widget %}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
@ -142,7 +142,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
<div class="form-row">
|
||||
<div class="col-md-12">
|
||||
<button id="transfer" class="form-control btn btn-primary">{% trans 'Transfer' %}</button>
|
||||
<button id="btn_transfer" class="form-control btn btn-primary">{% trans 'Transfer' %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -37,7 +37,6 @@ function getInfo() {
|
||||
if (asked.length >= 1) {
|
||||
$.getJSON("/api/note/transaction/template/?format=json&search="+asked, function(buttons){
|
||||
let selected_id = buttons.results.map((a => "#row-"+a.id));
|
||||
console.log(selected_id.join());
|
||||
$(".table-row,"+selected_id.join()).show();
|
||||
$(".table-row").not(selected_id.join()).hide();
|
||||
|
||||
|
15
templates/registration/email_validation_complete.html
Normal file
15
templates/registration/email_validation_complete.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
{% if validlink %}
|
||||
{% trans "Your email have successfully been validated." %}
|
||||
{% if user.profile.registration_valid %}
|
||||
{% blocktrans %}You can now <a href="{{ login_url }}">log in</a>.{% endblocktrans %}
|
||||
{% else %}
|
||||
{% trans "You must pay now your membership in the Kfet to complete your registration." %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% trans "The link was invalid. The token may have expired. Please send us an email to activate your account." %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
7
templates/registration/email_validation_email_sent.html
Normal file
7
templates/registration/email_validation_email_sent.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Account Activation</h2>
|
||||
|
||||
An email has been sent. Please click on the link to activate your account.
|
||||
{% endblock %}
|
119
templates/registration/future_profile_detail.html
Normal file
119
templates/registration/future_profile_detail.html
Normal file
@ -0,0 +1,119 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load perms %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-3 mb-4">
|
||||
<div class="card bg-light shadow">
|
||||
<div class="card-header text-center" >
|
||||
<h4> {% trans "Account #" %} {{ object.pk }}</h4>
|
||||
</div>
|
||||
<div class="card-body" id="profile_infos">
|
||||
<dl class="row">
|
||||
<dt class="col-xl-6">{% trans 'name'|capfirst %}, {% trans 'first name' %}</dt>
|
||||
<dd class="col-xl-6">{{ object.last_name }} {{ object.first_name }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'username'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ object.username }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'email'|capfirst %}</dt>
|
||||
<dd class="col-xl-6"><a href="mailto:{{ object.email }}">{{ object.email }}</a></dd>
|
||||
|
||||
{% if not object.profile.email_confirmed and "member.change_profile_email_confirmed"|has_perm:object.profile %}
|
||||
<dd class="col-xl-12">
|
||||
<div class="alert alert-warning">
|
||||
{% trans "This user doesn't have confirmed his/her e-mail address." %}
|
||||
<a href="{% url "registration:email_validation_resend" pk=object.pk %}">{% trans "Click here to resend a validation link." %}</a>
|
||||
</div>
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-xl-6">{% trans 'password'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">
|
||||
<a class="small" href="{% url 'password_change' %}">
|
||||
{% trans 'Change password' %}
|
||||
</a>
|
||||
</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'section'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ object.profile.section }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'address'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ object.profile.address }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'phone number'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ object.profile.phone_number }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'paid'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ object.profile.paid|yesno }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<a class="btn btn-primary btn-sm" href="{% url 'member:user_update_profile' object.pk %}">{% trans 'Update Profile' %}</a>
|
||||
<a class="btn btn-danger btn-sm" href="{% url 'registration:future_user_invalidate' object.pk %}">{% trans 'Delete registration' %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card bg-light shadow">
|
||||
<form method="post">
|
||||
<div class="card-header text-center" >
|
||||
<h4> {% trans "Validate account" %}</h4>
|
||||
</div>
|
||||
<div class="card-body" id="profile_infos">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<button class="btn btn-success btn-sm">{% trans 'Validate registration' %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
soge_field = $("#id_soge");
|
||||
|
||||
function fillFields() {
|
||||
let checked = soge_field.is(':checked');
|
||||
if (!checked) {
|
||||
$("input").attr('disabled', false);
|
||||
$("select").attr('disabled', false);
|
||||
return;
|
||||
}
|
||||
|
||||
let credit_type = $("#id_credit_type");
|
||||
credit_type.attr('disabled', true);
|
||||
credit_type.val(4);
|
||||
|
||||
let credit_amount = $("#id_credit_amount");
|
||||
credit_amount.attr('disabled', true);
|
||||
credit_amount.val('{{ total_fee }}');
|
||||
|
||||
let bank = $("#id_bank");
|
||||
bank.attr('disabled', true);
|
||||
bank.val('Société générale');
|
||||
|
||||
let join_BDE = $("#id_join_BDE");
|
||||
join_BDE.attr('disabled', true);
|
||||
join_BDE.attr('checked', 'checked');
|
||||
|
||||
let join_Kfet = $("#id_join_Kfet");
|
||||
join_Kfet.attr('disabled', true);
|
||||
join_Kfet.attr('checked', 'checked');
|
||||
}
|
||||
|
||||
soge_field.change(fillFields);
|
||||
|
||||
{% if object.profile.soge %}
|
||||
soge_field.attr('checked', true);
|
||||
fillFields();
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endblock %}
|
53
templates/registration/future_user_list.html
Normal file
53
templates/registration/future_user_list.html
Normal file
@ -0,0 +1,53 @@
|
||||
{% extends "base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<a href="{% url 'registration:signup' %}"><button class="btn btn-primary btn-block">{% trans "New user" %}</button></a>
|
||||
<hr>
|
||||
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note/section ...">
|
||||
<hr>
|
||||
|
||||
<div id="user_table">
|
||||
{% if table.data %}
|
||||
{% render_table table %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "There is no pending user with this pattern." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
let old_pattern = null;
|
||||
let searchbar_obj = $("#searchbar");
|
||||
|
||||
function reloadTable() {
|
||||
let pattern = searchbar_obj.val();
|
||||
|
||||
if (pattern === old_pattern || pattern === "")
|
||||
return;
|
||||
|
||||
$("#user_table").load(location.href + "?search=" + pattern.replace(" ", "%20") + " #user_table", init);
|
||||
|
||||
$(".table-row").click(function() {
|
||||
window.document.location = $(this).data("href");
|
||||
});
|
||||
}
|
||||
|
||||
searchbar_obj.keyup(reloadTable);
|
||||
|
||||
function init() {
|
||||
$(".table-row").click(function() {
|
||||
window.document.location = $(this).data("href");
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
15
templates/registration/mails/email_validation_email.html
Normal file
15
templates/registration/mails/email_validation_email.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% trans "Hi" %} {{ user.username }},
|
||||
|
||||
{% trans "You recently registered on the Note Kfet. Please click on the link below to confirm your registration." %}
|
||||
|
||||
https://{{ domain }}{% url 'registration:email_validation' uidb64=uid token=token %}
|
||||
|
||||
{% trans "This link is only valid for a couple of days, after that you will need to contact us to validate your email." %}
|
||||
|
||||
{% trans "After that, you'll have to wait that someone validates your account before you can log in. You will need to pay your membership in the Kfet." %}
|
||||
|
||||
{% trans "Thanks" %},
|
||||
|
||||
{% trans "The Note Kfet team." %}
|
@ -1,7 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags pretty_money %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% block content %}
|
||||
<p><a class="btn btn-default" href="{% url 'treasury:invoice_list' %}">{% trans "Invoices list" %}</a></p>
|
||||
<form method="post" action="">
|
||||
@ -26,18 +26,8 @@
|
||||
{% endif %}
|
||||
<tr class="row-formset">
|
||||
<td>{{ form.designation }}</td>
|
||||
<td>{{ form.quantity }} </td>
|
||||
<td>
|
||||
{# Use custom input for amount, with the € symbol #}
|
||||
<div class="input-group">
|
||||
<input type="number" name="product_set-{{ forloop.counter0 }}-amount" step="0.01"
|
||||
id="id_product_set-{{ forloop.counter0 }}-amount"
|
||||
value="{{ form.instance.amount|cents_to_euros }}">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">€</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ form.quantity }}</td>
|
||||
<td>{{ form.amount }}</td>
|
||||
{# These fields are hidden but handled by the formset to link the id and the invoice id #}
|
||||
{{ form.invoice }}
|
||||
{{ form.id }}
|
||||
@ -64,15 +54,7 @@
|
||||
<tr class="row-formset">
|
||||
<td>{{ formset.empty_form.designation }}</td>
|
||||
<td>{{ formset.empty_form.quantity }} </td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input type="number" name="product_set-__prefix__-amount" step="0.01"
|
||||
id="id_product_set-__prefix__-amount">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">€</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ formset.empty_form.amount }}</td>
|
||||
{{ formset.empty_form.invoice }}
|
||||
{{ formset.empty_form.id }}
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user