{{ form_start(advancedSearchForm, {attr: {'id': 'advancedSearchForm'}}) }}
<div
{{ stimulus_controller('search') }}
data-search-params-value="{{ searchParams|json_encode }}"
data-search-entity-value="{{ entity }}"
>
<div class="row mb-3">
<div class="col-12 text-start">
<button
type="button"
class="btn btn-sm btn-success btn-add-criteria"
data-prototype="{{ form_widget(advancedSearchForm.searchCriteria.vars.prototype)|e }}"
>
<i class="fas fa-plus"></i> Ajouter un critère
</button>
</div>
</div>
<div class="mb-3" id="search-field">
{% for key, criteria in advancedSearchForm.searchCriteria %}
{{ include('backend/advanced_search/partials/_criteria.html.twig', {'criteria': criteria, 'key': key}) }}
{% endfor %}
</div>
<div class="row mt-4">
<div class="col-10 pt-2">
{% if entity in ['entreprise', 'contact', 'user_crm', 'user_member', 'cotisation', 'order'] %}
<div class="form-check d-inline-block">
<input name="for_not_display_achived" id="for_not_display_achived" class="form-check-input" type="checkbox"{{ forNotDisplayArchived == true ? ' checked' }}>
<label class="form-check-label" for="for_not_display_achived">Afficher les enregistrements archivées</label>
</div>
{% endif %}
{% if entity == 'contact' and is_granted('ROLE_DISPLAY_SEND_MAIL_AND_SMS') %}
<div class="form-check d-inline-block">
<input name="for_email" id="for_email" class="form-check-input" type="checkbox"{{ forEmailSending == true ? ' checked' }}>
<label class="form-check-label" for="for_email">Pour envoi de Courriel</label>
</div>
<div class="form-check d-inline-block px-5">
<input name="for_sms" id="for_sms" class="form-check-input" type="checkbox"{{ forSmsSending == true ? ' checked' }}>
<label class="form-check-label" for="for_sms">Pour envoi de SMS</label>
</div>
{% endif %}
</div>
<div class="col-2 text-end">
<button type="submit" class="btn btn-sm btn-primary" title="Lancer la recherche">
<i class="fas fa-search"></i> Rechercher
</button>
<button type="reset" class="btn btn-sm btn-danger btn-icon" title="Réinitialiser la recherche">
<i class="fas fa-ban"></i>
</button>
</div>
</div>
</div>
{{ form_end(advancedSearchForm) }}