mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-21 11:18:23 +02:00
Regroup search results by model type
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% load crispy_forms_filters i18n %}
|
||||
{% load crispy_forms_filters highlight i18n %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{% trans "Search" %}</h2>
|
||||
@ -16,10 +16,14 @@
|
||||
<h3>{% trans "Results" %}</h3>
|
||||
|
||||
<div id="search-results">
|
||||
{% for result in page.object_list %}
|
||||
<p>
|
||||
<a href="{{ result.object.get_absolute_url }}">{{ result.object }}</a>
|
||||
</p>
|
||||
{% regroup page.object_list by model_name as categories %}
|
||||
{% for category in categories %}
|
||||
<h4>{% trans category.grouper|capfirst %}</h4>
|
||||
{% for result in category.list %}
|
||||
<p>
|
||||
<a href="{{ result.object.get_absolute_url }}">{{ result.object }}</a>
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% empty %}
|
||||
<p>{% trans "No results found." %}</p>
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user