pflaenz.li/pflaenzli/templates/offer/detail.html

59 lines
2.7 KiB
HTML
Raw Normal View History

2023-02-19 21:37:53 +01:00
{% extends 'base.html.twig' %}
{% block title %}Offers{% endblock %}
{% block content %}
{% for message in app.flashes('success') %}
<div class="alert alert-success" role="alert">{{ message }}</div>
{% endfor %}
{% for message in app.flashes('error') %}
<div class="alert alert-danger" role="alert">{{ message }}</div>
{% endfor %}
<div class="mb-5">
<a class="btn btn-pfl"
data-toggle="collapse"
href="#collapseExample"
role="button"
aria-expanded="false"
aria-controls="collapseExample">
<div class="btn btn-pfl">
<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, {attr: {novalidate: 'novalidate' }}) }}</div>
</div>
<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 %}
<div class="mb-5">
<div class="card offer h-100">
<a href="{{ path('show_offer', {'urlId': offer.urlId }) }}">
{% 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>
<div class="card-footer offer-footer">
<a class="user-link"
href="{{ path('user_public', { 'urlId': offer.byuser.urlId }) }}">
<p class="username">
<i class="fas fa-user mt-3"></i> {{ offer.byUser }}
</p>
</a>
<p class="zip">
<i class="fas fa-map-marker-alt mt-3"></i> {{ offer.zipCode }}
</p>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="alert alert-warning" role="alert">There are no active offers with the current filter.</div>
{% endif %}
{% endblock %}