1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-21 15:18:23 +02:00

Load result data in tables

This commit is contained in:
Yohann D'ANELLO
2020-10-15 20:39:34 +02:00
parent 7fb811b87f
commit 144577bd89
8 changed files with 125 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{% extends 'base.html' %}
{% load crispy_forms_filters highlight i18n %}
{% load crispy_forms_filters highlight i18n search_results_tables django_tables2 %}
{% block content %}
<h2>{% trans "Search" %}</h2>
@ -19,11 +19,9 @@
{% 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 %}
{% with table=category.list|search_table %}
{% render_table table %}
{% endwith %}
{% empty %}
<p>{% trans "No results found." %}</p>
{% endfor %}