2021-05-03 18:32:31 +02:00
|
|
|
{% extends 'base.html.twig' %}
|
|
|
|
|
2021-09-03 16:41:07 +02:00
|
|
|
{% block title %}Offers{% endblock %}
|
|
|
|
|
2021-05-03 18:32:31 +02:00
|
|
|
{% block body %}
|
|
|
|
|
2021-05-09 11:20:45 +02:00
|
|
|
{% for message in app.flashes('success') %}
|
|
|
|
<div class="alert alert-success" role="alert">
|
|
|
|
{{ message }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2022-01-17 17:11:38 +01:00
|
|
|
{% for message in app.flashes('error') %}
|
|
|
|
<div class="alert alert-danger" role="alert">
|
|
|
|
{{ message }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2021-05-03 18:32:31 +02:00
|
|
|
|
2022-01-17 18:31:51 +01:00
|
|
|
<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">
|
2022-01-20 17:51:02 +01:00
|
|
|
{{ form(filter_form, {attr: {novalidate: 'novalidate'}}) }}
|
2022-01-14 13:52:16 +01:00
|
|
|
</div>
|
2022-01-17 18:31:51 +01:00
|
|
|
</div>
|
2022-01-14 13:52:16 +01:00
|
|
|
|
2021-05-09 11:20:45 +02:00
|
|
|
<h1>Offers</h1>
|
|
|
|
{% if offers|length > 0 %}
|
|
|
|
<div class="card-deck d-flex justify-content-around justify-content-sm-around justify-content-md-between flex-wrap">
|
|
|
|
{% for offer in offers %}
|
2021-05-13 12:11:02 +02:00
|
|
|
<div class="mb-5">
|
2021-05-09 11:20:45 +02:00
|
|
|
<div class="card offer h-100">
|
2022-01-17 19:11:00 +01:00
|
|
|
<a href="{{ path('show_offer', {'urlId': offer.urlId }) }}">
|
2021-05-13 12:11:02 +02:00
|
|
|
{% if offer.photoFilename %}
|
|
|
|
<img class="card-img-top offer-img" src="{{ asset('uploads/photos/' ~ offer.photofilename) }}" />
|
|
|
|
{% else %}
|
|
|
|
<img class="card-img-top offer-img" src="{{ asset('placeholder.jpg') }}" />
|
|
|
|
{% endif %}
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">{{ offer.title }}</h5>
|
|
|
|
</div>
|
|
|
|
</a>
|
2021-05-09 11:20:45 +02:00
|
|
|
<div class="card-footer offer-footer">
|
2022-01-17 21:25:31 +01:00
|
|
|
<a class="user-link" href="{{ path('user_public', { 'urlId': offer.byuser.urlId }) }}">
|
2021-05-13 12:11:02 +02:00
|
|
|
<p class="username"><i class="fas fa-user mt-3"></i> {{ offer.byUser }}</p>
|
|
|
|
</a>
|
2021-05-09 11:20:45 +02:00
|
|
|
<p class="zip"><i class="fas fa-map-marker-alt mt-3"></i> {{ offer.zipCode }}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-05-13 12:11:02 +02:00
|
|
|
</div>
|
2021-05-09 11:20:45 +02:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% else %}
|
2022-01-17 17:11:38 +01:00
|
|
|
<div class="alert alert-warning" role="alert">There are no active offers with the current filter.</div>
|
2021-05-09 11:20:45 +02:00
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|