core, matmat: fix search form

This commit is contained in:
Skia 2018-06-06 00:25:27 +02:00
parent fecb1ae902
commit 61d34b3a09
4 changed files with 128 additions and 84 deletions

View File

@ -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 { .mini_profile_link {
display: block; display: block;
text-decoration: none; text-decoration: none;
@ -1148,6 +1180,32 @@ u, .underline {
background: #333; background: #333;
border: solid #333 2px; 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--------------------------------*/ /*---------------------------------PAGE--------------------------------*/

View File

@ -48,25 +48,31 @@
{%- endmacro %} {%- endmacro %}
{% macro user_mini_profile(user) %} {% macro user_mini_profile(user) %}
<div id="user_profile"> <div class="user_mini_profile">
<div id="right_column"> <div class="user_mini_profile_infos">
<div id="pictures"> <div class="user_mini_profile_infos_text">
{% if user.profile_pict %} <div class="user_mini_profile_name">{{ user.get_full_name() }}</div>
<img src="{{ user.profile_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" />
{% endif %}
</div>
</div>
<div id="left_column">
<p>{{ user.get_full_name() }}</p>
{% if user.nick_name %} {% if user.nick_name %}
<p id="nickname">&laquo; {{ user.nick_name }} &raquo;</p> <div class="user_mini_profile_nick">&laquo; {{ user.nick_name }} &raquo;</div>
{% endif %} {% endif %}
{% if user.date_of_birth %} {% if user.date_of_birth %}
<p>{% trans %}Born: {% endtrans %}{{ user.date_of_birth|date("d/m/Y") }} ({{ user.get_age() }})</p> <div class="user_mini_profile_dob">
{{ user.date_of_birth|date("d/m/Y") }} ({{ user.get_age() }})
</div>
{% endif %} {% endif %}
</div>
{% if user.promo %} {% if user.promo %}
<p><img src="{{ static('core/img/promo_%02d.png' % user.promo) }}" alt="Promo {{ user.promo }}" class="promo_pict" /> <div class="user_mini_profile_promo">
{% trans %}Promo: {% endtrans %}{{ user.promo }}</p> <img src="{{ static('core/img/promo_%02d.png' % user.promo) }}" title="Promo {{ user.promo }}" alt="Promo {{ user.promo }}" class="promo_pict" />
</div>
{% endif %}
</div>
<div class="user_mini_profile_picture">
{% if user.profile_pict %}
<img src="{{ user.profile_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" />
{% else %}
<img src="{{ static('core/img/unknown.jpg') }}" alt="{% trans %}Profile{% endtrans %}"
title="{% trans %}Profile{% endtrans %}" />
{% endif %} {% endif %}
</div> </div>
</div> </div>

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "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" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n" "Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
@ -361,8 +361,8 @@ msgstr "Compte en banque : "
#: com/templates/com/weekmail.jinja:62 core/templates/core/file_detail.jinja:25 #: com/templates/com/weekmail.jinja:62 core/templates/core/file_detail.jinja:25
#: core/templates/core/file_detail.jinja:62 #: core/templates/core/file_detail.jinja:62
#: core/templates/core/file_moderation.jinja:24 #: core/templates/core/file_moderation.jinja:24
#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:87 #: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:93
#: core/templates/core/macros.jinja:106 core/templates/core/page_prop.jinja:14 #: 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_account_detail.jinja:38
#: core/templates/core/user_detail.jinja:157 #: core/templates/core/user_detail.jinja:157
#: core/templates/core/user_edit.jinja:19 #: 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" msgid "A user with that username already exists"
msgstr "Un utilisateur de ce nom d'utilisateur existe déjà" 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:79
#: core/templates/core/user_detail.jinja:80 #: core/templates/core/user_detail.jinja:80
#: core/templates/core/user_detail.jinja:82 #: core/templates/core/user_detail.jinja:82
@ -2302,9 +2303,9 @@ msgid "Register"
msgstr "S'enregister" msgstr "S'enregister"
#: core/templates/core/base.jinja:77 core/templates/core/base.jinja.py:78 #: 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:37
#: matmat/templates/matmat/search_form.jinja:60 #: matmat/templates/matmat/search_form.jinja:47
#: matmat/templates/matmat/search_form.jinja:71 #: matmat/templates/matmat/search_form.jinja:58
msgid "Search" msgid "Search"
msgstr "Recherche" msgstr "Recherche"
@ -2610,41 +2611,33 @@ msgstr "Partager sur Facebook"
msgid "Tweet" msgid "Tweet"
msgstr "Tweeter" msgstr "Tweeter"
#: core/templates/core/macros.jinja:65 core/templates/core/user_detail.jinja:27 #: core/templates/core/macros.jinja:82
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
#, python-format #, python-format
msgid "Subscribed until %(subscription_end)s" msgid "Subscribed until %(subscription_end)s"
msgstr "Cotisant jusqu'au %(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: " msgid "Account number: "
msgstr "Numero de compte : " 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" msgid "Slot"
msgstr "Créneau" msgstr "Créneau"
#: core/templates/core/macros.jinja:95 #: core/templates/core/macros.jinja:101
#: launderette/templates/launderette/launderette_admin.jinja:20 #: launderette/templates/launderette/launderette_admin.jinja:20
msgid "Tokens" msgid "Tokens"
msgstr "Jetons" 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" msgid "Previous"
msgstr "Précédent" msgstr "Précédent"
#: core/templates/core/macros.jinja:118 #: core/templates/core/macros.jinja:124
msgid "current" msgid "current"
msgstr "actuel" 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" msgid "Next"
msgstr "Suivant" msgstr "Suivant"
@ -2943,6 +2936,10 @@ msgstr "Se désabonner"
msgid "%(user_name)s's profile" msgid "%(user_name)s's profile"
msgstr "Profil de %(user_name)s" 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 #: core/templates/core/user_detail.jinja:34
msgid "Department: " msgid "Department: "
msgstr "Département : " msgstr "Département : "
@ -2964,6 +2961,10 @@ msgstr "Adresse : "
msgid "Parents address: " msgid "Parents address: "
msgstr "Adresse des parents : " 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:96
#: core/templates/core/user_detail.jinja:97 #: core/templates/core/user_detail.jinja:97
#: core/templates/core/user_detail.jinja:99 #: core/templates/core/user_detail.jinja:99
@ -4468,23 +4469,23 @@ msgid "Token not found"
msgstr "Jeton non trouvé" msgstr "Jeton non trouvé"
#: matmat/templates/matmat/search_form.jinja:5 #: matmat/templates/matmat/search_form.jinja:5
#: matmat/templates/matmat/search_form.jinja:37 #: matmat/templates/matmat/search_form.jinja:24
msgid "Search user" msgid "Search user"
msgstr "Rechercher un utilisateur" msgstr "Rechercher un utilisateur"
#: matmat/templates/matmat/search_form.jinja:24 #: matmat/templates/matmat/search_form.jinja:10
msgid "User found" msgid "Results"
msgstr "Utilisateur trouvé" msgstr "Résultats"
#: matmat/templates/matmat/search_form.jinja:38 #: matmat/templates/matmat/search_form.jinja:25
msgid "Search by profile" msgid "Search by profile"
msgstr "Recherche par profil" msgstr "Recherche par profil"
#: matmat/templates/matmat/search_form.jinja:52 #: matmat/templates/matmat/search_form.jinja:39
msgid "Inverted search" msgid "Inverted search"
msgstr "Recherche inversée" msgstr "Recherche inversée"
#: matmat/templates/matmat/search_form.jinja:63 #: matmat/templates/matmat/search_form.jinja:50
msgid "Quick search" msgid "Quick search"
msgstr "Recherche rapide" 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" msgid "Maximum characters: %(max_length)s"
msgstr "Nombre de caractères max: %(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"

View File

@ -6,24 +6,10 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<style type="text/css">
.matmat_user {
/*position: absolute;*/
display: inline-block;
width: 240px;
height: 191px;
top: 6px;
left: 6px;
overflow: hidden;
border-width: 3px;
border-style: solid;
border-color: black;
}
</style>
{% if result_exists %} {% if result_exists %}
<h2>{% trans %}User found{% endtrans %}</h2> <h2>{% trans %}Results{% endtrans %}</h2>
<div class="matmat_results">
{% for user in object_list %} {% for user in object_list %}
<div class="matmat_user"> <div class="matmat_user">
<a href="{{ url("core:user_profile", user_id=user.id) }}"> <a href="{{ url("core:user_profile", user_id=user.id) }}">
{{ user_mini_profile(user) }} {{ user_mini_profile(user) }}
@ -31,8 +17,9 @@
</div> </div>
{% endfor %} {% endfor %}
<br><br> </div>
{{ paginate(page_obj, paginator) }} {{ paginate(page_obj, paginator) }}
<hr>
{% endif %} {% endif %}
<h2>{% trans %}Search user{% endtrans %}</h2> <h2>{% trans %}Search user{% endtrans %}</h2>
<h3>{% trans %}Search by profile{% endtrans %}</h3> <h3>{% trans %}Search by profile{% endtrans %}</h3>