From 1ffa65b3a42717dad484fb7117a93be80a70f041 Mon Sep 17 00:00:00 2001 From: Julien Constant Date: Fri, 3 Mar 2023 12:24:38 +0100 Subject: [PATCH] Import of #576 --- .../0019_preferences_receive_weekmail.py | 2 +- core/models.py | 4 +- core/static/core/override.scss | 7 + core/static/core/user_details.scss | 140 ++++++++++ core/static/core/user_edit.scss | 171 ++++++++++++ core/static/core/user_groups.scss | 13 + core/static/core/user_preferences.scss | 41 +++ core/static/core/user_stats.scss | 40 +++ core/templates/core/base.jinja | 27 +- core/templates/core/user_detail.jinja | 209 ++++++++------- core/templates/core/user_edit.jinja | 252 ++++++++++++------ core/templates/core/user_group.jinja | 23 +- core/templates/core/user_preferences.jinja | 63 +++-- core/templates/core/user_stats.jinja | 67 +++-- core/templates/core/user_tools.jinja | 52 ++-- locale/fr/LC_MESSAGES/django.po | 12 +- 16 files changed, 841 insertions(+), 282 deletions(-) create mode 100644 core/static/core/override.scss create mode 100644 core/static/core/user_details.scss create mode 100644 core/static/core/user_edit.scss create mode 100644 core/static/core/user_groups.scss create mode 100644 core/static/core/user_preferences.scss create mode 100644 core/static/core/user_stats.scss diff --git a/core/migrations/0019_preferences_receive_weekmail.py b/core/migrations/0019_preferences_receive_weekmail.py index 951488aa..5bfe0d97 100644 --- a/core/migrations/0019_preferences_receive_weekmail.py +++ b/core/migrations/0019_preferences_receive_weekmail.py @@ -13,7 +13,7 @@ class Migration(migrations.Migration): model_name="preferences", name="receive_weekmail", field=models.BooleanField( - default=False, verbose_name="do you want to receive the weekmail" + default=False, verbose_name="receive the weekmail" ), ) ] diff --git a/core/models.py b/core/models.py index e904603f..d994fff2 100644 --- a/core/models.py +++ b/core/models.py @@ -271,7 +271,7 @@ class User(AbstractBaseUser): _("dpt option"), max_length=32, blank=True, default="" ) semester = models.CharField(_("semester"), max_length=5, blank=True, default="") - quote = models.CharField(_("quote"), max_length=256, blank=True, default="") + quote = models.TextField(_("quote"), max_length=256, blank=True, default="") school = models.CharField(_("school"), max_length=80, blank=True, default="") promo = models.IntegerField( _("promo"), validators=[validate_promo], null=True, blank=True @@ -784,7 +784,7 @@ class Preferences(models.Model): User, related_name="_preferences", on_delete=models.CASCADE ) receive_weekmail = models.BooleanField( - _("do you want to receive the weekmail"), default=False + _("Receive the Weekmail"), default=False ) show_my_stats = models.BooleanField(_("show your stats to others"), default=False) notify_on_click = models.BooleanField( diff --git a/core/static/core/override.scss b/core/static/core/override.scss new file mode 100644 index 00000000..893dd4fd --- /dev/null +++ b/core/static/core/override.scss @@ -0,0 +1,7 @@ +content { + padding: 20px !important; +} + +h1, h2, h3, h4, h5, h6 { + margin: 0.5em 0; +} \ No newline at end of file diff --git a/core/static/core/user_details.scss b/core/static/core/user_details.scss new file mode 100644 index 00000000..1c7b663a --- /dev/null +++ b/core/static/core/user_details.scss @@ -0,0 +1,140 @@ +.main { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; +} + +.user-name { + display: flex; + flex-direction: column; + align-items: flex-start; + width: 100%; + max-width: 1080px; +} + +.infos-and-picture { + display: flex; + flex-direction: row; + justify-content: center; + width: 100%; + max-width: 1080px; + + @media (max-width: 960px) { + flex-direction: column-reverse; + gap: 20px; + } + + >#user_profile_infos { + width: 50%; + + @media (max-width: 960px) { + width: 100%; + } + + @media (min-width: 960px) { + padding-right: 20px; + } + + >#user_profile_infos_promo { + display: flex; + flex-direction: row; + gap: 10px; + align-items: center; + justify-content: center; + width: 100%; + } + + >#user_profile_infos_quote { + @media (max-width: 960px) { + text-align: center !important; + } + } + } + + >#user_profile_pictures { + width: 50%; + display: flex; + flex-direction: row; + + @media (max-width: 960px) { + width: 100%; + height: 100% !important; + flex-direction: column; + } + + @media (min-width: 960px) { + padding-left: 20px; + } + + >#user_profile_pictures_bigone { + @media (max-width: 960px) { + >img { + max-width: 300px !important; + width: 100% !important; + object-fit: contain; + } + } + } + + >#user_profile_pictures_thumbnails { + padding: 20px; + display: flex; + flex-direction: column; + gap: 20px; + + @media (max-width: 960px) { + flex-direction: row !important; + height: 50%; + } + + >img { + max-height: calc(100% / 3); + width: 100% !important; + object-fit: contain; + + @media (max-width: 960px) { + max-height: 100%; + max-width: calc(100% / 3) !important; + height: auto; + } + } + } + } +} + +#user_profile_page #user_profile #user_profile_infos { + @media (max-width: 960px) { + border-right-color: transparent; + } +} + +#user_profile_page #user_profile #user_profile_pictures #user_profile_pictures_thumbnails, +#user_profile_page #user_profile #user_profile_infos, +#user_profile_page #user_profile #user_profile_pictures { + flex-basis: unset !important; +} + +.form-gifts { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + gap: 10px; + + @media (max-width: 960px) { + flex-direction: column; + } + + >select, + >input { + min-width: 300px; + max-width: 100%; + height: 40px; + + @media (max-width: 960px) { + width: 100%; + } + } +} \ No newline at end of file diff --git a/core/static/core/user_edit.scss b/core/static/core/user_edit.scss new file mode 100644 index 00000000..23751e4b --- /dev/null +++ b/core/static/core/user_edit.scss @@ -0,0 +1,171 @@ +.profile { + &-visible { + display: flex; + justify-content: center; + align-items: center; + gap: 5px; + + >input[type="checkbox"] { + cursor: pointer; + } + } + + &-pictures { + box-sizing: border-box; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-around; + align-items: stretch; + + @media (max-width: 750px) { + flex-direction: column; + gap: 20px; + } + } + + &-picture { + box-sizing: border-box; + display: flex; + justify-content: space-between; + flex-direction: column; + align-items: center; + flex-wrap: wrap; + gap: 20px; + width: 100%; + height: 100%; + max-width: 300px; + + @media (max-width: 750px) { + max-width: 100%; + } + + &-display { + display: flex; + flex-direction: column; + justify-content: center; + height: 300px; + gap: 10px; + + @media (max-width: 750px) { + height: auto; + } + + >img { + width: 100% !important; + object-fit: contain; + height: auto; + } + + >p { + text-align: left !important; + width: 100% !important; + } + } + + &-edit { + display: flex; + flex-direction: column-reverse; + align-items: flex-start; + justify-content: center; + width: 100%; + + >input { + font-size: .8em; + font-weight: normal; + cursor: pointer; + } + + >p { + margin-bottom: 0; + text-align: left !important; + min-height: 50px; + } + } + } + + &-fields { + padding: 20px 0; + display: flex; + flex-direction: row; + flex-wrap: wrap; + gap: 10px; + justify-content: center; + + @media (max-width: 750px) { + gap: 20px; + } + } + + &-field { + display: flex; + flex-direction: row; + align-items: center; + flex-wrap: wrap; + justify-content: center; + gap: 10px; + width: 100%; + max-width: 330px; + min-width: 300px; + + @media (max-width: 750px) { + gap: 4px; + max-width: 100%; + } + + >* { + width: 100%; + max-width: 300px; + + @media (max-width: 750px) { + max-width: 100%; + } + } + + &-label { + text-align: left !important; + } + + &-content { + + >* { + box-sizing: border-box; + text-align: left !important; + line-height: 40px; + max-width: 100%; + width: 100%; + height: 40px; + margin: 0; + + >* { + text-align: left !important; + } + } + + + >textarea { + height: 120px; + min-height: 40px; + min-width: 300px; + max-width: 300px; + line-height: initial; + + @media (max-width: 750px) { + max-width: 100%; + } + } + + >input[type="file"] { + font-size: small; + line-height: 30px; + } + + >input[type="checkbox"] { + width: 20px; + height: 20px; + margin: 0; + float: left; + } + } + } +} \ No newline at end of file diff --git a/core/static/core/user_groups.scss b/core/static/core/user_groups.scss new file mode 100644 index 00000000..88cfd7b2 --- /dev/null +++ b/core/static/core/user_groups.scss @@ -0,0 +1,13 @@ +#id_groups { + margin: 0; + + >li { + list-style-type: none; + margin: 0; + padding-left: 30px; + + >label { + cursor: pointer; + } + } +} \ No newline at end of file diff --git a/core/static/core/user_preferences.scss b/core/static/core/user_preferences.scss new file mode 100644 index 00000000..bf481d17 --- /dev/null +++ b/core/static/core/user_preferences.scss @@ -0,0 +1,41 @@ +.form { + display: flex; + flex-direction: column; + gap: 2px; + + &-general { + >p { + display: flex; + flex-direction: row-reverse; + justify-content: left; + gap: 5px; + align-items: flex-start; + margin: 0; + + >label { + cursor: pointer + } + } + } + + &-cards, + &-trombi { + >p { + display: flex; + flex-direction: column; + align-items: flex-start; + text-align: justify; + gap: 5px; + + >input, + >select { + min-width: 300px; + } + } + } + + &-submit-btn { + margin-top: 10px !important; + max-width: 100px; + } +} \ No newline at end of file diff --git a/core/static/core/user_stats.scss b/core/static/core/user_stats.scss new file mode 100644 index 00000000..362c5153 --- /dev/null +++ b/core/static/core/user_stats.scss @@ -0,0 +1,40 @@ +.row { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: flex-start; + align-items: center; + margin-bottom: 10px; + gap: 30px; + + @media (max-width: 535px) { + + >div, + >div>.flexed { + width: 100%; + align-items: stretch; + } + } +} + + +.flexed { + display: flex; + flex-direction: column; + gap: 2px; + align-items: self-start; + + >div { + display: flex; + justify-content: space-between; + + >b, + >span { + width: 120px; + + &:last-child { + text-align: right; + } + } + } +} \ No newline at end of file diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index e343f2a1..b3b35841 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -40,7 +40,7 @@
{% csrf_token %} - +
{% endfor %} @@ -218,7 +218,7 @@ @@ -232,20 +232,15 @@
- {% if list_of_tabs %} -
-
{{ tabs_title }}
-
- {% for t in list_of_tabs -%} - {{ t.name }} - {%- endfor %} -
-
- {% endif %} + {% if list_of_tabs %} +
+
+ {% for t in list_of_tabs -%} + {{ t.name }} + {%- endfor %} +
+
+ {% endif %} {% if error %} {{ error }} diff --git a/core/templates/core/user_detail.jinja b/core/templates/core/user_detail.jinja index b2e834e9..d7f6a552 100644 --- a/core/templates/core/user_detail.jinja +++ b/core/templates/core/user_detail.jinja @@ -7,118 +7,123 @@ {% block content %}
-
+
-
-

{{ profile.get_full_name() }}

- {% if profile.nick_name %} -
« {{ profile.nick_name }} »
- {% endif %} +
+

{{ profile.get_full_name() }}

+ {% if profile.nick_name %} +
« {{ profile.nick_name }} »
+ {% endif %} +
- +
+
+ {% if profile.quote %} +
+ {{ profile.quote }} +
+ {% endif %} - {% if profile.quote %} -
- {{ profile.quote }} +
+ {% if profile.pronouns %} +
+ + +
+ {% endif %} + {% if profile.date_of_birth %} +
+ + +
+ {% endif %} + + {% if profile.department != "NA" %} +
+ + +
+ {% endif %} + + {% if profile.dpt_option %} +
+ + +
+ {% endif %} + + {% if profile.phone %} +
+ + +
+ {% endif %} + + {% if profile.address %} +
+ + +
+ {% endif %} + + {% if profile.parent_address %} +
+ + +
+ {% endif %}
- {% endif %} -
- {% if profile.pronouns %} -
- - -
- {% endif %} - {% if profile.date_of_birth %} -
- - -
- {% endif %} - - {% if profile.department != "NA" %} -
- - -
- {% endif %} - - {% if profile.dpt_option %} -
- - -
- {% endif %} - - {% if profile.phone %} -
- - -
- {% endif %} - - {% if profile.address %} -
- - -
- {% endif %} - - {% if profile.parent_address %} -
- - -
- {% endif %} -
- - {% if profile.promo %} -
+ {% if profile.promo %} +
+ {% trans %}Promo: {% endtrans %}{{ profile.promo }} + Promo {{ profile.promo }} Promo {{ profile.promo }} {% trans %}Promo: {% endtrans %}{{ profile.promo }} -
- {% endif %} -
- -
-
- {% if profile.profile_pict %} - {% trans %}Profile{% endtrans %} - {% else %} - {% trans %}Profile{% endtrans %} + Promo {{ profile.promo }} + {% trans %}Promo: {% endtrans %}{{ profile.promo }} +
{% endif %}
-
- {% if profile.profile_pict %} - {% trans %}Profile{% endtrans %} - {% else %} - {% trans %}Profile{% endtrans %} - {% endif %} + +
+
+ {% if profile.profile_pict %} + {% trans %}Profile{% endtrans %} + {% else %} + {% trans %}Profile{% endtrans %} + {% endif %} +
+
+ {% if profile.profile_pict %} + {% trans %}Profile{% endtrans %} + {% else %} + {% trans %}Profile{% endtrans %} + {% endif %} - {% if profile.avatar_pict %} - {% trans %}Avatar{% endtrans %} - {% else %} - {% trans %}Avatar{% endtrans %} - {% endif %} + {% if profile.avatar_pict %} + {% trans %}Avatar{% endtrans %} + {% else %} + {% trans %}Avatar{% endtrans %} + {% endif %} - {% if profile.scrub_pict %} - {% trans %}Scrub{% endtrans %} - {% else %} - {% trans %}Scrub{% endtrans %} - {% endif %} + {% if profile.scrub_pict %} + {% trans %}Scrub{% endtrans %} + {% else %} + {% trans %}Scrub{% endtrans %} + {% endif %} +
- {% if user.memberships.filter(end_date=None).exists() or user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) or user == profile or user.is_in_group(settings.SITH_BAR_MANAGER_BOARD_GROUP) %} {# if the user is member of a club, he can view the subscription state #}
@@ -168,9 +173,9 @@ {% endif %} {% if user.is_root or user.is_board_member %} +
-
-
+ {% csrf_token %} {{ gift_form.label }} {{ gift_form.user }} @@ -189,7 +194,7 @@
{% else %} - {% trans %}No gift given yet{% endtrans %} + {% trans %}No gift given yet{% endtrans %} {% endif %}
{% endif %} @@ -237,4 +242,4 @@ $(function(){ }); }); -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/core/templates/core/user_edit.jinja b/core/templates/core/user_edit.jinja index 5bd692e9..e4e0bae5 100644 --- a/core/templates/core/user_edit.jinja +++ b/core/templates/core/user_edit.jinja @@ -1,86 +1,184 @@ -{% extends "core/base.jinja" %} +{%- extends "core/base.jinja" -%} -{% block title %} -{% trans %}Edit user{% endtrans %} -{% endblock %} +{%- block title -%} +{%- trans -%}Edit user{%- endtrans -%} +{%- endblock -%} -{% block content %} -

{% trans %}Edit user profile{% endtrans %}

+{%- block additional_css -%} + + +{%- endblock -%} + +{%- block content -%} +

{%- trans -%}Edit user profile{%- endtrans -%}

- {% csrf_token %} + + {%- csrf_token -%} {{ form.non_field_errors() }} - {% for field in form %} -

{{ field.errors }}

-
- {% trans %}Take picture{% endtrans %} + + {# User Pictures #} +
+ {#

{%- trans -%}Current profile: {%- endtrans -%}

#} +
+
+ + {%- if form.instance.profile_pict -%} + {%- trans -%}Profile{%- endtrans -%} + {%- else -%} + {%- trans -%}Profile{%- endtrans -%} + {%- endif -%} +
+
+

{{ form["profile_pict"].label }}

+ {{ form["profile_pict"] }} + {%- if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) -%} + {%- trans + -%}Delete{%- endtrans -%} + {%- endif -%} +
+
+
+
+ {%- if form.instance.avatar_pict -%} + {%- trans -%}Profile{%- endtrans -%} + {%- else -%} + {%- trans -%}Profile{%- endtrans -%} + {%- endif -%} +
+
+

{{ form["avatar_pict"].label }}

+ {{ form["avatar_pict"] }} + {%- if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) -%} + {%- trans + -%}Delete{%- endtrans -%} + {%- endif -%} +
+
+
+
+ {%- if form.instance.scrub_pict -%} + {%- trans -%}Profile{%- endtrans -%} + {%- else -%} + {%- trans -%}Profile{%- endtrans -%} + {%- endif -%} +
+
+

{{ form["scrub_pict"].label }}

+ {{ form["scrub_pict"] }} + {%- if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) -%} + {%- trans + -%}Delete{%- + endtrans -%} + {%- endif -%} +
+
-

- {% endif %}
- {%- elif field.name == "avatar_pict" and form.instance.avatar_pict -%} -
{% trans %}Current avatar: {% endtrans %} -
- {%- elif field.name == "scrub_pict" and form.instance.scrub_pict -%} -
{% trans %}Current scrub: {% endtrans %} -
- {%- endif %} {{ field }}

- {% endfor %} -

-

{% trans %}Username: {% endtrans %}{{ form.instance.username }}

- {% if form.instance.customer %} -

{% trans %}Account number: {% endtrans %}{{ form.instance.customer.account_id }}

- {% endif %} - {% if form.instance == user %} -

{% trans %}Change my password{% endtrans %}

- {% elif user.is_root %} -

{% trans %}Change user password{% endtrans %}

- {% endif %} + + + {# All fields #} +
+ {%- for field in form -%} + {%- + if field.name in ["quote","profile_pict","avatar_pict","scrub_pict","is_subscriber_viewable","forum_signature"] + -%} + {%- continue -%} + {%- endif -%} + +
+
{{ field.label }}
+
+ {{ field }} + {%- if field.errors -%} +
{{ field.errors }}
+ {%- endif -%} +
+
+ {%- endfor -%} +
+ + {# Textareas #} +
+ {%- for field in [form["quote"], form["forum_signature"]] -%} +
+
{{ field.label }}
+
+ {{ field }} + {%- if field.errors -%} +
{{ field.errors }}
+ {%- endif -%} +
+
+ {%- endfor -%} +
+ + {# Checkboxes #} +
+ {{ form["is_subscriber_viewable"] }} + {{ form["is_subscriber_viewable"].label }} +
+ + {%- if form.instance == user -%} +

+ {%- trans -%}Change my password{%- endtrans -%} +

+ {%- elif user.is_root -%} +

+ {%- trans -%}Change user password{%- + endtrans -%} +

+ {%- endif -%} + +

+ +

-{% endblock %} - -{% block script %} - {{ super() }} - {% if not form.instance.profile_pict %} - - - {% endif %} -{% endblock %} +

+ {%- trans -%}Username: {%- endtrans -%} {{ form.instance.username }} +
+ {%- if form.instance.customer -%} + {%- trans -%}Account number: {%- endtrans -%} {{ form.instance.customer.account_id }} + {%- endif -%} +

+{%- endblock -%} +{%- block script -%} +{{ super() }} +{%- if not form.instance.profile_pict -%} + + +{%- endif -%} +{%- endblock -%} \ No newline at end of file diff --git a/core/templates/core/user_group.jinja b/core/templates/core/user_group.jinja index b062cafb..80f5a51c 100644 --- a/core/templates/core/user_group.jinja +++ b/core/templates/core/user_group.jinja @@ -1,14 +1,21 @@ {% extends "core/base.jinja" %} +{%- block additional_css -%} + + +{%- endblock -%} + {% block content %}

{% trans user_name=profile.get_full_name() %}Edit user groups for {{ user_name }}{% endtrans %}

- {% csrf_token %} - {{ form.as_p() }} -

+
+

{% trans user_name=profile.get_full_name() %}Edit user groups for {{ user_name }}{% endtrans %}

+ + {% csrf_token %} + {{ form.as_p() }} +

+ + -{% endblock %} - - - - +
+{%- endblock -%} \ No newline at end of file diff --git a/core/templates/core/user_preferences.jinja b/core/templates/core/user_preferences.jinja index 97416f47..a2825422 100644 --- a/core/templates/core/user_preferences.jinja +++ b/core/templates/core/user_preferences.jinja @@ -1,46 +1,67 @@ {% extends "core/base.jinja" %} +{%- block additional_css -%} + + +{%- endblock -%} + {% block title %} {% trans %}Preferences{% endtrans %} {% endblock %} {% block content %}

{% trans %}Preferences{% endtrans %}

-
+

{% trans %}General{% endtrans %}

+ {% csrf_token %} {{ form.as_p() }} -

+
-

{% trans %}Trombi{% endtrans %}

+ +

{% trans %}Trombi{% endtrans %}

+ {% if trombi_form %} -
+ {% csrf_token %} {{ trombi_form.as_p() }} -

+
+ {% else %}

{% trans trombi=user.trombi_user.trombi %}You already choose to be in that Trombi: {{ trombi }}.{% endtrans %} -{% trans %}Go to my Trombi tools{% endtrans %}

+
+ {% trans %}Go to my Trombi tools{% endtrans %} +

{% endif %} + + {% if profile.customer %} -

{% trans %}Student cards{% endtrans %}

-

{% trans %}You can add a card by asking at a counter or add it yourself here. If you want to manually add a student card yourself, you'll need a NFC reader. We store the UID of the card which is 14 characters long.{% endtrans %}

-
- {% csrf_token %} - {{ student_card_form.as_p() }} -

-
+

{% trans %}Student cards{% endtrans %}

+ {% if profile.customer.student_cards.exists() %} - {% else %} -

{% trans %}No student cards registered.{% endtrans %}

+{% trans %}No student card registered.{% endtrans %} +

{% trans %}You can add a card by asking at a counter or add it yourself here. If you want to manually + add a student card yourself, you'll need a NFC reader. We store the UID of the card which is 14 characters long.{% + endtrans %}

{% endif %} + +
+ {% csrf_token %} + {{ student_card_form.as_p() }} + +
{% endif %} -{% endblock %} - - - +{% endblock %} \ No newline at end of file diff --git a/core/templates/core/user_stats.jinja b/core/templates/core/user_stats.jinja index a481ca99..14a4244c 100644 --- a/core/templates/core/user_stats.jinja +++ b/core/templates/core/user_stats.jinja @@ -1,42 +1,55 @@ {% extends "core/base.jinja" %} +{%- block additional_css -%} + + +{%- endblock -%} + {% block title %} {% trans user_name=profile.get_display_name() %}{{ user_name }}'s stats{% endtrans %} {% endblock %} {% block content %} +
{% if profile.permanencies %} -

{% trans %}Permanencies{% endtrans %}

-

Total: {{ total_perm_time }}

-

Foyer: {{ total_foyer_time }}

-

MDE: {{ total_mde_time }}

-

La Gommette: {{ total_gommette_time }}

+

{% trans %}Permanencies{% endtrans %}

+
+
Foyer :{{ total_foyer_time }}
+
Gommette :{{ total_gommette_time }}
+
MDE :{{ total_mde_time }}
+
Total :{{ total_perm_time }}
+
{% endif %} -

{% trans %}Buyings{% endtrans %}

+
-

Foyer: {{ total_foyer_buyings }} €

-

MDE: {{ total_mde_buyings }} €

-

La Gommette: {{ total_gommette_buyings }} €

+

{% trans %}Buyings{% endtrans %}

+
+
Foyer :{{ total_foyer_buyings }} €
+
Gommette :{{ total_gommette_buyings }} €
+
MDE :{{ total_mde_buyings }} €
+
Total :{{ total_foyer_buyings + total_gommette_buyings + total_mde_buyings }} € +
+
-

{% trans %}Product top 10{% endtrans %}

- - - - - - - - + + +

{% trans %}Product top 10{% endtrans %}

+
{% trans %}Product{% endtrans %}{% trans %}Quantity{% endtrans %}
+ + + + + + + {% for p in top_product %} - - - - + + + + {% endfor %} - -
{% trans %}Product{% endtrans %}{% trans %}Quantity{% endtrans %}
{{ p['product__name'] }}{{ p['product_sum'] }}
{{ p['product__name'] }}{{ p['product_sum'] }}
-{% endblock %} - - + + +{% endblock %} \ No newline at end of file diff --git a/core/templates/core/user_tools.jinja b/core/templates/core/user_tools.jinja index 4804f016..94591c2f 100644 --- a/core/templates/core/user_tools.jinja +++ b/core/templates/core/user_tools.jinja @@ -1,5 +1,9 @@ {% extends "core/base.jinja" %} +{%- block additional_css -%} + +{%- endblock -%} + {% block title %} {% trans user_name=user.get_display_name() %}{{ user_name }}'s tools{% endtrans %} {% endblock %} @@ -7,14 +11,15 @@ {% block content %}

{% trans %}User Tools{% endtrans %}

-
+{% if user.can_create_subscription or user.is_root or user.is_board_member %}

{% trans %}Sith management{% endtrans %}

+{% endif %} -

{% trans %}Counters{% endtrans %}

    {% if user.is_in_group(settings.SITH_GROUP_COUNTER_ADMIN_ID) or user.is_root %} @@ -54,7 +59,6 @@ {% endfor %}
-

{% trans %}Accounting{% endtrans %}

    {% if user.is_in_group(settings.SITH_GROUP_ACCOUNTING_ADMIN_ID) or user.is_root %} @@ -62,20 +66,28 @@
  • {% trans %}General accounting{% endtrans %}
  • {% trans %}Company list{% endtrans %}
  • {% endif %} + {% for m in user.memberships.filter(end_date=None).filter(role__gte=7).all() -%} {%- for b in m.club.bank_accounts.all() %} -
  • {% trans %}Bank account: {% endtrans %} - {{ b }}
  • +
  • + {% trans %}Bank account: {% endtrans %} + {{ b }} +
  • {%- endfor %} + {% if m.club.club_account.exists() -%} - {% for ca in m.club.club_account.all() %} -
  • {% trans %}Club account: {% endtrans %} {{ ca }}
  • - {%- endfor %} + {% for ca in m.club.club_account.all() %} +
  • + {% trans %}Club account: {% endtrans %} + {{ ca }} +
  • + {%- endfor %} {%- endif -%} {%- endfor %}
-
+{% if user.is_in_group(settings.SITH_GROUP_SAS_ADMIN_ID) or user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID) or +user.is_root %}

{% trans %}Communication{% endtrans %}

+{% endif %} - -
+{% if user.memberships.filter(end_date=None).all().count() > 0 %}

{% trans %}Club tools{% endtrans %}

    {% for m in user.memberships.filter(end_date=None).all() %}
  • {{ m.club }}
  • {% endfor %}
+{% endif %} -
+{% if user.is_in_group(settings.SITH_GROUP_PEDAGOGY_ADMIN_ID) or user.is_root %}

{% trans %}Pedagogy{% endtrans %}

+{% endif %} -

{% trans %}Elections{% endtrans %}

-

{% trans %}Other tools{% endtrans %}

-{% endblock %} - - - +{% endblock %} \ No newline at end of file diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index e2b442a5..4e1ade61 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -2214,8 +2214,8 @@ msgid "Visitor" msgstr "Visiteur" #: core/models.py:787 -msgid "do you want to receive the weekmail" -msgstr "voulez-vous recevoir le Weekmail" +msgid "receive the Weekmail" +msgstr "recevoir le Weekmail" #: core/models.py:789 msgid "show your stats to others" @@ -2223,11 +2223,11 @@ msgstr "montrez vos statistiques aux autres" #: core/models.py:791 msgid "get a notification for every click" -msgstr "recevez une notification pour chaque click" +msgstr "avoir une notification pour chaque click" #: core/models.py:794 msgid "get a notification for every refilling" -msgstr "recevez une notification pour chaque rechargement" +msgstr "avoir une notification pour chaque rechargement" #: core/models.py:817 msgid "file name" @@ -3361,8 +3361,8 @@ msgstr "" "14 caractères de long." #: core/templates/core/user_preferences.jinja:40 -msgid "No student cards registered." -msgstr "Aucune cartes étudiante enregistré." +msgid "No student card registered." +msgstr "Aucune carte étudiante enregistrée." #: core/templates/core/user_stats.jinja:4 #, python-format