Redisign filter

This commit is contained in:
Jannis Portmann 2022-01-17 18:31:51 +01:00
parent b8a5ade3e0
commit 9a9bbb310a
2 changed files with 9 additions and 14 deletions

View file

@ -6,6 +6,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class OfferFilterFormType extends AbstractType
@ -19,6 +20,7 @@ class OfferFilterFormType extends AbstractType
->add('distance', NumberType::class, [
'label' => 'Distance',
])
->add('Apply', SubmitType::class)
;
}

View file

@ -15,21 +15,14 @@
</div>
{% endfor %}
<h2><i class="fas fa-filter"></i>Filter</h2>
{{ form_start(filter_form) }}
<div class="row">
<div class="col-sm">
{{ form_row(filter_form.zipCode) }}
</div>
<div class="col-sm">
{{ form_row(filter_form.distance) }}
</div>
<div class="col-sm">
<button type="submit" class="btn btn-lg btn-primary">Filter</button>
<div class="mb-5">
<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
<div class="btn btn-primary"><i class="fas fa-filter mr-3"></i>Filter<i class="fas fa-chevron-down ml-3 dropdown-collapse"></i></div>
</a>
<div class="collapse" id="collapseExample">
{{ form(filter_form) }}
</div>
</div>
{{ form_end(filter_form) }}
<h1>Offers</h1>
{% if offers|length > 0 %}