From 61d34b3a09a71e1a9f8a8866f390a3af03decf95 Mon Sep 17 00:00:00 2001 From: Skia Date: Wed, 6 Jun 2018 00:25:27 +0200 Subject: [PATCH] core, matmat: fix search form --- core/static/core/style.scss | 58 ++++++++++++++++++++ core/templates/core/macros.jinja | 38 +++++++------ locale/fr/LC_MESSAGES/django.po | 67 ++++++++++------------- matmat/templates/matmat/search_form.jinja | 49 ++++++----------- 4 files changed, 128 insertions(+), 84 deletions(-) diff --git a/core/static/core/style.scss b/core/static/core/style.scss index ea1df1de..de9d2b1c 100644 --- a/core/static/core/style.scss +++ b/core/static/core/style.scss @@ -1104,6 +1104,38 @@ u, .underline { } } +.user_mini_profile { + height: 100%; + width: 100%; + img { + max-width: 100%; + max-height: 100%; + } + .user_mini_profile_infos { + padding: 0.2em; + height: 20%; + display: flex; + flex-wrap: wrap; + justify-content: space-around; + font-size: 0.9em; + div { + max-height: 100%; + } + .user_mini_profile_infos_text { + text-align: center; + .user_mini_profile_nick { + font-style: italic; + } + } + } + .user_mini_profile_picture { + height: 80%; + display: flex; + justify-content: center; + align-items: center; + } +} + .mini_profile_link { display: block; text-decoration: none; @@ -1148,6 +1180,32 @@ u, .underline { background: #333; border: solid #333 2px; } +/*--------------------------------MATMAT-------------------------------*/ +.matmat_results { + display: flex; + flex-wrap: wrap; + .matmat_user { + flex-basis: 14em; + align-self: flex-start; + margin: 0.5em; + height: 18em; + overflow: hidden; + border: 1px solid black; + box-shadow: 2px 2px 5px grey; + &:hover { + box-shadow: 1px 1px 5px $second-color; + } + } + .matmat_user a { + color: $primary-neutral-dark-color; + height: 100%; + width: 100%; + margin: 0em; + padding: 0em; + display: block; + } +} + /*---------------------------------PAGE--------------------------------*/ diff --git a/core/templates/core/macros.jinja b/core/templates/core/macros.jinja index 96bead29..f713259a 100644 --- a/core/templates/core/macros.jinja +++ b/core/templates/core/macros.jinja @@ -48,27 +48,33 @@ {%- endmacro %} {% macro user_mini_profile(user) %} -
-
-
- {% if user.profile_pict %} - {% trans %}Profile{% endtrans %} +
+
+
+
{{ user.get_full_name() }}
+ {% if user.nick_name %} +
« {{ user.nick_name }} »
+ {% endif %} + {% if user.date_of_birth %} +
+ {{ user.date_of_birth|date("d/m/Y") }} ({{ user.get_age() }}) +
{% endif %}
-
-
-

{{ user.get_full_name() }}

- {% if user.nick_name %} -

« {{ user.nick_name }} »

- {% endif %} - {% if user.date_of_birth %} -

{% trans %}Born: {% endtrans %}{{ user.date_of_birth|date("d/m/Y") }} ({{ user.get_age() }})

- {% endif %} {% if user.promo %} -

Promo {{ user.promo }} - {% trans %}Promo: {% endtrans %}{{ user.promo }}

+
+ Promo {{ user.promo }} +
{% endif %}
+
+ {% if user.profile_pict %} + {% trans %}Profile{% endtrans %} + {% else %} + {% trans %}Profile{% endtrans %} + {% endif %} +
{%- endmacro %} diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 2c75dc19..0038632d 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-05 00:14+0200\n" +"POT-Creation-Date: 2018-06-06 00:23+0200\n" "PO-Revision-Date: 2016-07-18\n" "Last-Translator: Skia \n" "Language-Team: AE info \n" @@ -361,8 +361,8 @@ msgstr "Compte en banque : " #: com/templates/com/weekmail.jinja:62 core/templates/core/file_detail.jinja:25 #: core/templates/core/file_detail.jinja:62 #: core/templates/core/file_moderation.jinja:24 -#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:87 -#: core/templates/core/macros.jinja:106 core/templates/core/page_prop.jinja:14 +#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:93 +#: core/templates/core/macros.jinja:112 core/templates/core/page_prop.jinja:14 #: core/templates/core/user_account_detail.jinja:38 #: core/templates/core/user_detail.jinja:157 #: core/templates/core/user_edit.jinja:19 @@ -2097,7 +2097,8 @@ msgstr "profil visible par les cotisants" msgid "A user with that username already exists" msgstr "Un utilisateur de ce nom d'utilisateur existe déjà" -#: core/models.py:494 core/templates/core/macros.jinja:55 +#: core/models.py:494 core/templates/core/macros.jinja:72 +#: core/templates/core/macros.jinja:74 core/templates/core/macros.jinja:75 #: core/templates/core/user_detail.jinja:79 #: core/templates/core/user_detail.jinja:80 #: core/templates/core/user_detail.jinja:82 @@ -2302,9 +2303,9 @@ msgid "Register" msgstr "S'enregister" #: core/templates/core/base.jinja:77 core/templates/core/base.jinja.py:78 -#: matmat/templates/matmat/search_form.jinja:50 -#: matmat/templates/matmat/search_form.jinja:60 -#: matmat/templates/matmat/search_form.jinja:71 +#: matmat/templates/matmat/search_form.jinja:37 +#: matmat/templates/matmat/search_form.jinja:47 +#: matmat/templates/matmat/search_form.jinja:58 msgid "Search" msgstr "Recherche" @@ -2610,41 +2611,33 @@ msgstr "Partager sur Facebook" msgid "Tweet" msgstr "Tweeter" -#: core/templates/core/macros.jinja:65 core/templates/core/user_detail.jinja:27 -msgid "Born: " -msgstr "Né le : " - -#: core/templates/core/macros.jinja:69 core/templates/core/user_detail.jinja:71 -msgid "Promo: " -msgstr "Promo : " - -#: core/templates/core/macros.jinja:76 +#: core/templates/core/macros.jinja:82 #, python-format msgid "Subscribed until %(subscription_end)s" msgstr "Cotisant jusqu'au %(subscription_end)s" -#: core/templates/core/macros.jinja:77 core/templates/core/user_edit.jinja:40 +#: core/templates/core/macros.jinja:83 core/templates/core/user_edit.jinja:40 msgid "Account number: " msgstr "Numero de compte : " -#: core/templates/core/macros.jinja:82 launderette/models.py:155 +#: core/templates/core/macros.jinja:88 launderette/models.py:155 msgid "Slot" msgstr "Créneau" -#: core/templates/core/macros.jinja:95 +#: core/templates/core/macros.jinja:101 #: launderette/templates/launderette/launderette_admin.jinja:20 msgid "Tokens" msgstr "Jetons" -#: core/templates/core/macros.jinja:112 core/templates/core/macros.jinja:114 +#: core/templates/core/macros.jinja:118 core/templates/core/macros.jinja:120 msgid "Previous" msgstr "Précédent" -#: core/templates/core/macros.jinja:118 +#: core/templates/core/macros.jinja:124 msgid "current" msgstr "actuel" -#: core/templates/core/macros.jinja:124 core/templates/core/macros.jinja:126 +#: core/templates/core/macros.jinja:130 core/templates/core/macros.jinja:132 msgid "Next" msgstr "Suivant" @@ -2943,6 +2936,10 @@ msgstr "Se désabonner" msgid "%(user_name)s's profile" msgstr "Profil de %(user_name)s" +#: core/templates/core/user_detail.jinja:27 +msgid "Born: " +msgstr "Né le : " + #: core/templates/core/user_detail.jinja:34 msgid "Department: " msgstr "Département : " @@ -2964,6 +2961,10 @@ msgstr "Adresse : " msgid "Parents address: " msgstr "Adresse des parents : " +#: core/templates/core/user_detail.jinja:71 +msgid "Promo: " +msgstr "Promo : " + #: core/templates/core/user_detail.jinja:96 #: core/templates/core/user_detail.jinja:97 #: core/templates/core/user_detail.jinja:99 @@ -4468,23 +4469,23 @@ msgid "Token not found" msgstr "Jeton non trouvé" #: matmat/templates/matmat/search_form.jinja:5 -#: matmat/templates/matmat/search_form.jinja:37 +#: matmat/templates/matmat/search_form.jinja:24 msgid "Search user" msgstr "Rechercher un utilisateur" -#: matmat/templates/matmat/search_form.jinja:24 -msgid "User found" -msgstr "Utilisateur trouvé" +#: matmat/templates/matmat/search_form.jinja:10 +msgid "Results" +msgstr "Résultats" -#: matmat/templates/matmat/search_form.jinja:38 +#: matmat/templates/matmat/search_form.jinja:25 msgid "Search by profile" msgstr "Recherche par profil" -#: matmat/templates/matmat/search_form.jinja:52 +#: matmat/templates/matmat/search_form.jinja:39 msgid "Inverted search" msgstr "Recherche inversée" -#: matmat/templates/matmat/search_form.jinja:63 +#: matmat/templates/matmat/search_form.jinja:50 msgid "Quick search" msgstr "Recherche rapide" @@ -5384,11 +5385,3 @@ msgstr "Vous ne pouvez plus écrire de commentaires, la date est passée." msgid "Maximum characters: %(max_length)s" msgstr "Nombre de caractères max: %(max_length)s" -#~ msgid "define if we show a users stats" -#~ msgstr "Definit si l'on montre les statistiques de l'utilisateur" - -#~ msgid "Record regularization" -#~ msgstr "Régularization des consignes" - -#~ msgid "Logo" -#~ msgstr "Logo" diff --git a/matmat/templates/matmat/search_form.jinja b/matmat/templates/matmat/search_form.jinja index 148a0469..34d1c1a3 100644 --- a/matmat/templates/matmat/search_form.jinja +++ b/matmat/templates/matmat/search_form.jinja @@ -6,33 +6,20 @@ {% endblock %} {% block content %} - {% if result_exists %} -

{% trans %}User found{% endtrans %}

+

{% trans %}Results{% endtrans %}

+ {% endfor %} -

+
{{ paginate(page_obj, paginator) }} +
{% endif %}

{% trans %}Search user{% endtrans %}

{% trans %}Search by profile{% endtrans %}

@@ -41,9 +28,9 @@ {% for field in form %} {% if field.name not in ('phone', 'quick') %}

- {{ field.errors }} - - {{ field }} + {{ field.errors }} + + {{ field }}

{% endif %} {% endfor %} @@ -52,13 +39,13 @@

{% trans %}Inverted search{% endtrans %}

{% csrf_token %} -

- {{ form.phone.errors }} - - {{ form.phone }} - {{ form.sex.as_hidden() }} -

-

+

+ {{ form.phone.errors }} + + {{ form.phone }} + {{ form.sex.as_hidden() }} +

+

{% trans %}Quick search{% endtrans %}