feat: improve display performance of rescue orgs by limiting
This commit is contained in:
@@ -2,13 +2,28 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1 class="title is-1">{% translate "Aktualitätscheck" %}</h1>
|
<h1 class="title is-1">{% translate "Aktualitätscheck" %}</h1>
|
||||||
<p>{% translate "Überprüfe ob im Tierheim neue Vermittlungen ein Zuhause suchen" %}</p>
|
<p class="subtitle is-2">{% translate "Überprüfe ob es in Tierheimen neue Tiere gibt die ein Zuhause suchen" %}</p>
|
||||||
|
|
||||||
|
<div class="block">
|
||||||
|
<h2 class="title is-3">{% translate "Am längsten nicht geprüft" %}</h2>
|
||||||
<div class="grid is-col-min-15">
|
<div class="grid is-col-min-15">
|
||||||
{% for rescue_org in rescue_orgs %}
|
{% for rescue_org in rescue_orgs_to_check %}
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
{% include "fellchensammlung/partials/partial-check-rescue-org.html" %}
|
{% include "fellchensammlung/partials/partial-check-rescue-org.html" %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="block">
|
||||||
|
<h2 class="title is-3">{% translate "Zuletzt geprüft" %}</h2>
|
||||||
|
<div class="grid is-col-min-15">
|
||||||
|
{% for rescue_org in rescue_orgs_last_checked %}
|
||||||
|
<div class="cell">
|
||||||
|
{% include "fellchensammlung/partials/partial-check-rescue-org.html" %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -723,8 +723,10 @@ def rescue_organization_check(request, context=None):
|
|||||||
species_url_instance.rescue_organization_id = rescue_org.id
|
species_url_instance.rescue_organization_id = rescue_org.id
|
||||||
species_url_instance.save()
|
species_url_instance.save()
|
||||||
|
|
||||||
last_checked_rescue_orgs = RescueOrganization.objects.filter(exclude_from_check=False).order_by("last_checked")
|
rescue_orgs_to_check = RescueOrganization.objects.filter(exclude_from_check=False).order_by("last_checked")[:10]
|
||||||
context["rescue_orgs"] = last_checked_rescue_orgs
|
rescue_orgs_last_checked = RescueOrganization.objects.filter().order_by("-last_checked")[:10]
|
||||||
|
context["rescue_orgs_to_check"] = rescue_orgs_to_check
|
||||||
|
context["rescue_orgs_last_checked"] = rescue_orgs_last_checked
|
||||||
return render(request, 'fellchensammlung/rescue-organization-check.html', context=context)
|
return render(request, 'fellchensammlung/rescue-organization-check.html', context=context)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user