From 65a0b7b2d43c3dbf85d5ebdf473de23fbebc22ac Mon Sep 17 00:00:00 2001 From: Bartuccio Antoine Date: Fri, 7 Dec 2018 13:28:30 +0100 Subject: [PATCH] forum: better display of search results --- core/static/core/style.scss | 18 ------------------ forum/templates/forum/search.jinja | 20 +++++++++----------- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/core/static/core/style.scss b/core/static/core/style.scss index ae172e95..dc6ef753 100644 --- a/core/static/core/style.scss +++ b/core/static/core/style.scss @@ -1476,24 +1476,6 @@ textarea { } } } - - .search-results { - width: 100%; - .result-box { - width: 100%; - } - .result-topic { - display: inline-block; - background: #9f9f9f; - width: 19%; - } - .result-message { - display: inline-block; - background: #dbdbdb; - width: 80%; - - } - } } /*------------------------------SAS------------------------------------*/ diff --git a/forum/templates/forum/search.jinja b/forum/templates/forum/search.jinja index 465f20bb..4d15714a 100644 --- a/forum/templates/forum/search.jinja +++ b/forum/templates/forum/search.jinja @@ -1,22 +1,20 @@ {% extends "core/base.jinja" %} -{% from 'forum/macros.jinja' import display_message %} +{% from 'forum/macros.jinja' import display_message, display_search_bar %} {% block content %}
+ {% if object_list|length != 0 %} +
+ {{ display_search_bar() }}
{% for m in object_list %} - {% if user.can_view(m) %} -
-
- {{ m }} -
-
- {{ m.message }} -
-
- {% endif %} + {{ display_message(m, user) }} {% endfor %}
+ {% else %} + {% trans %}No result found{% endtrans %} + {% endif %}
+ {% endblock %} \ No newline at end of file