From cbd88d3659fe23185ff6750bbb780bd331afda91 Mon Sep 17 00:00:00 2001 From: Julien Constant Date: Fri, 3 Mar 2023 20:17:52 +0100 Subject: [PATCH] Rework of the tools page --- core/static/user/user_tools.scss | 42 +++++ core/templates/core/user_tools.jinja | 263 ++++++++++++++------------- 2 files changed, 181 insertions(+), 124 deletions(-) create mode 100644 core/static/user/user_tools.scss diff --git a/core/static/user/user_tools.scss b/core/static/user/user_tools.scss new file mode 100644 index 00000000..ede8eb7e --- /dev/null +++ b/core/static/user/user_tools.scss @@ -0,0 +1,42 @@ +main { + box-sizing: border-box; +} + +.container { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + gap: 10px; + + + >div { + padding: 10px; + border-radius: 10px; + background-color: rgba(0, 0, 0, .05); + width: 210px; + + >h4 { + text-align: center; + } + + >ul { + list-style-type: none; + margin: 20px 10px; + display: flex; + flex-direction: column; + gap: 10px; + } + } + + @media (max-width: 550px) { + >div { + width: 100%; + background-color: transparent; + + >h4 { + text-align: left; + } + } + } +} \ No newline at end of file diff --git a/core/templates/core/user_tools.jinja b/core/templates/core/user_tools.jinja index 94591c2f..8d184476 100644 --- a/core/templates/core/user_tools.jinja +++ b/core/templates/core/user_tools.jinja @@ -2,6 +2,7 @@ {%- block additional_css -%} + {%- endblock -%} {% block title %} @@ -9,137 +10,151 @@ {% endblock %} {% block content %} -

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

+
+

{% 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 %}

- -

{% trans %}Accounting{% endtrans %}

- + + {% 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.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.memberships.filter(end_date=None).all().count() > 0 %} -

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

- -{% endif %} + {% if user.is_in_group(settings.SITH_GROUP_PEDAGOGY_ADMIN_ID) or user.is_root %} +
+

{% trans %}Pedagogy{% endtrans %}

+ +
+ {% 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 %}

- +
+

{% trans %}Elections{% endtrans %}

+ +
+
+

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

+ +
+ +
{% endblock %} \ No newline at end of file