Skip to content

Commit

Permalink
show result even when there are no results
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienReuiller committed Sep 16, 2024
1 parent 9970a0a commit 651b8c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lemarche/templates/pages/impact-calculator.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h2>
<div class="fr-grid-row fr-mt-8v">
<div class="fr-col-12">
<ul class="fr-btns-group fr-btns-group--inline fr-btns-group--right fr-btns-group--icon-right">
{% if results %}
{% if show_results %}
<li>
<button hx-get="{{ request.path }}" hx-target="#calculatorImpact" hx-swap="outerHTML" class="fr-btn fr-btn--secondary fr-icon-close-circle-line">
<span>Annuler</span>
Expand All @@ -86,7 +86,7 @@ <h2>
</div>
</form>
</div>
{% if results %}
{% if show_results %}
<div class="fr-col-12 fr-col-lg-5">
<h3>Résultats</h3>
<p>
Expand Down
1 change: 1 addition & 0 deletions lemarche/www/pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def get_context_data(self, **kwargs):
context["form"] = self.filter_form
if siae_search_form.is_valid():
# results
context["show_results"] = True
context["results"] = self.get_queryset()
context["results_aggregated"] = self.filter_form.impact_aggregation(context["results"])
context["current_search_query"] = self.request.GET.urlencode()
Expand Down

0 comments on commit 651b8c6

Please sign in to comment.