Skip to content

Commit

Permalink
ads managers list: filter EPCI by commune name
Browse files Browse the repository at this point in the history
  • Loading branch information
brmzkw committed Feb 9, 2024
1 parent 926206f commit 1f21634
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions mesads/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def get_queryset(self):
| Q(adsuser__siret__icontains=q)
| Q(owner_name__icontains=q)
| Q(clean_immatriculation_plate__icontains=q)
| Q(epci_commune__libelle__icontains=q)
)

# Add ordering on the number. CAST is necessary in the case the ADS number is not an integer.
Expand Down Expand Up @@ -614,17 +615,21 @@ def display_date(value):
),
"\n".join(
[
f"{idx + 1}. {name}"
if any(x for x in ads.ads_users_names)
else ""
(
f"{idx + 1}. {name}"
if any(x for x in ads.ads_users_names)
else ""
)
for idx, name in enumerate(ads.ads_users_names)
]
),
"\n".join(
[
f"{idx + 1}. {siret}"
if any(x for x in ads.ads_users_sirets)
else ""
(
f"{idx + 1}. {siret}"
if any(x for x in ads.ads_users_sirets)
else ""
)
for idx, siret in enumerate(ads.ads_users_sirets)
if len(ads.ads_users_sirets)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h6>Filtrer les ADS</h6>
<!-- form.q -->
<div class="fr-col-lg-6 fr-input-group{% if search_form.q.errors %} fr-input-group--error{% endif %}">
<label class="fr-label" for="{{ search_form.q.id_for_label }}">
Rechercher par nom ou SIRET du titulaire, ou de l'exploitant, ou plaque d'immatriculation du véhicule
Rechercher par nom ou SIRET du titulaire, ou de l'exploitant, ou plaque d'immatriculation du véhicule{% if ads_manager.content_type.name == 'EPCI' %}, commune…{% endif %}
</label>

<input class="fr-input{% if search_form.q.errors %} fr-input--error{% endif %}" type="text"
Expand Down

0 comments on commit 1f21634

Please sign in to comment.