fix: don't use search when checking specialized rescue orgs
This commit is contained in:
@@ -17,11 +17,12 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="columns block">
|
||||
<div class=" column is-two-thirds">
|
||||
<div class=" column {% if show_search %}is-two-thirds {% endif %}">
|
||||
<div style="height: 70vh">
|
||||
{% include "fellchensammlung/partials/partial-map.html" %}
|
||||
</div>
|
||||
</div>
|
||||
{% if show_search %}
|
||||
<div class="column is-one-third">
|
||||
<form method="GET" autocomplete="off">
|
||||
<input type="hidden" name="longitude" maxlength="200" id="longitude">
|
||||
@@ -33,6 +34,7 @@
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
|
@@ -754,6 +754,7 @@ def list_rescue_organizations(request, species=None, template='fellchensammlung/
|
||||
org_search = RescueOrgSearch(request)
|
||||
rescue_organizations = org_search.get_rescue_orgs()
|
||||
else:
|
||||
org_search = None
|
||||
rescue_organizations = RescueOrganization.objects.filter(specializations=species)
|
||||
|
||||
paginator = Paginator(rescue_organizations, 10)
|
||||
@@ -771,6 +772,10 @@ def list_rescue_organizations(request, species=None, template='fellchensammlung/
|
||||
context = {"rescue_organizations_to_list": rescue_organizations_to_list,
|
||||
"show_rescue_orgs": True,
|
||||
"elided_page_range": paginator.get_elided_page_range(page_number, on_each_side=2, on_ends=1),
|
||||
}
|
||||
if org_search:
|
||||
additional_context = {
|
||||
"show_search": True,
|
||||
"search_form": org_search.search_form,
|
||||
"place_not_found": org_search.place_not_found,
|
||||
"map_center": org_search.position,
|
||||
@@ -780,6 +785,7 @@ def list_rescue_organizations(request, species=None, template='fellchensammlung/
|
||||
"search_radius": org_search.max_distance,
|
||||
"zoom_level": zoom_level_for_radius(org_search.max_distance),
|
||||
}
|
||||
context.update(additional_context)
|
||||
return render(request, template, context=context)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user