mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Reorder templates
This commit is contained in:
9
apps/wei/templates/wei/bus_detail.html
Normal file
9
apps/wei/templates/wei/bus_detail.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
{% include "wei/bus_tables.html" %}
|
||||
{% endblock %}
|
15
apps/wei/templates/wei/bus_form.html
Normal file
15
apps/wei/templates/wei/bus_form.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
50
apps/wei/templates/wei/bus_tables.html
Normal file
50
apps/wei/templates/wei/bus_tables.html
Normal file
@ -0,0 +1,50 @@
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load i18n %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<h4>{{ object.name }}</h4>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
{{ object.description }}
|
||||
</div>
|
||||
|
||||
<div class="card-footer text-center">
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=object.pk %}" data-turbolinks="false">{% trans "Edit" %}</a>
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=object.pk %}" data-turbolinks="false">{% trans "Add team" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
{% if teams.data %}
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="clubListHeading">
|
||||
<a class="font-weight-bold">
|
||||
<i class="fa fa-bus"></i> {% trans "Teams" %}
|
||||
</a>
|
||||
</div>
|
||||
{% render_table teams %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
{% endif %}
|
||||
|
||||
{% if memberships.data %}
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="clubListHeading">
|
||||
<a class="font-weight-bold">
|
||||
<i class="fa fa-bus"></i> {% trans "Members" %}
|
||||
</a>
|
||||
</div>
|
||||
{% render_table memberships %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="{% url 'wei:wei_memberships_bus_pdf' wei_pk=club.pk bus_pk=object.pk %}" data-turbolinks="false">
|
||||
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
|
||||
</a>
|
||||
{% endif %}
|
9
apps/wei/templates/wei/busteam_detail.html
Normal file
9
apps/wei/templates/wei/busteam_detail.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
{% include "wei/busteam_tables.html" %}
|
||||
{% endblock %}
|
15
apps/wei/templates/wei/busteam_form.html
Normal file
15
apps/wei/templates/wei/busteam_form.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
54
apps/wei/templates/wei/busteam_tables.html
Normal file
54
apps/wei/templates/wei/busteam_tables.html
Normal file
@ -0,0 +1,54 @@
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load i18n %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<h4>{{ bus.name }}</h4>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
{{ bus.description }}
|
||||
</div>
|
||||
|
||||
<div class="card-footer text-center">
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=bus.pk %}" data-turbolinks="false">{% trans "Edit" %}</a>
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=bus.pk %}" data-turbolinks="false">{% trans "Add team" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header text-center" style="background-color: #{{ object.color|stringformat:"06X" }}; color: #{{ -16777215|add:object.color|stringformat:"06X"|slice:"1:" }};">
|
||||
<h4>{{ object.name }}</h4>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
{{ object.description }}
|
||||
</div>
|
||||
|
||||
<div class="card-footer text-center">
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus_team' pk=object.pk %}">{% trans "Edit" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
{% if memberships.data or True %}
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="clubListHeading">
|
||||
<a class="font-weight-bold">
|
||||
<i class="fa fa-bus"></i> {% trans "Teams" %}
|
||||
</a>
|
||||
</div>
|
||||
{% render_table memberships %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="{% url 'wei:wei_memberships_team_pdf' wei_pk=club.pk bus_pk=object.bus.pk team_pk=object.pk %}" data-turbolinks="false">
|
||||
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
|
||||
</a>
|
||||
{% endif %}
|
29
apps/wei/templates/wei/survey.html
Normal file
29
apps/wei/templates/wei/survey.html
Normal file
@ -0,0 +1,29 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<h4>{% trans "Survey WEI" %}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-xl-6">{% trans 'user'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ object.user }}</dd>
|
||||
</dl>
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<div class="card-footer text-center">
|
||||
<input class="btn btn-success" type="submit" value="{% trans "Next" %}"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
23
apps/wei/templates/wei/survey_closed.html
Normal file
23
apps/wei/templates/wei/survey_closed.html
Normal file
@ -0,0 +1,23 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<h4>{% trans "Survey WEI" %}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
{% trans "The inscription for this WEI are now closed." %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_detail' pk=club.pk %}">{% trans "Return to WEI detail" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
20
apps/wei/templates/wei/survey_end.html
Normal file
20
apps/wei/templates/wei/survey_end.html
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<h4>{% trans "Survey WEI" %}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
{% trans "The survey is now ended. Your answers have been saved." %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
30
apps/wei/templates/wei/weiclub_detail.html
Normal file
30
apps/wei/templates/wei/weiclub_detail.html
Normal file
@ -0,0 +1,30 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
{% include "wei/weiclub_tables.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
function refreshHistory() {
|
||||
$("#history_list").load("{% url 'wei:wei_detail' pk=object.pk %} #history_list");
|
||||
$("#profile_infos").load("{% url 'wei:wei_detail' pk=object.pk %} #profile_infos");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".no-perm").parent().addClass("d-none");
|
||||
if ($("a[data-type='validate-membership']:not(.d-none)").length === 0) {
|
||||
$("a[data-type='validate-membership']").parent().addClass("d-none");
|
||||
$("#validate-membership-header").addClass("d-none");
|
||||
}
|
||||
if ($("a[data-type='delete-membership']:not(.d-none)").length === 0) {
|
||||
$("a[data-type='delete-membership']").parent().addClass("d-none");
|
||||
$("#delete-membership-header").addClass("d-none");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
17
apps/wei/templates/wei/weiclub_form.html
Normal file
17
apps/wei/templates/wei/weiclub_form.html
Normal file
@ -0,0 +1,17 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% if club %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
79
apps/wei/templates/wei/weiclub_info.html
Normal file
79
apps/wei/templates/wei/weiclub_info.html
Normal file
@ -0,0 +1,79 @@
|
||||
{% load i18n static pretty_money perms %}
|
||||
<div class="card bg-light shadow">
|
||||
<div class="card-header text-center">
|
||||
<h4>{{ club.name }} </h4>
|
||||
</div>
|
||||
<div class="card-top text-center">
|
||||
<a href="{% url 'member:club_update_pic' club.pk %}">
|
||||
<img src="{{ club.note.display_image.url }}" class="img-thumbnail mt-2" >
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body" id="profile_infos">
|
||||
<dl class="row">
|
||||
<dt class="col-xl-6">{% trans 'name'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.name }}</dd>
|
||||
|
||||
{% if club.require_memberships %}
|
||||
<dt class="col-xl-6">{% trans 'date start'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.date_start }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'date end'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.date_end }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'year'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.year }}</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 %}
|
||||
{% with bde_kfet_fee=club.parent_club.membership_fee_paid|add:club.parent_club.parent_club.membership_fee_paid %}
|
||||
<dt class="col-xl-6">{% trans 'WEI fee / including BDE and Kfet fee (paid students)'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_fee_paid|pretty_money }} / {{ club.membership_fee_paid|add:bde_kfet_fee|pretty_money }}</dd>
|
||||
{% endwith %}
|
||||
|
||||
{% with bde_kfet_fee=club.parent_club.membership_fee_unpaid|add:club.parent_club.parent_club.membership_fee_unpaid %}
|
||||
<dt class="col-xl-6">{% trans 'WEI fee / including BDE and Kfet fee (unpaid students)'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.membership_fee_unpaid|pretty_money }} / {{ club.membership_fee_unpaid|add:bde_kfet_fee|pretty_money }}</dd>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if "note.view_note"|has_perm:club.note %}
|
||||
<dt class="col-xl-6">{% trans 'balance'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ club.note.balance | pretty_money }}</dd>
|
||||
{% endif %}
|
||||
|
||||
{% if "note.change_alias"|has_perm:club.note.alias_set.first %}
|
||||
<dt class="col-xl-4"><a href="{% url 'member:club_alias' club.pk %}">{% trans 'aliases'|capfirst %}</a></dt>
|
||||
<dd class="col-xl-8 text-truncate">{{ club.note.alias_set.all|join:", " }}</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-xl-4">{% trans 'email'|capfirst %}</dt>
|
||||
<dd class="col-xl-8"><a href="mailto:{{ club.email }}">{{ club.email }}</a></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
{% if True %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_list' %}"> {% trans "WEI list" %}</a>
|
||||
{% endif %}
|
||||
{% if club.is_current_wei %}
|
||||
{% if can_add_first_year_member %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_1A' wei_pk=club.pk %}" data-turbolinks="false"> {% trans "Register 1A" %}</a>
|
||||
{% endif %}
|
||||
{% if can_add_any_member %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_2A' wei_pk=club.pk %}" data-turbolinks="false"> {% trans "Register 2A+" %}</a>
|
||||
{% endif %}
|
||||
{% if "wei.change_"|has_perm:club %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_update' pk=club.pk %}" data-turbolinks="false"> {% trans "Edit" %}</a>
|
||||
{% endif %}
|
||||
{% if can_add_bus %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_bus' pk=club.pk %}" data-turbolinks="false"> {% trans "Add bus" %}</a>
|
||||
{% endif %}
|
||||
{% url 'wei:wei_detail' club.pk as club_detail_url %}
|
||||
{%if request.path_info != club_detail_url %}
|
||||
<a class="btn btn-primary btn-sm my-1" href="{{ club_detail_url }}">{% trans 'View WEI' %}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
69
apps/wei/templates/wei/weiclub_list.html
Normal file
69
apps/wei/templates/wei/weiclub_list.html
Normal file
@ -0,0 +1,69 @@
|
||||
{% extends "base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
<div class="row justify-content-center mb-4">
|
||||
<div class="col-md-10 text-center">
|
||||
<input class="form-control mx-auto w-25" type="text" onkeyup="search_field_moved()" id="search_field"/>
|
||||
{% if can_create_wei %}
|
||||
<hr>
|
||||
<a class="btn btn-primary text-center my-4" href="{% url 'wei:wei_create' %}">{% trans "Create WEI" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-10">
|
||||
<div class="card card-border shadow">
|
||||
<div class="card-header text-center">
|
||||
<h5> {% trans "WEI listing" %}</h5>
|
||||
</div>
|
||||
<div class="card-body px-0 py-0" id="club_table">
|
||||
{% render_table table %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block extrajavascript %}
|
||||
<script type="text/javascript">
|
||||
|
||||
function getInfo() {
|
||||
var asked = $("#search_field").val();
|
||||
/* on ne fait la requête que si on a au moins un caractère pour chercher */
|
||||
var sel = $(".table-row");
|
||||
if (asked.length >= 1) {
|
||||
$.getJSON("/api/wei/club/?format=json&search="+asked, function(buttons){
|
||||
let selected_id = buttons.results.map((a => "#row-"+a.id));
|
||||
$(".table-row,"+selected_id.join()).show();
|
||||
$(".table-row").not(selected_id.join()).hide();
|
||||
|
||||
});
|
||||
}else{
|
||||
// show everything
|
||||
$('table tr').show();
|
||||
}
|
||||
}
|
||||
var timer;
|
||||
var timer_on;
|
||||
/* Fontion appelée quand le texte change (délenche le timer) */
|
||||
function search_field_moved(secondfield) {
|
||||
if (timer_on) { // Si le timer a déjà été lancé, on réinitialise le compteur.
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout("getInfo(" + secondfield + ")", 300);
|
||||
}
|
||||
else { // Sinon, on le lance et on enregistre le fait qu'il tourne.
|
||||
timer = setTimeout("getInfo(" + secondfield + ")", 300);
|
||||
timer_on = true;
|
||||
}
|
||||
}
|
||||
|
||||
// clickable row
|
||||
$(document).ready(function($) {
|
||||
$(".table-row").click(function() {
|
||||
window.document.location = $(this).data("href");
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
82
apps/wei/templates/wei/weiclub_tables.html
Normal file
82
apps/wei/templates/wei/weiclub_tables.html
Normal file
@ -0,0 +1,82 @@
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load i18n %}
|
||||
{% load perms %}
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<h4>WEI</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>LE WEI, c'est cool !</p>
|
||||
</div>
|
||||
|
||||
{% if club.is_current_wei %}
|
||||
<div class="card-footer text-center">
|
||||
{% if not my_registration %}
|
||||
{% if not not_first_year %}
|
||||
<a href="{% url "wei:wei_register_1A_myself" wei_pk=club.pk %}" data-turbolinks="false"><button class="btn btn-success">{% trans "Register to the WEI! – 1A" %}</button></a>
|
||||
{% endif %}
|
||||
<a href="{% url "wei:wei_register_2A_myself" wei_pk=club.pk %}" data-turbolinks="false"><button class="btn btn-success">{% trans "Register to the WEI! – 2A+" %}</button></a>
|
||||
{% else %}
|
||||
<a href="{% url "wei:wei_update_registration" pk=my_registration.pk %}" data-turbolinks="false"><button class="btn btn-warning">{% trans "Update my registration" %}</button></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
{% if buses.data %}
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="clubListHeading">
|
||||
<a class="font-weight-bold">
|
||||
<i class="fa fa-bus"></i> {% trans "Buses" %}
|
||||
</a>
|
||||
</div>
|
||||
{% render_table buses %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
{% endif %}
|
||||
|
||||
{% if member_list.data %}
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="clubListHeading">
|
||||
<a class="stretched-link font-weight-bold" href="{% url "wei:wei_memberships" pk=club.pk %}">
|
||||
<i class="fa fa-users"></i> {% trans "Members of the WEI" %}
|
||||
</a>
|
||||
</div>
|
||||
{% render_table member_list %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
{% endif %}
|
||||
|
||||
{% if history_list.data %}
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="historyListHeading">
|
||||
<a class="stretched-link font-weight-bold" {% if "note.view_note"|has_perm:club.note %} href="{% url 'note:transactions' pk=club.note.pk %}" {% endif %}>
|
||||
<i class="fa fa-euro"></i> {% trans "Transaction history" %}
|
||||
</a>
|
||||
</div>
|
||||
<div id="history_list">
|
||||
{% render_table history_list %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
{% endif %}
|
||||
|
||||
{% if pre_registrations.data %}
|
||||
<div class="card">
|
||||
<div class="card-header position-relative" id="historyListHeading">
|
||||
<a class="stretched-link font-weight-bold" href="{% url 'wei:wei_registrations' pk=club.pk %}">
|
||||
<i class="fa fa-user-plus"></i> {% trans "Unvalidated registrations" %}
|
||||
</a>
|
||||
</div>
|
||||
<div id="history_list">
|
||||
{% render_table pre_registrations %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
{% endif %}
|
52
apps/wei/templates/wei/weilist_sample.tex
Normal file
52
apps/wei/templates/wei/weilist_sample.tex
Normal file
@ -0,0 +1,52 @@
|
||||
\documentclass[landscape,10pt]{article}
|
||||
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[french]{babel}
|
||||
|
||||
\usepackage[margin=1.5cm]{geometry}
|
||||
\usepackage{lmodern}
|
||||
\usepackage{ltablex}
|
||||
\usepackage{tabularx}
|
||||
|
||||
\begin{document}
|
||||
\begin{center}
|
||||
\huge{Liste des inscrits \og {{ wei.name }} \fg{}}
|
||||
|
||||
{% if bus %}
|
||||
\LARGE{Bus {{ bus.name|safe }}}
|
||||
|
||||
|
||||
{% if team %}
|
||||
\Large{Équipe {{ team.name|safe }}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
\end{center}
|
||||
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabularx}{\textwidth}{ccccccccc}
|
||||
\textbf{Nom} & \textbf{Prénom} & \textbf{Date de naissance} & \textbf{Genre} & \textbf{Section}
|
||||
& \textbf{Bus} & \textbf{Équipe} & \textbf{Rôles} \\
|
||||
{% for membership in memberships %}
|
||||
{{ membership.user.last_name|safe }} & {{ membership.user.first_name|safe }} & {{ membership.registration.birth_date|safe }}
|
||||
& {{ membership.registration.get_gender_display|safe }} & {{ membership.user.profile.section_generated|safe }} & {{ membership.bus.name|safe }}
|
||||
& {% if membership.team %}{{ membership.team.name|safe }}{% else %}--{% endif %} & {{ membership.roles.first|safe }} \\
|
||||
{% endfor %}
|
||||
\end{tabularx}
|
||||
\end{center}
|
||||
|
||||
\footnotesize
|
||||
Section = Année à l'ENS + code du département
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{ccccccccc}
|
||||
\textbf{Code} & A0 & A1 & A2 & A'2 & A''2 & A3 & B1234 & B1 \\
|
||||
\textbf{Département} & Informatique & Maths & Physique & Physique appliquée & Chimie & Biologie & SAPHIRE & Mécanique \\
|
||||
\hline
|
||||
\textbf{Code} & B2 & B3 & B4 & C & D2 & D3 & E & EXT \\
|
||||
\textbf{Département} & Génie civil & Génie mécanique & EEA & Design & Éco-gestion & Sciences sociales & Anglais & Extérieur
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\end{document}
|
215
apps/wei/templates/wei/weimembership_form.html
Normal file
215
apps/wei/templates/wei/weimembership_form.html
Normal file
@ -0,0 +1,215 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load i18n %}
|
||||
{% load pretty_money %}
|
||||
{% load perms %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<div class="card bg-light shadow">
|
||||
<div class="card-header text-center">
|
||||
<h4>{% trans "Review registration" %}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-xl-6">{% trans 'name'|capfirst %}, {% trans 'first name' %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.user.last_name }} {{ registration.user.first_name }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'username'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.user.username }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'email'|capfirst %}</dt>
|
||||
<dd class="col-xl-6"><a href="mailto:{{ registration.user.email }}">{{ registration.user.email }}</a></dd>
|
||||
|
||||
{% if not registration.user.profile.email_confirmed and "member.change_profile_email_confirmed"|has_perm:registration.user.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=registration.user.pk %}">{% trans "Click here to resend a validation link." %}</a>
|
||||
</div>
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-xl-6">{% trans 'department'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.user.profile.department }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'ENS year'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.user.profile.ens_year }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'section'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.user.profile.section }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'address'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.user.profile.address }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'phone number'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.user.profile.phone_number }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'paid'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.user.profile.paid|yesno }}</dd>
|
||||
|
||||
<hr>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'first year'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.first_year|yesno }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'gender'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.gender }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'clothing cut'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.clothing_cut }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'clothing size'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.clothing_size }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'birth date'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.birth_date }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'health issues'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.health_issues }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'emergency contact name'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.emergency_contact_name }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'emergency contact phone'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.emergency_contact_phone }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'Register on the mailing list to stay informed of the events of the campus (1 mail/week)' %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.ml_events_registration|yesno }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'Register on the mailing list to stay informed of the sport events of the campus (1 mail/week)' %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.ml_sport_registration|yesno }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'Register on the mailing list to stay informed of the art events of the campus (1 mail/week)' %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.ml_art_registration|yesno }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'Payment from Société générale' %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.soge_credit|yesno }}</dd>
|
||||
|
||||
{% if registration.first_year %}
|
||||
<dt class="col-xl-6">{% trans 'Suggested bus from the survey:' %}</dt>
|
||||
{% if registration.information.valid or True %}
|
||||
<dd class="col-xl-6">{{ suggested_bus }}</dd>
|
||||
|
||||
<div class="card-header text-center col-xl-12">
|
||||
<h5>{% trans 'Raw survey information' %}</h5>
|
||||
</div>
|
||||
|
||||
{% with information=registration.information %}
|
||||
{% for key, value in information.items %}
|
||||
<dt class="col-xl-6">{{ key }}</dt>
|
||||
<dd class="col-xl-6">{{ value }}</dd>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
<dd class="col-xl-6"><em>{% trans "The algorithm didn't run." %}</em></dd>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<dt class="col-xl-6">{% trans 'caution check given'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ registration.caution_check|yesno }}</dd>
|
||||
|
||||
{% with information=registration.information %}
|
||||
<dt class="col-xl-6">{% trans 'preferred bus'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ information.preferred_bus_name|join:', ' }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'preferred team'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ information.preferred_team_name|join:', ' }}</dd>
|
||||
|
||||
<dt class="col-xl-6">{% trans 'preferred roles'|capfirst %}</dt>
|
||||
<dd class="col-xl-6">{{ information.preferred_roles_name|join:', ' }}</dd>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<a class="btn btn-primary btn-sm" href="{% url 'wei:wei_update_registration' registration.pk %}" data-turbolinks="false">{% trans 'Update registration' %}</a>
|
||||
{% if "auth.change_user"|has_perm:registration.user %}
|
||||
<a class="btn btn-primary btn-sm" href="{% url 'member:user_update_profile' registration.user.pk %}">{% trans 'Update Profile' %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="card bg-light shadow">
|
||||
<form method="post">
|
||||
<div class="card-header text-center" >
|
||||
<h4> {% trans "Validate registration" %}</h4>
|
||||
</div>
|
||||
{% if registration.is_validated %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "The registration is already validated and can't be unvalidated." %}
|
||||
{% trans "The user joined the bus" %} {{ registration.membership.bus }}
|
||||
{% if registration.membership.team %}{% trans "in the team" %} {{ registration.membership.team }},
|
||||
{% else %}{% trans "in no team (staff)" %},{% endif %} {% trans "with the following roles:" %} {{ registration.membership.roles.all|join:", " }}
|
||||
</div>
|
||||
{% else %}
|
||||
{% if registration.soge_credit %}
|
||||
<div class="alert alert-warning">
|
||||
{% blocktrans trimmed %}
|
||||
The WEI will be paid by Société générale. The membership will be created even if the bank didn't pay the BDE yet.
|
||||
The membership transaction will be created but will be invalid. You will have to validate it once the bank
|
||||
validated the creation of the account, or to change the payment method.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% if registration.user.note.balance < fee %}
|
||||
<div class="alert alert-danger">
|
||||
{% with pretty_fee=fee|pretty_money %}
|
||||
{% blocktrans trimmed with balance=registration.user.note.balance|pretty_money %}
|
||||
The note don't have enough money ({{ balance }}, {{ pretty_fee }} required). The registration may fail.
|
||||
{% endblocktrans %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-success">
|
||||
{% blocktrans trimmed with pretty_fee=fee|pretty_money %}
|
||||
The note has enough money ({{ pretty_fee }} required), the registration is possible.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if not registration.caution_check and not registration.first_year %}
|
||||
<div class="alert alert-danger">
|
||||
{% trans "The user didn't give her/his caution check." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not kfet_member %}
|
||||
<div class="alert alert-warning">
|
||||
{% url 'registration:future_user_detail' pk=registration.user.pk as future_user_detail %}
|
||||
{% url 'member:club_detail' pk=club.parent_club.parent_club.pk as club_detail %}
|
||||
{% blocktrans trimmed %}
|
||||
This user is not a member of the Kfet club for the coming year. The membership will be
|
||||
processed automatically, the WEI registration includes the membership fee.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<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>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
function autocompleted(obj, prefix) {
|
||||
console.log(prefix);
|
||||
if (prefix === "id_bus") {
|
||||
console.log(obj);
|
||||
$("#id_team").attr('api_url', '/api/wei/team/?bus=' + obj.id);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
52
apps/wei/templates/wei/weimembership_list.html
Normal file
52
apps/wei/templates/wei/weimembership_list.html
Normal file
@ -0,0 +1,52 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load i18n %}
|
||||
{% load render_table from django_tables2 %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note/bus/équipe ...">
|
||||
<hr>
|
||||
|
||||
<div id="memberships_table">
|
||||
{% if table.data %}
|
||||
{% render_table table %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "There is no membership found with this pattern." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<a href="{% url 'wei:wei_registrations' pk=club.pk %}">
|
||||
<button class="btn btn-block btn-info">{% trans "View unvalidated registrations..." %}</button>
|
||||
</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="{% url 'wei:wei_memberships_pdf' wei_pk=club.pk %}" data-turbolinks="false">
|
||||
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
|
||||
</a>
|
||||
{% 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)
|
||||
return;
|
||||
|
||||
$("#memberships_table").load(location.pathname + "?search=" + pattern.replace(" ", "%20") + " #memberships_table");
|
||||
}
|
||||
|
||||
searchbar_obj.keyup(reloadTable);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
37
apps/wei/templates/wei/weiregistration_confirm_delete.html
Normal file
37
apps/wei/templates/wei/weiregistration_confirm_delete.html
Normal file
@ -0,0 +1,37 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<div class="card bg-light shadow">
|
||||
<div class="card-header text-center">
|
||||
<h4>{% trans "Delete registration" %}</h4>
|
||||
</div>
|
||||
{% if object.is_validated %}
|
||||
<div class="card-body">
|
||||
<div class="alert alert-danger">
|
||||
{% blocktrans %}This registration is already validated and can't be deleted.{% endblocktrans %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card-body">
|
||||
<div class="alert alert-warning">
|
||||
{% with user=object.user wei_name=object.wei.name %}
|
||||
{% blocktrans %}Are you sure you want to delete the registration of {{ user }} for the WEI {{ wei_name }}? This action can't be undone.{% endblocktrans %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<a class="btn btn-warning" href="{% url 'wei:wei_update_registration' object.pk %}">{% trans "Update registration" %}</a>
|
||||
<button class="btn btn-danger" type="submit">{% trans "Delete" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
42
apps/wei/templates/wei/weiregistration_form.html
Normal file
42
apps/wei/templates/wei/weiregistration_form.html
Normal file
@ -0,0 +1,42 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
{{ membership_form|crispy }}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
function refreshTeams() {
|
||||
let buses = [];
|
||||
$("input[name='bus']:checked").each(function(ignored) {
|
||||
buses.push($(this).parent().text().trim());
|
||||
});
|
||||
console.log(buses);
|
||||
$("input[name='team']").each(function() {
|
||||
let label = $(this).parent();
|
||||
$(this).parent().addClass('d-none');
|
||||
buses.forEach(function(bus) {
|
||||
if (label.text().includes(bus))
|
||||
label.removeClass('d-none');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$("input[name='bus']").change(refreshTeams);
|
||||
|
||||
refreshTeams();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
56
apps/wei/templates/wei/weiregistration_list.html
Normal file
56
apps/wei/templates/wei/weiregistration_list.html
Normal file
@ -0,0 +1,56 @@
|
||||
{% extends "member/noteowner_detail.html" %}
|
||||
{% load i18n %}
|
||||
{% load render_table from django_tables2 %}
|
||||
|
||||
{% block profile_info %}
|
||||
{% include "wei/weiclub_info.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block profile_content %}
|
||||
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note ...">
|
||||
<hr>
|
||||
|
||||
<div id="registrations_table">
|
||||
{% if table.data %}
|
||||
{% render_table table %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "There is no pre-registration found with this pattern." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<a href="{% url 'wei:wei_memberships' pk=club.pk %}">
|
||||
<button class="btn btn-block btn-info">{% trans "View validated memberships..." %}</button>
|
||||
</a>
|
||||
{% 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)
|
||||
return;
|
||||
|
||||
$("#registrations_table").load(location.pathname + "?search=" + pattern.replace(" ", "%20") + " #registrations_table");
|
||||
}
|
||||
|
||||
searchbar_obj.keyup(reloadTable);
|
||||
|
||||
$(".no-perm").parent().addClass("d-none");
|
||||
if ($("a[data-type='validate-membership']:not(.d-none)").length === 0) {
|
||||
$("a[data-type='validate-membership']").parent().addClass("d-none");
|
||||
$("#validate-membership-header").addClass("d-none");
|
||||
}
|
||||
if ($("a[data-type='delete-membership']:not(.d-none)").length === 0) {
|
||||
$("a[data-type='delete-membership']").parent().addClass("d-none");
|
||||
$("#delete-membership-header").addClass("d-none");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user