From c428c102bde76bba79fdd9d007128d2a2357fda0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Je=CC=81re=CC=81my=20Fabre?= Date: Wed, 20 Jul 2016 11:49:20 +0200 Subject: [PATCH] Search results base implementation --- app/templates/search_results.html | 76 +++++++++++++++++-------------- 1 file changed, 42 insertions(+), 34 deletions(-) diff --git a/app/templates/search_results.html b/app/templates/search_results.html index dd9129c2..1c5b62b4 100644 --- a/app/templates/search_results.html +++ b/app/templates/search_results.html @@ -9,47 +9,55 @@ {% endblock %} {% block breadcrumb_menu %} -
  • +
  • -
  • {% trans "Search Results" %}
  • + {% endblock %} {% block main %} -

    -{% if results.paginator.count == 0 %} -{% blocktrans %} -No results were found in {{ search_type }} matching your query: {{ query }} -{% endblocktrans %} -{% else %} -{% blocktrans with start=results.start_index end=results.end_index total=results.paginator.count %} -Showing {{ start }} to {{ end }} of {{ total }} results in {{ search_type }} matching your query: {{ query }} -{% endblocktrans %} -{% endif %} -

    - -
    -{% for result in results.object_list %} -{% with result.get_absolute_url as result_url %} -
    - {{ forloop.counter0|add:results.start_index }}) - {% if result_url %} - {{ result }} - {% else %} - {{ result }} - {% endif %} -
    - {% if result.description != result|stringformat:"s" %} -

    {{ result.description|truncatewords_html:20|safe }}

    - {% endif %} - {% if result_url %} - {% trans "read more" %} - {% endif %} -{% endwith %} -{% endfor %} +
    +
    +

    {% trans "Search Results" %}

    +
    -{% pagination_for results %} +
    +
    +

    + {% if results.paginator.count == 0 %} + {% blocktrans %} + No results were found in {{ search_type }} matching your query: {{ query }} + {% endblocktrans %} + {% else %} + {% blocktrans with start=results.start_index end=results.end_index total=results.paginator.count %} + Showing {{ start }} to {{ end }} of {{ total }} results in {{ search_type }} matching your query: {{ query }} + {% endblocktrans %} + {% endif %} +

    + + {% for result in results.object_list %} + {% with result.get_absolute_url as result_url %} +
    + {{ forloop.counter0|add:results.start_index }}) + {% if result_url %} + {{ result }} + {% else %} + {{ result }} + {% endif %} +
    + {% if result.description != result|stringformat:"s" %} +

    {{ result.description|truncatewords_html:20|safe }}

    + {% endif %} + {% if result_url %} + {% trans "read more" %} + {% endif %} + {% endwith %} + {% endfor %} + + {% pagination_for results %} +
    +
    {% endblock %} -- 2.39.5