8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 15:33:45 +00:00

Add pagination for machine history results

This commit is contained in:
Jean-Romain Garnier 2020-04-22 19:10:10 +02:00 committed by klafyvel
parent 91cee11297
commit 01236373aa
2 changed files with 11 additions and 7 deletions

View file

@ -66,6 +66,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr>
{% endfor %}
</table>
{% include 'pagination.html' with list=events %}
{% else %}
<h3>{% trans "No result" %}</h3>
{% endif %}

View file

@ -489,16 +489,19 @@ def stats_search_machine_history(request):
history_form = MachineHistoryForm(request.GET or None)
if history_form.is_valid():
history = MachineHistory()
events = history.get(
history_form.cleaned_data.get("q", ""),
history_form.cleaned_data
)
max_result = GeneralOption.get_cached_value("search_display_page")
re2o_paginator(request,
events,
max_result)
return render(
request,
"logs/machine_history.html",
{
"events":
history.get(
history_form.cleaned_data.get("q", ""),
history_form.cleaned_data
)
},
{ "events": events },
)
return render(request, "logs/search_machine_history.html", {"history_form": history_form})