pflaenz.li-Symfony/templates/offer/index.html.twig

41 lines
1.9 KiB
Twig
Raw Normal View History

2021-05-03 18:32:31 +02:00
{% extends 'base.html.twig' %}
{% 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 %}
2021-05-03 18:32:31 +02: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">
2021-05-13 12:11:02 +02:00
<a href="{{ path('show_offer', {'id': offer.id }) }}">
{% 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>
<p class="card-text">{{ offer.description }}</p>
</div>
</a>
2021-05-09 11:20:45 +02:00
<div class="card-footer offer-footer">
2021-05-13 12:11:02 +02:00
<a class="user-link" href="{{ path('user_public', { 'id': offer.byuser.id }) }}">
<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 %}
<div class="alert alert-warning" role="alert">There are currently no active offers.</div>
{% endif %}
{% endblock %}