From 88c2742c8b1c6d69d571231baab9b3c65b337619 Mon Sep 17 00:00:00 2001 From: Luan Date: Fri, 11 Oct 2013 16:32:12 -0300 Subject: [PATCH] Changing default search template to work with different types --- src/templates/search/search.html | 64 ++++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/src/templates/search/search.html b/src/templates/search/search.html index a2a4ff0..410de96 100644 --- a/src/templates/search/search.html +++ b/src/templates/search/search.html @@ -10,6 +10,7 @@ {{ page.paginator.count }} {% trans "documents found" %} +
@@ -45,14 +46,32 @@
    {% for result in page.object_list %} -
    - {% if result.model_name == 'message' %} - {% include "search/search-message-preview.html" %} - {% elif result.model_name == 'user' %} - {% include "search/search-user-preview.html" %} - {% elif result.model_name == 'wiki' %} - {% include "search/search-wiki-preview.html" %} - {% endif %} +
  • + {% if result.model_name == 'message' %} + {% include "search/search-message-preview.html" %} + {% elif result.model_name == 'user' %} + {% include "search/search-user-preview.html" %} + {% elif result.model_name == 'wiki' %} + {% include "search/search-wiki-preview.html" %} + {% elif result.model_name == 'revision' %} + {% include "search/search-revision-preview.html" %} + {% elif result.model_name == 'ticket' %} + {% include "search/search-ticket-preview.html" %} + {% endif %} + + {% if result.author %} +
    + {% trans "by" %} + {% if result.author and result.author_url %} + {{ result.author }} + {% else %} + {{ result.author }} + {% endif %} + + {{ result.modified|timesince }} {% trans "ago" %} +
    + {% endif %} +
  • {% empty %}
  • {% trans "No results for your search." %} @@ -60,24 +79,25 @@ {% endfor %}
- {% if docs.numFound %} -
- - {% if docs.has_previous %} - {% trans "Previous" %} - {% endif %} - + {% if query and page.has_other_pages %} +
- {% trans "Page" %} {{ docs.page_num }} {% trans "of" %} {{ docs.num_of_pages }} + {% if page.has_previous %} + {% trans "Previous" %} + {% endif %} + + {% trans "Page" %} {{ page.number }} {% trans "of" %} + {{ page.paginator.num_pages }} + + + {% if page.has_next %} + {% trans "Next" %} + {% endif %} +
+ {% endif %} - {% if docs.has_next %} - {% trans "Next" %} - {% endif %} -
-
- {% endif %}
{% endblock %} -- libgit2 0.21.2