mirror of
https://github.com/nanoy42/coope
synced 2024-05-20 08:11:47 +00:00
219 lines
6.7 KiB
HTML
219 lines
6.7 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
{% block entete %}{% if self %}<h1>Mon Profil</h1>{% else %}<h1>Profil de {{user}}</h1>{% endif %}{%endblock%}
|
|
|
|
{% block navbar %}
|
|
<ul>
|
|
<li><a href="#first">{% if self %}Mes informations {% else %} Informations {% endif %}</a>
|
|
</li>
|
|
<li><a href="#second">{% if self %}Mes dernières consommations {% else %} Dernières consommations {% endif %}</a>
|
|
</li>
|
|
<li><a href="#third">{% if self %}Mes derniers rechargements{% else %}Derniers rechargements {% endif %}</a>
|
|
</li>
|
|
<li><a href="#fourth">{% if self %} Mes cotisations {% else %} Cotisations {% endif %}</a></li>
|
|
<li><a href="#fifth">{% if self %} Mes accès gracieux {% else %} Accès gracieux {% endif %}</a></li>
|
|
</ul>
|
|
{% endblock %}
|
|
{% block content %}
|
|
<section id="first" class="main">
|
|
<div class="content">
|
|
<header class="major">
|
|
<h2>{% if self %} Mes informations {% else %} Informations {% endif %}</h2>
|
|
</header>
|
|
<div class="row">
|
|
<div class="12u">
|
|
<ul class="alt" id="informationsClient">
|
|
<li>
|
|
<b>Nom : </b>{{user.last_name}}<span class="tabulation">
|
|
<b>Prénom : </b>{{user.first_name}}</span><span class="tabulation">
|
|
<b>École : </b>{{user.profile.school}}</span>
|
|
</li>
|
|
<li><b>Pseudo : </b>{{user.username}}<span class="tabulation">
|
|
<b>Mail: </b> {{user.email}}</span>
|
|
</li>
|
|
<li>
|
|
<b>Date inscription : </b>{{user.date_joined}}<span class="tabulation">
|
|
<b>Fin de cotisation: </b> {{user.profile.cotisationEnd|default:"Aucune cotisation"}}</span>
|
|
</li>
|
|
<li><b>Solde : </b>{{user.profile.balance}}<span class="tabulation">
|
|
<b>Crédit : </b>{{user.profile.credit}}</span><span class="tabulation">
|
|
<b>Débit : </b>{{user.profile.debit}}</span>
|
|
</li>
|
|
<li><b>Groupe(s) : </b>{{user.groups.all|join:", "}}</li>
|
|
<li>
|
|
<b>Position au classement : </b>{{user.profile.rank}}<span class="tabulation">
|
|
<b>Quantité d'alcool ingérée : </b>{{user.profile.alcohol}} kg</span>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="12u">
|
|
<ul class="alt">
|
|
<li>
|
|
{% if self or perms.users.can_change_user %}
|
|
<span><a href="{% url 'users:editUser' user.pk %}">Modifier {{self | yesno:"mes,les"}} informations</a></span>
|
|
{% endif %}
|
|
{% if self %}
|
|
<span class="tabulation"><a href="{% url 'users:editPassword' user.pk %}">Changer mon mot de passe</a></span>
|
|
{% endif %}
|
|
{% if perms.users.can_reset_password %}
|
|
<span class="tabulation"><a href="{% url 'users:resetPassword' user.pk %}">Réinitialiser le mot de passe</a></span>
|
|
{% endif %}
|
|
{% if perms.users.can_change_user_perm %}
|
|
<span class="tabulation"><a href="{% url 'users:editGroups' user.pk %}">Changer les groupes</a></span>
|
|
{% endif %}
|
|
{% if request.user.is_staff %}
|
|
{% if user.is_staff %}
|
|
<span class="tabulation"><a href="">Retirer des admins</a></span>
|
|
{% else %}
|
|
<span class="tabulation"><a href="">Ajouter aux admins</a></span>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if request.user.is_superuser %}
|
|
{% if user.is_superuser %}
|
|
<span class="tabulation"><a href="">Retirer des superusers</a></span>
|
|
{% else %}
|
|
<span class="tabulation"><a href="">Ajouter aux superusers</a></span>
|
|
{% endif %}
|
|
{% endif %}
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<section class="row uniform">
|
|
</section>
|
|
</section>
|
|
<section id="second" class="main">
|
|
<header class="major">
|
|
<h2>{{self | yesno:"Mes dernières,Dernières"}} consommations</h2>
|
|
<p>(Affichage des 10 dernières entrées)</p>
|
|
</header>
|
|
<section id="transactions">
|
|
<div class="table-wrapper">
|
|
<table>
|
|
<thead id="headTransaction">
|
|
<tr>
|
|
<th>Produit</th>
|
|
<th>Quantité</th>
|
|
<th>Montant</th>
|
|
<th>Type de Paiement</th>
|
|
<th>Date</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="bodyTransaction">
|
|
{% for consumption in consumptions %}
|
|
<tr>
|
|
{% for part in consumption %}
|
|
<th>{{part}}</th>
|
|
{%endfor%}
|
|
</tr>
|
|
{%endfor%}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section id="third" class="main">
|
|
<header class="major">
|
|
<h2>{{self | yesno:"Mes derniers,Derniers"}} rechargements</h2>
|
|
<p>(Affichage des 5 dernières entrées)</p>
|
|
</header>
|
|
<section id="rechargements">
|
|
<div class="table-wrapper">
|
|
<table>
|
|
<thead id="headRechargement">
|
|
<tr>
|
|
<th>Montant</th>
|
|
<th>Type de Rechargement</th>
|
|
<th>Date</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="bodyRechargement">
|
|
{%for reload in lastReloads%}
|
|
<tr>
|
|
<th>{{reload.amount}}</th>
|
|
<th>{{reload.paymentMethod}}</th>
|
|
<th>{{reload.date}}</th>
|
|
</tr>
|
|
{%endfor%}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
|
|
<section id="fourth" class="main">
|
|
<header class="major">
|
|
<h2>{{ self | yesno:"Mes cotisations,Cotisations"}}</h2>
|
|
</header>
|
|
<section>
|
|
<a class="button" href="{% url 'users:addCotisationHistory' user.pk %}">Ajouter une cotisation</a><br><br>
|
|
<div class="table-wrapper">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Montant</th>
|
|
<th>Durée</th>
|
|
<th>Date de paiement</th>
|
|
<th>Moyen de paiement</th>
|
|
<th>Date de fin</th>
|
|
<th>Etat</th>
|
|
<th>Modération</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for cotisation in cotisations %}
|
|
<tr>
|
|
<td>{{cotisation.amount}}€</td>
|
|
<td>{{cotisation.duration}} jours</td>
|
|
<td>{{cotisation.paymentDate}}</td>
|
|
<td>{{cotisation.paymentMethod}}</td>
|
|
<td>{{cotisation.endDate}}</td>
|
|
<td>{{cotisation.valid}}</td>
|
|
<td><a class="button small" href="{% url 'users:validateCotisationHistory' cotisation.pk %}">Valider</a> <a class="button small" href="{% url 'users:invalidateCotisationHistory' cotisation.pk %}">Invalider</a></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
|
|
<section id="fifth" class="main">
|
|
<header class="major">
|
|
<h2>{{ self | yesno:"Mes accès gracieux,Accès gracieux"}}</h2>
|
|
</header>
|
|
<section>
|
|
<a class="button" href="{% url 'users:addWhiteListHistory' user.pk %}">Ajouter un accès à titre gracieux</a><br><br>
|
|
<div class="table-wrapper">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Date de l'ajout</th>
|
|
<th>Date de fin</th>
|
|
<th>Durée</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for whitelist in whitelists %}
|
|
<tr>
|
|
<td>{{whitelist.paymentDate}}</td>
|
|
<td>{{whitelist.endDate}}</td>
|
|
<td>{{whitelist.duration}} jours</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
|
|
|
|
|
|
{%endblock%}
|
|
{%block addScript %}
|
|
<script src="{%static 'js/canvasjs.min.js'%}"></script>
|
|
<script src="{%static 'js/profil.js'%}"></script>
|
|
{%endblock%}
|