{% extends 'base.html.twig' %}
{% block body %}
<h1>Offerings</h1>
{% if offerings|length > 0 %}
<div class="card-deck">
{% for offering in offerings %}
<a href="#">
<div class="card offering h-100">
{% if offering.photoFilename %}
<img class="card-img-top" src="{{ asset('uploads/photos/' ~ offering.photofilename) }}" />
{% endif %}
<div class="card-body">
<h5 class="card-title">{{ offering.title }}</h5>
<p class="card-text">{{ offering.description }}</p>
</div>
<div class="card-footer">
<p class="username">{{ offering.byUser }}</p>
<p class="zip">{{ offering.zipCode }}</p>
</a>
{% endfor %}
{% else %}
<div class="alert alert-warning" role="alert">There are currently no active listings.</div>
{% endblock %}