From 45ce2eab9e5253e1c490ebd76d6f5cda3d973869 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 21 Feb 2020 11:53:37 +0100 Subject: [PATCH] Two colomn profile page --- apps/member/views.py | 6 +- locale/de/LC_MESSAGES/django.po | 33 ++++--- locale/fr/LC_MESSAGES/django.po | 37 +++++--- templates/member/profile_detail.html | 124 +++++++++++++++------------ 4 files changed, 117 insertions(+), 83 deletions(-) diff --git a/apps/member/views.py b/apps/member/views.py index fab68b01..3570f7b2 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -112,7 +112,7 @@ class UserUpdateView(LoginRequiredMixin, UpdateView): class UserDetailView(LoginRequiredMixin, DetailView): """ - Affiche les informations sur un utilisateur, sa note, ses clubs ... + Affiche les informations sur un utilisateur, sa note, ses clubs... """ model = Profile context_object_name = "profile" @@ -126,6 +126,10 @@ class UserDetailView(LoginRequiredMixin, DetailView): club_list = \ Membership.objects.all().filter(user=user).only("club") context['club_list'] = ClubTable(club_list) + context['title'] = _("Account #%(id)s: %(username)s") % { + 'id': user.pk, + 'username': user.username, + } return context diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 296375b2..2994b8b1 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-21 11:16+0100\n" +"POT-Creation-Date: 2020-02-21 11:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -90,7 +90,7 @@ msgstr "" msgid "phone number" msgstr "" -#: apps/member/models.py:29 templates/member/profile_detail.html:18 +#: apps/member/models.py:29 templates/member/profile_detail.html:23 msgid "section" msgstr "" @@ -98,7 +98,7 @@ msgstr "" msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\"" msgstr "" -#: apps/member/models.py:36 templates/member/profile_detail.html:20 +#: apps/member/models.py:36 templates/member/profile_detail.html:26 msgid "address" msgstr "" @@ -180,7 +180,7 @@ msgstr "" msgid "memberships" msgstr "" -#: apps/member/views.py:63 templates/member/profile_detail.html:29 +#: apps/member/views.py:63 templates/member/profile_detail.html:39 msgid "Update Profile" msgstr "" @@ -188,6 +188,11 @@ msgstr "" msgid "An alias with a similar name already exists." msgstr "" +#: apps/member/views.py:129 +#, python-format +msgid "Account #%(id)s: %(username)s" +msgstr "" + #: apps/note/admin.py:118 apps/note/models/transactions.py:86 msgid "source" msgstr "" @@ -285,7 +290,7 @@ msgstr "" msgid "alias" msgstr "" -#: apps/note/models/notes.py:199 +#: apps/note/models/notes.py:199 templates/member/profile_detail.html:32 msgid "aliases" msgstr "" @@ -381,7 +386,7 @@ msgstr "" msgid "Membership duration" msgstr "" -#: templates/member/club_detail.html:18 templates/member/profile_detail.html:22 +#: templates/member/club_detail.html:18 templates/member/profile_detail.html:29 msgid "balance" msgstr "" @@ -397,23 +402,27 @@ msgstr "" msgid "Regenerate token" msgstr "" -#: templates/member/profile_detail.html:12 +#: templates/member/profile_detail.html:10 msgid "first name" msgstr "" -#: templates/member/profile_detail.html:14 +#: templates/member/profile_detail.html:13 msgid "username" msgstr "" -#: templates/member/profile_detail.html:27 -msgid "Manage auth token" +#: templates/member/profile_detail.html:16 +msgid "password" msgstr "" -#: templates/member/profile_detail.html:30 +#: templates/member/profile_detail.html:19 msgid "Change password" msgstr "" -#: templates/member/profile_detail.html:38 +#: templates/member/profile_detail.html:37 +msgid "Manage auth token" +msgstr "" + +#: templates/member/profile_detail.html:49 msgid "View my memberships" msgstr "" diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index b78eb5fd..927349ce 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-21 11:16+0100\n" +"POT-Creation-Date: 2020-02-21 11:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -85,7 +85,7 @@ msgstr "adhérent" msgid "phone number" msgstr "numéro de téléphone" -#: apps/member/models.py:29 templates/member/profile_detail.html:18 +#: apps/member/models.py:29 templates/member/profile_detail.html:23 msgid "section" msgstr "section" @@ -93,7 +93,7 @@ msgstr "section" msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\"" msgstr "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\"" -#: apps/member/models.py:36 templates/member/profile_detail.html:20 +#: apps/member/models.py:36 templates/member/profile_detail.html:26 msgid "address" msgstr "adresse" @@ -179,7 +179,7 @@ msgstr "adhésion" msgid "memberships" msgstr "adhésions" -#: apps/member/views.py:63 templates/member/profile_detail.html:29 +#: apps/member/views.py:63 templates/member/profile_detail.html:39 msgid "Update Profile" msgstr "Modifier le profil" @@ -187,6 +187,11 @@ msgstr "Modifier le profil" msgid "An alias with a similar name already exists." msgstr "Un alias avec un nom similaire existe déjà." +#: apps/member/views.py:129 +#, python-format +msgid "Account #%(id)s: %(username)s" +msgstr "Compte n°%(id)s : %(username)s" + #: apps/note/admin.py:118 apps/note/models/transactions.py:86 msgid "source" msgstr "source" @@ -285,7 +290,7 @@ msgstr "Alias invalide" msgid "alias" msgstr "alias" -#: apps/note/models/notes.py:199 +#: apps/note/models/notes.py:199 templates/member/profile_detail.html:32 msgid "aliases" msgstr "alias" @@ -381,7 +386,7 @@ msgstr "L'adhésion finie le" msgid "Membership duration" msgstr "Durée de l'adhésion" -#: templates/member/club_detail.html:18 templates/member/profile_detail.html:22 +#: templates/member/club_detail.html:18 templates/member/profile_detail.html:29 msgid "balance" msgstr "solde du compte" @@ -397,23 +402,29 @@ msgstr "Créé le" msgid "Regenerate token" msgstr "Regénérer le jeton" -#: templates/member/profile_detail.html:12 +#: templates/member/profile_detail.html:10 msgid "first name" msgstr "" -#: templates/member/profile_detail.html:14 +#: templates/member/profile_detail.html:13 msgid "username" msgstr "nom d'utilisateur" -#: templates/member/profile_detail.html:27 -msgid "Manage auth token" -msgstr "Gérer les jetons d'authentification" +#: templates/member/profile_detail.html:16 +#, fuzzy +#| msgid "Change password" +msgid "password" +msgstr "Changer le mot de passe" -#: templates/member/profile_detail.html:30 +#: templates/member/profile_detail.html:19 msgid "Change password" msgstr "Changer le mot de passe" -#: templates/member/profile_detail.html:38 +#: templates/member/profile_detail.html:37 +msgid "Manage auth token" +msgstr "Gérer les jetons d'authentification" + +#: templates/member/profile_detail.html:49 msgid "View my memberships" msgstr "Voir mes adhésions" diff --git a/templates/member/profile_detail.html b/templates/member/profile_detail.html index dbf7075b..1b233af1 100644 --- a/templates/member/profile_detail.html +++ b/templates/member/profile_detail.html @@ -2,67 +2,77 @@ {% load i18n static pretty_money django_tables2 %} {% block content %} -

Compte n° {{ object.pk }}

+
+
+ - +
+
{% trans 'name'|capfirst %}, {% trans 'first name' %}
+
{{ object.user.last_name }} {{ object.user.first_name }}
-
-
{% trans 'name'|capfirst %}
-
{{ object.user.last_name }}
-
{% trans 'first name'|capfirst %}
-
{{ object.user.first_name }}
-
{% trans 'username'|capfirst %}
-
{{ object.user.username }}
-
Aliases
-
{{ object.user.note.alias_set.all }}
-
{% trans 'section'|capfirst %}
-
{{ object.section }}
-
{% trans 'address'|capfirst %}
-
{{ object.address }}
-
{% trans 'balance'|capfirst %}
-
{{ object.user.note.balance | pretty_money }}
-
-
- {% if object.user.pk == user.pk %} - {% trans 'Manage auth token' %} - {% endif %} - {% trans 'Update Profile' %} - {% trans 'Change password' %} -
+
{% trans 'username'|capfirst %}
+
{{ object.user.username }}
-
-
-
-
- -
+
{% trans 'password'|capfirst %}
+
+ + {% trans 'Change password' %} + +
+ +
{% trans 'section'|capfirst %}
+
{{ object.section }}
+ +
{% trans 'address'|capfirst %}
+
{{ object.address }}
+ +
{% trans 'balance'|capfirst %}
+
{{ object.user.note.balance | pretty_money }}
+ +
{% trans 'aliases'|capfirst %}
+
{{ object.user.note.alias_set.all|join:", " }}
+
+

+ {% if object.user.pk == user.pk %} + {% trans 'Manage auth token' %} + {% endif %} + {% trans 'Update Profile' %} +

-
-
- {% render_table club_list %} -
+
+
+
+
+
+ +
+
+ +
+
+ {% render_table club_list %} +
+
+
+ +
+
+
+ +
+
+
+
+ {% render_table history_list %} +
+
+
+
-
-
-
-
- -
-
-
-
- {% render_table history_list %} -
-
-
- - - - - {% endblock %} +{% endblock %}