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