Commit 054067b9 authored by hypsug0's avatar hypsug0
Browse files

feat: improve uer profile pages

parent 1730276d
......@@ -216,7 +216,7 @@ class UserDetail(LoginRequiredMixin, DetailView):
class MyProfileDetail(LoginRequiredMixin, DetailView):
model = get_user_model()
template_name = "accounts/profile.html"
template_name = "accounts/my_profile.html"
def get_object(self):
logger.info(self.request.user.id)
......
{% extends 'base.html' %} {% load i18n %} {% block title %}Mon profile ({{ object.username }}){%endblock %}
{% block content %}
<h1>
<i class="fi-torsos-female-male"></i>
{% trans "Mes données" %}
</h1>
<p class="text-muted">Compte créé le {{object.timestamp_create}}{% if object.timestamp_update %}, mis à jour le {{object.timestamp_update}}.{% endif %}
<div class="panel panel-group panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<span class="pull-right">
<a
class="text-info"
href="{% url 'accounts:myprofile_update' %}"
data-toggle="tooltip" data-placement="bottom"
title="{% trans 'Modifier mon profile' %}"
><i class="fa fa-fw fa-user-edit"></i
></a>
<a
class="text-warning"
href="{% url 'accounts:change_password' %}"
data-toggle="tooltip"
title="{% trans 'Modifier mon mot de passe' %}"
><i class="fa fa-fw fa-lock"></i>
</a>
<a
class="text-info"
href="{% url 'accounts:myprofile_detail_export' %}"
data-toggle="tooltip"
title="{% trans 'Exporter mes données personnelles' %}"
><i class="fa fa-fw fa-download"></i>
</a>
</span>
<i class="fa fa-fw fa-id-card"></i> {% trans 'Identité' %}
</h4>
</div>
<div class="panel-body">
<h3>Informations principales</h1>
<dl class="dl-horizontal">
<dt>Nom d'utilisateur</dt>
<dd>{{ object.username }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Nom complet</dt>
<dd>{{ object.first_name }} {{ object.last_name }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Email</dt>
<dd>{{ object.email }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Organisme</dt>
<dd>{{ object.organism|default:'?' }}</dd>
</dl>
<h3>Coordonnées</h3>
<dl class="dl-horizontal">
<dt>Téléphone fixe</dt>
<dd>{{ object.home_phone|default:'?' }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Téléphone mobile</dt>
<dd>{{ object.mobile_phone|default:'?' }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Adresse</dt>
<dd>
{% if object.addr_apt or object.addr_building %}{{ object.addr_appt }} {{ object.addr_building }}<br>{% endif %}
{{ object.addr_street|default:'?' }}<br>
{{ object.addr_city_code|default:'?'}} {{ object.addr_city|default:'?'}}<br>
{{ object.addr_country|default:'?'}}
</dd>
</dl>
</div>
</div>
<div class="panel panel-group panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<i class="fa fa-fw fa-id-card"></i> {% trans 'Mes observations' %}
</h4>
</div>
<div class="panel-body">
<div class="col-xs-12 col-md-4">
<a
class="btn btn-block btn-primary btn-lg"
href="{% url 'sights:place_mylist' %}"
><i class="fa fa-fw fa-map-marker-alt"></i>
{% trans 'Mes localités' %}</a>
</div>
<div class="col-xs-12 col-md-4">
<a
class="btn btn-block btn-primary btn-lg"
href="{% url 'sights:session_mylist' %}"
><i class="fa fa-fw fa-calendar-alt"></i>
{% trans 'Mes sessions' %}</a>
</div>
<div class="col-xs-12 col-md-4">
<a
class="btn btn-block btn-primary btn-lg"
href="{% url 'sights:sighting_mylist' %}"
><i class="fa fa-fw fa-eye"></i>
{% trans 'Mes observations' %}</a>
</div>
</div>
</div>
{% if object.is_superuser or object.is_resp or object.edit_all_data or object.access_all_data %}
<div class="panel panel-group panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<i class="fa fa-fw fa-unlock"></i> {% trans 'Droits sur la base' %}
</h4>
</div>
<div class="panel-body">
<b>Super-utilisateur</b> : {{ object.is_superuser|yesno:'Oui,Non,-' }}<br />
<b>Responsable de territoire</b> : {% if object.is_resp %}Oui ( {% for territory in object.resp_territory.all %} {{ territory.name }}{% endfor %}){% else %}Non{% endif %}<br />
<b>Accès à toutes les données</b>: {{ object.is_superuser|yesno:'Oui,Non,-'}}<br />
<b>Edition de toutes les données</b>: {{ object.edit_all_data|yesno:'Oui,Non,-'}}<br />
</div>
</div>
{% endif %}
{% endblock %}
{% extends 'base.html' %}
{% load i18n %}
{% block title %}Mon profile{% endblock %}
{% extends 'base.html' %} {% load i18n %} {% block title %}Profile de {{ object.username }}{%endblock %}
{% block content %}
<h1><i class="fi-torsos-female-male"></i> {% trans "Informations de l\'utilisateur" %} {{ object.username }}</h1>
<div class="panel panel-group panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<span class="pull-right">
<a class="text-info" href="{% url 'accounts:myprofile_update' %}" title="{% trans 'Modifier mon profile' %}"><i class="fa fa-fw fa-user-edit"></i></a>
<a class="text-warning" href="{% url 'accounts:change_password' %}" title="{% trans 'Modifier mon mot de passe' %}"><i class="fa fa-fw fa-lock"></i>
</a>
</span>
<h1>
<i class="fi-torsos-female-male"></i>
{% trans "Mes données" %}
</h1>
<p> <span class="text-muted">Compte créé le</span> {{object.timestamp_create}}
{% if object.timestamp_update %}
<span class="text-muted">, mis à jour le </span>{{object.timestamp_update}}<span class="text-muted">.</span>
{% endif %}
<span class="text-muted"> Dernière connexion le </span>{{object.last_login|default:"Jamais"}}<span class="text-muted">.</span></p>
<div class="panel panel-group panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<i class="fa fa-fw fa-id-card"></i> {% trans 'Identité' %}
</h4>
</div>
<div class="panel-body">
<b>Nom d'utilisateur</b> : {{ object.username }}<br/>
<b>Nom complet</b>: {{ object.first_name }} {{ object.last_name }}<br/>
<b>email</b>: {{ object.email }}<br/>
</div>
</h4>
</div>
{% if object.is_superuser or object.is_resp or object.edit_all_data or object.access_all_data %}
<div class="panel panel-group panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-fw fa-unlock"></i> {% trans 'Droits sur la base' %}</h4>
</div>
<div class="panel-body">
<b>Superutilisateur</b> : {% if object.is_superuser %}Oui{% else %}Non{% endif %}<br/>
<b>Responsable de territoire</b> : {% if object.is_resp %}Oui (
{% for territory in object.resp_territory.all %}
{{ territory.name }}{% endfor %}){% else %}Non{% endif %}<br/>
<b>Accès à toutes les données</b>: {% if object.access_all_data %}Oui{% else %}Non{% endif %}<br/>
<b>Edition de toutes les données</b>: {% if object.edit_all_data %}Oui{% else %}Non{% endif %}<br/>
</div>
</div>
{% endif %}
<div class="panel-body">
<h3>Informations principales</h1>
<dl class="dl-horizontal">
<dt>Nom d'utilisateur</dt>
<dd>{{ object.username }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Nom complet</dt>
<dd>{{ object.first_name }} {{ object.last_name }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Email</dt>
<dd>{{ object.email }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Organisme</dt>
<dd>{{ object.organism|default:'?' }}</dd>
</dl>
<h3>Coordonnées</h3>
<dl class="dl-horizontal">
<dt>Téléphone fixe</dt>
<dd>{{ object.home_phone|default:'?' }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Téléphone mobile</dt>
<dd>{{ object.mobile_phone|default:'?' }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Adresse</dt>
<dd>
{% if object.addr_apt or object.addr_building %}{{ object.addr_appt }} {{ object.addr_building }}<br>{% endif %}
{{ object.addr_street|default:'?' }}<br>
{{ object.addr_city_code|default:'?'}} {{ object.addr_city|default:'?'}}<br>
{{ object.addr_country|default:'?'}}
</dd>
</dl>
<div class="panel panel-group panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-fw fa-id-card"></i> {% trans 'Mes observations' %}</h4>
</div>
</div>
<div class="panel panel-group panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<i class="fa fa-fw fa-id-card"></i> {% trans 'Gestion' %}
</h4>
</div>
<div class="panel-body">
<div class="col-xs-12 col-md-4">
<a
class="btn btn-block btn-primary btn-lg"
href="{% url 'accounts:user_update' pk=object.pk %}"
><i class="fa fa-fw fa-edit-alt"></i>
{% trans 'Modifier' %}</a>
</div>
<div class="col-xs-12 col-md-4">
<a
class="btn btn-block btn-warning btn-lg"
href="{% url 'accounts:user_password' pk=object.pk %}"
><i class="fa fa-fw fa-lock"></i>
{% trans 'Changer le mot de passe' %}</a>
</div>
<div class="panel-body">
<div class="col-xs-12 col-md-4">
<a class="btn btn-block btn-info" href="{% url 'sights:place_mylist' %}"><i class="fa fa-fw fa-map-marker-alt"></i>
{% trans 'Mes localités' %}</a></div>
<div class="col-xs-12 col-md-4"><a class="btn btn-block btn-info" href="{% url 'sights:session_mylist' %}"><i class="fa fa-fw fa-calendar-alt"></i>
{% trans 'Mes sessions' %}</a></div>
<div class="col-xs-12 col-md-4"><a class="btn btn-block btn-info" href="{% url 'sights:sighting_mylist' %}"><i class="fa fa-fw fa-eye"></i>
{% trans 'Mes observations' %}</a></div>
<div class="col-xs-12 col-md-4">
<a
class="btn btn-block btn-danger btn-lg"
href="{% url 'accounts:user_delete' pk=object.pk %}"
><i class="fa fa-fw fa-trash"></i>
{% trans 'Supprimer' %}</a>
</div>
</div>
{% endblock %}
</div>
<div class="panel panel-group panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<i class="fa fa-fw fa-unlock"></i> {% trans 'Droits sur la base' %}
</h4>
</div>
<div class="panel-body">
<b>Super-utilisateur</b> : {{ object.is_superuser|yesno:'Oui,Non,-' }}<br />
<b>Responsable de territoire</b> : {% if object.is_resp %}Oui ( {% for territory in object.resp_territory.all %} {{ territory.name }}{% endfor %}){% else %}Non{% endif %}<br />
<b>Accès à toutes les données</b>: {{ object.is_superuser|yesno:'Oui,Non,-'}}<br />
<b>Edition de toutes les données</b>: {{ object.edit_all_data|yesno:'Oui,Non,-'}}<br />
</div>
</div>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment