mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 19:33:11 +00:00
Add pagination for machine history results
This commit is contained in:
parent
c891e52118
commit
3e52ac48d6
2 changed files with 11 additions and 7 deletions
|
@ -66,6 +66,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
{% include 'pagination.html' with list=events %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<h3>{% trans "No result" %}</h3>
|
<h3>{% trans "No result" %}</h3>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -489,16 +489,19 @@ def stats_search_machine_history(request):
|
||||||
history_form = MachineHistoryForm(request.GET or None)
|
history_form = MachineHistoryForm(request.GET or None)
|
||||||
if history_form.is_valid():
|
if history_form.is_valid():
|
||||||
history = MachineHistory()
|
history = MachineHistory()
|
||||||
return render(
|
events = history.get(
|
||||||
request,
|
|
||||||
"logs/machine_history.html",
|
|
||||||
{
|
|
||||||
"events":
|
|
||||||
history.get(
|
|
||||||
history_form.cleaned_data.get("q", ""),
|
history_form.cleaned_data.get("q", ""),
|
||||||
history_form.cleaned_data
|
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": events },
|
||||||
)
|
)
|
||||||
return render(request, "logs/search_machine_history.html", {"history_form": history_form})
|
return render(request, "logs/search_machine_history.html", {"history_form": history_form})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue