8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-26 22:52:26 +00:00
re2o/users/templates/users/profil.html

480 lines
21 KiB
HTML
Raw Normal View History

{% extends "users/sidebar.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
2016-07-03 16:09:58 +00:00
{% load bootstrap3 %}
2017-12-27 23:10:30 +00:00
{% load acl %}
{% load logs_extra %}
2018-07-30 15:00:41 +00:00
{% load design %}
{% load i18n %}
2018-07-25 18:28:13 +00:00
2018-08-15 17:15:26 +00:00
{% block title %}{% trans "Profile" %}{% endblock %}
2018-07-25 18:28:13 +00:00
{% block content %}
2018-08-10 15:15:03 +00:00
<div align="center" class="title-dashboard">
{% if user == users %}
2018-08-15 17:15:26 +00:00
<h2>{% blocktrans with name=users.name surname=users.surname %}Welcome {{ name }} {{ surname }}{% endblocktrans %}</h2>
{% else %}
2018-08-15 17:15:26 +00:00
<h2>{% blocktrans with name=users.name surname=users.surname %}Profile of {{ name }} {{ surname }}{% endblocktrans %}</h2>
{% endif %}
</div>
<div class="dashboard_container">
2018-07-25 18:28:13 +00:00
<div class="row">
2018-07-25 18:46:48 +00:00
<div class="col-sm-6 {% if solde_activated %}col-md-4{% else %}col_md-6{% endif %}">
2018-07-25 18:28:13 +00:00
{% if users.is_ban%}
<div class="panel panel-danger">
2018-08-15 17:15:26 +00:00
<div class="panel-heading dashboard">{% trans "Your account has been banned" %}</div>
2018-07-25 18:28:13 +00:00
<div class="panel-body dashboard">
2018-08-15 17:15:26 +00:00
<i class="text-danger">{% blocktrans with end_ban=users.end_ban|date:"SHORT_DATE_FORMAT" %}End of the ban: {{ end_ban }}{% endblocktrans %}</i>
2018-07-25 18:28:13 +00:00
</div>
</div>
{% elif not users.has_access %}
2018-07-25 18:28:13 +00:00
<div class="panel panel-danger">
2018-08-15 17:15:26 +00:00
<div class="panel-heading dashboard">{% trans "No connection" %}</div>
<div class="panel-body dashboard">
2018-07-25 18:57:28 +00:00
{% can_create Facture %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}">
2018-08-15 17:15:26 +00:00
<i class="fas fa-sign-in-alt"></i> {% trans "Pay for a connection" %}
2018-07-25 18:28:13 +00:00
</a>
2018-07-25 18:57:28 +00:00
{% acl_else %}
2018-08-15 17:15:26 +00:00
{% trans "Ask for someone with the appropriate rights to pay for a connection." %}
2018-07-25 18:57:28 +00:00
{% acl_end %}
2018-07-25 18:28:13 +00:00
</div>
</div>
{% else %}
2018-07-25 18:28:13 +00:00
<div class="panel panel-success">
<div class="panel-heading dashboard">{% blocktrans with end_connection=users.end_access|date:"SHORT_DATE_FORMAT" %}Connection (until {{ end_connection }} ){% endblocktrans %}</div>
2018-07-25 18:28:13 +00:00
<div class="panel-body dashboard">
{% can_create Facture %}
<a class="btn btn-success btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}">
2018-08-23 13:05:04 +00:00
<i class="fas fa-sign-in-alt"></i> {% trans "Extend the connection period" %}
</a>
{% acl_end %}
2018-07-25 18:28:13 +00:00
</div>
</div>
{% endif %}
2018-07-25 18:28:13 +00:00
</div>
{% if solde_activated %}
<div class="col-sm-6 col-md-4">
<div class="panel panel-info">
<div class="panel-heading dashboard" data-parent="#accordion" data-toggle="collapse" data-target="#collapse4">
{{ users.solde }} <i class="fas fa-euro-sign"></i>
2018-07-25 18:28:13 +00:00
</div>
<div class="panel-body dashboard">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:credit-solde' users.id %}">
2018-08-15 17:15:26 +00:00
<i class="fa fa-euro-sign"></i> {% trans "Refill the balance" %}
</a>
2018-07-25 18:28:13 +00:00
</div>
</div>
</div>
2018-07-25 18:28:13 +00:00
{% endif %}
2018-07-25 18:46:48 +00:00
<div class="col-sm-6 {% if solde_activated %}col-md-4{% else %}col-md-6{% endif %}">
2018-07-25 18:43:28 +00:00
{% if nb_machines %}
<div class="panel panel-info">
<div class="panel-heading dashboard" data-parent="#accordion" data-toggle="collapse" data-target="#collapse3">
<i class="fa fa-desktop"></i>{% trans " Machines" %} <span class="badge"> {{ nb_machines }}</span>
2018-07-25 18:28:13 +00:00
</div>
2018-07-25 18:43:28 +00:00
<div class="panel-body dashboard">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
2018-08-15 17:15:26 +00:00
<i class="fa fa-desktop"></i>{% trans " Add a machine" %}
2018-07-25 18:43:28 +00:00
</a>
2018-07-25 18:28:13 +00:00
</div>
</div>
2018-07-25 18:43:28 +00:00
{% else %}
<div class="panel panel-warning">
2018-08-15 17:15:26 +00:00
<div class="panel-heading dashboard">{% trans "No machine" %}</div>
2018-07-25 18:43:28 +00:00
<div class="panel-body dashboard">
<a class="btn btn-warning btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
2018-08-15 17:15:26 +00:00
<i class="fa fa-desktop"></i>{% trans " Add a machine" %}
2018-07-25 18:43:28 +00:00
</a>
</div>
</div>
{% endif %}
</div>
</div>
</div>
2018-01-27 20:58:31 +00:00
<div class="panel-group" id="accordion">
2018-03-17 22:52:01 +00:00
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#collapse1">
<h3 class="panel-title pull-left" >
2018-08-15 17:15:26 +00:00
<i class="fa fa-user"></i>{% trans " Detailed information" %}
2018-01-27 16:35:33 +00:00
</h3>
2018-03-29 21:43:43 +00:00
</div>
2018-08-15 17:15:26 +00:00
<div class="panel-collapse collapse in" id="collapse1">
<div class="panel-body">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-info' users.id %}">
<i class="fa fa-edit"></i>
{% trans "Edit" %}
</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' users.id %}">
<i class="fa fa-lock"></i>
{% trans "Change the password" %}
</a>
{% can_change User state %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:state' users.id %}">
<i class="fa fa-id-badge"></i>
{% trans "Change the state" %}
</a>
{% acl_end %}
{% can_change User groups %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:groups' users.id %}">
<i class="fa fa-check"></i>
{% trans "Edit the groups" %}
</a>
{% acl_end %}
{% history_button users text=True %}
2018-01-27 20:58:31 +00:00
</ul>
</div>
<div class="panel-body">
2018-03-17 23:09:57 +00:00
<div class="table-responsive">
2018-08-15 17:15:26 +00:00
<table class="table table-striped">
<tr>
{% if users.is_class_club %}
<th>{% trans "Mailing" %}</th>
{% if users.club.mailing %}
<td>{{ users.pseudo }}(-admin)</td>
{% else %}
<td>{% trans "Mailing disabled" %}</td>
{% endif %}
{% else %}
<th>{% trans "Firt name" %}</th>
<td>{{ users.name }}</td>
{% endif %}
<th>{% trans "Surname" %}</th>
<td>{{ users.surname }}</td>
</tr>
<tr>
<th>{% trans "Username" %}</th>
<td>{{ users.pseudo }}</td>
<th>{% trans "Email address" %}</th>
<td>{{ users.email }}</td>
</tr>
<tr>
<th>{% trans "Room" %}</th>
<td>{{ users.room }}</td>
<th>{% trans "Telephone number" %}</th>
<td>{{ users.telephone }}</td>
</tr>
<tr>
<th>{% trans "School" %}</th>
<td>{{ users.school }}</td>
<th>{% trans "Comment" %}</th>
<td>{{ users.comment }}</td>
</tr>
<tr>
<th>{% trans "Registration date" %}</th>
<td>{{ users.registered }}</td>
<th>{% trans "Last login" %}</th>
<td>{{ users.last_login }}</td>
</tr>
<tr>
<th>{% trans "End of membership" %}</th>
{% if users.end_adhesion != None %}
<td><i class="text-success">{{ users.end_adhesion }}</i></td>
{% else %}
<td><i class="text-danger">{% trans "Not a member" %}</i></td>
{% endif %}
<th>{% trans "Whitelist" %}</th>
{% if users.end_whitelist != None %}
<td><i class="text-success">{{ users.end_whitelist }}</i></td>
{% else %}
<td><i class="text-warning">{% trans "None" %}</i></td>
{% endif %}
<tr>
<th>{% trans "Ban" %}</th>
{% if users.end_ban != None %}
<td><i class="text-danger">{{ users.end_ban }}</i></td>
{% else %}
<td><i class="text-success">{% trans "Not banned" %}</i></td>
{% endif %}
<th>{% trans "State" %}</th>
{% if users.state == 0 %}
<td><i class="text-success">{% trans "Active" %}</i></td>
{% elif users.state == 1 %}
<td><i class="text-danger">{% trans "Disabled" %}</i></td>
{% else %}
<td><i class="text-warning">{% trans "Archived" %}</i></td>
{% endif %}
</tr>
<tr>
<th>{% trans "Internet access" %}</th>
{% if users.has_access == True %}
<td><i class="text-success">{% blocktrans with end_access=users.end_access %}Active (until {{ end_access }}){% endblocktrans %}</i></td>
{% else %}
<td><i class="text-danger">{% trans "Disabled" %}</i></td>
{% endif %}
<th>{% trans "Groups of rights" %}</th>
{% if users.groups.all %}
<td>{{ users.groups.all|join:", "}}</td>
{% else %}
<td>{% trans "None" %}</td>
{% endif %}
</tr>
<tr>
<th>{% trans "Balance" %}</th>
<td>{{ users.solde }} €
{% if user_solde %}
<a class="btn btn-primary btn-sm" style='float:right' role="button" href="{% url 'cotisations:credit-solde' users.pk%}">
<i class="fa fa-euro-sign"></i>
{% trans "Refill" %}
</a>
{% endif %}
</td>
{% if users.adherent.gpg_fingerprint %}
<th>{% trans "GPG fingerprint" %}</th>
<td>{{ users.adherent.gpg_fingerprint }}</td>
{% endif %}
</tr>
<tr>
{% if users.shell %}
<th>{% trans "Shell" %}</th>
<td>{{ users.shell }}</td>
{% endif %}
</tr>
</table>
2018-03-17 23:09:57 +00:00
</div>
2018-01-27 16:35:33 +00:00
</div>
</div>
</div>
{% if users.is_class_club %}
2018-01-27 16:35:33 +00:00
<div class="panel panel-default">
<div class="panel-heading clearfix" data-parent="#accordion" data-toggle="collapse" data-target="#collapse2">
2018-01-27 20:58:31 +00:00
<h3 class="panel-title pull-left">
2018-08-15 17:15:26 +00:00
<i class="fa fa-users"></i>{% trans " Manage the club" %}
2018-01-27 16:35:33 +00:00
</h3>
2018-01-27 20:58:31 +00:00
</div>
<div class="panel-collapse collapse" id="collapse2">
<div class="panel-body">
2018-03-29 21:43:43 +00:00
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-club-admin-members' users.club.id %}">
<i class="fa fa-lock"></i>
2018-08-15 17:15:26 +00:00
{% trans "Manage the admins and members" %}
</a>
2018-03-29 21:43:43 +00:00
</div>
2018-08-15 17:15:26 +00:00
<div class="panel-body">
<h4>{% trans "Club admins" %}</h4>
2018-03-17 23:09:57 +00:00
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
2018-08-15 17:15:26 +00:00
<th>{% trans "Surname" %}</th>
<th>{% trans "First name" %}</th>
<th>{% trans "Username" %}</th>
</tr>
</thead>
{% for admin in users.club.administrators.all %}
2018-01-27 16:35:33 +00:00
<tr>
<td>{{ admin.surname }}</td>
<td>{{ admin.name }}</td>
<td>{{ admin.pseudo }}</td>
2018-01-27 16:35:33 +00:00
</tr>
{% endfor %}
</table>
2018-03-17 23:09:57 +00:00
</div>
2018-08-15 17:15:26 +00:00
<h4>{% trans "Members" %}</h4>
2018-03-17 23:09:57 +00:00
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
2018-08-15 17:15:26 +00:00
<th>{% trans "Surname" %}</th>
<th>{% trans "First name" %}</th>
<th>{% trans "Username" %}</th>
</tr>
</thead>
{% for admin in users.club.members.all %}
2018-01-27 16:35:33 +00:00
<tr>
<td>{{ admin.surname }}</td>
<td>{{ admin.name }}</td>
<td>{{ admin.pseudo }}</td>
2018-01-27 16:35:33 +00:00
</tr>
{% endfor %}
</table>
2018-03-17 23:09:57 +00:00
</div>
2018-01-27 16:35:33 +00:00
</div>
</div>
</div>
2016-07-04 18:04:11 +00:00
{% endif %}
2018-01-27 16:35:33 +00:00
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#collapse3">
2018-01-27 20:58:31 +00:00
<h3 class="panel-title pull-left">
2018-03-17 22:53:03 +00:00
<i class="fa fa-desktop"></i>
2018-08-15 17:15:26 +00:00
{% trans "Machines" %}
2018-04-16 21:57:22 +00:00
<span class="badge">{{nb_machines}}</span>
2018-01-27 16:35:33 +00:00
</h3>
</div>
2018-03-29 21:43:43 +00:00
<div id="collapse3" class="panel-collapse collapse">
<div class="panel-body">
2018-08-15 17:15:26 +00:00
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
<i class="fa fa-desktop"></i>
{% trans "Add a machine" %}
2018-03-17 22:52:01 +00:00
</a>
</div>
2018-01-27 16:35:33 +00:00
<div class="panel-body">
{% if machines_list %}
{% include "machines/aff_machines.html" with machines_list=machines_list %}
{% else %}
2018-08-15 17:15:26 +00:00
<p>{% trans "No machine" %}</p>
2018-01-27 16:35:33 +00:00
{% endif %}
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#collapse4">
2018-01-27 20:58:31 +00:00
<h3 class="panel-title pull-left">
2018-03-17 22:53:03 +00:00
<i class="fa fa-euro-sign"></i>
2018-08-15 17:15:26 +00:00
{% trans "Subscriptions" %}
2018-01-27 16:35:33 +00:00
</h3>
2018-03-29 21:43:43 +00:00
</div>
<div id="collapse4" class="panel-collapse collapse">
<div class="panel-body">
{% can_create Facture %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}">
<i class="fa fa-euro-sign"></i>
2018-08-15 17:15:26 +00:00
{% trans "Add as subscription" %}
2018-01-27 20:58:31 +00:00
</a>
{% if user_solde %}
2018-03-29 21:43:43 +00:00
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:credit-solde' users.id %}">
<i class="fa fa-euro-sign"></i>
2018-08-15 17:15:26 +00:00
{% trans "Edit the balance" %}
2018-03-29 21:43:43 +00:00
</a>
2018-07-13 20:23:32 +00:00
{% endif%}
{% acl_end %}
2018-01-27 20:58:31 +00:00
</div>
2018-01-27 16:35:33 +00:00
<div class="panel-body">
{% if facture_list %}
{% include "cotisations/aff_cotisations.html" with facture_list=facture_list %}
{% else %}
2018-08-15 17:15:26 +00:00
<p>{% trans "No invoice" %}</p>
2018-01-27 16:35:33 +00:00
{% endif %}
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#collapse5">
2018-01-27 20:58:31 +00:00
<h3 class="panel-title pull-left">
2018-03-17 22:53:03 +00:00
<i class="fa fa-ban"></i>
2018-08-15 17:15:26 +00:00
{% trans "Bans" %}
2018-01-27 16:35:33 +00:00
</h3>
</div>
2018-03-29 21:43:43 +00:00
<div id="collapse5" class="panel-collapse collapse">
2018-08-15 17:15:26 +00:00
<div class="panel-body">
{% can_create Ban %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-ban' users.id %}">
<i class="fa fa-ban"></i>
{% trans "Add a ban" %}
2018-03-17 22:52:01 +00:00
</a>
2018-03-29 21:43:43 +00:00
{% acl_end %}
2018-01-27 20:58:31 +00:00
</div>
2018-01-27 16:35:33 +00:00
<div class="panel-body">
{% if ban_list %}
{% include "users/aff_bans.html" with ban_list=ban_list %}
{% else %}
2018-08-15 17:15:26 +00:00
<p>{% trans "No ban" %}</p>
2018-01-27 16:35:33 +00:00
{% endif %}
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#collapse6">
2018-01-27 20:58:31 +00:00
<h3 class="panel-title pull-left">
2018-03-17 22:53:03 +00:00
<i class="fa fa-check-circle"></i>
2018-08-15 17:15:26 +00:00
{% trans "Whitelists" %}
2018-01-27 16:35:33 +00:00
</h3>
2018-03-29 21:43:43 +00:00
</div>
<div id="collapse6" class="panel-collapse collapse">
<div class="panel-body">
2018-03-17 22:52:01 +00:00
{% can_create Whitelist %}
2018-08-15 17:15:26 +00:00
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-whitelist' users.id %}">
<i class="fa fa-check-circle"></i>
{% trans "Grant a whitelist" %}
</a>
2018-01-27 20:58:31 +00:00
{% acl_end %}
</div>
2018-01-27 16:35:33 +00:00
<div class="panel-body">
{% if white_list %}
{% include "users/aff_whitelists.html" with white_list=white_list %}
{% else %}
2018-08-15 17:15:26 +00:00
<p>{% trans "No whitelist" %}</p>
2018-01-27 16:35:33 +00:00
{% endif %}
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#collapse7">
<h3 class="panel-title pull-left">
2018-08-15 17:15:26 +00:00
<i class="fa fa-envelope"></i>{% trans " Email settings" %}
</h3>
</div>
<div id="collapse7" class="panel-collapse collapse">
<div class="panel-body">
2018-06-30 12:46:35 +00:00
{% can_edit users %}
2018-07-30 15:00:41 +00:00
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-email-settings' users.id %}">
2018-08-15 17:15:26 +00:00
<i class="fa fa-pencil-alt"></i>{% trans " Edit email settings" %}
2018-07-30 15:00:41 +00:00
</a>
{% acl_end %}
2018-07-30 15:00:41 +00:00
</div>
<div class="panel-body">
{% if local_email_accounts_enabled %}
<div class="table-responsive">
<table class="table">
<tr>
2018-08-15 17:15:26 +00:00
<th colspan="2">{% trans "Contact email address" %}</th>
<td colspan="2">{{ users.get_mail }}</td>
2018-07-30 15:00:41 +00:00
</tr>
<tr>
2018-08-15 17:15:26 +00:00
<th>{% trans "Enable the local email account" %}</th>
2018-07-30 15:00:41 +00:00
<td>{{ users.local_email_enabled | tick }}</td>
2018-08-15 17:15:26 +00:00
<th>{% trans "Enable the local email redirection" %}</th>
<td>{{ users.local_email_redirect | tick }}</td>
</tr>
</table>
2018-08-15 17:15:26 +00:00
<p>{% trans "The contact email address is the email address where we send emails to contact you. If you would like to use your external email address for that, you can either disable your local email address or enable the local email redirection." %}</p>
</div>
{% if users.local_email_enabled %}
2018-08-01 11:06:25 +00:00
{% can_create EMailAddress users.id %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-emailaddress' users.id %}">
2018-08-15 17:15:26 +00:00
<i class="fa fa-plus-square"></i>{% trans " Add an email address" %}
2018-07-30 15:00:41 +00:00
</a>
{% acl_end %}
2018-08-01 11:06:25 +00:00
{% if emailaddress_list %}
{% include "users/aff_emailaddress.html" with emailaddress_list=emailaddress_list %}
{% endif %}
2018-07-30 15:00:41 +00:00
{% endif %}
{% else %}
<div class="table-responsive">
<table class="table">
<tr>
2018-08-15 17:15:26 +00:00
<th>{% trans "Contact email address" %}</th>
<td>{{ users.get_mail }}</td>
2018-07-30 15:00:41 +00:00
</tr>
</table>
</div>
{% endif %}
</div>
</div>
</div>
2018-01-27 16:35:33 +00:00
</div>
2016-07-03 16:09:58 +00:00
{% endblock %}
2018-08-15 17:15:26 +00:00