{% extends 'base.html.twig' %}
{% block title %}User {{ username }}{% endblock %}
{% block body %}
{% for message in app.flashes('success') %}
<div class="alert alert-success" role="alert">
{{ message }}
</div>
{% endfor %}
<div class="mb-3">
<h1>{{ username }}'s Wishlist</h1>
<div class="mb-4">
{% if wishes == [] %}
<div class="alert alert-warning" role="alert">
There are currently no wishes!
{% else %}
<ul class="list-group">
{% for wish in wishes %}
<li class="list-group-item"> {{ wish.title }}</li>
</ul>
{% endif %}
<hr>
<h1>{{ username }}'s 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', {'id': offer.id }) }}">
{% if offer.photoFilename %}
<img class="card-img-top offer-img" src="{{ asset('uploads/photos/' ~ offer.photofilename) }}" />
<img class="card-img-top offer-img" src="{{ asset('placeholder.jpg') }}" />
<div class="card-body">
<h5 class="card-title">{{ offer.title }}</h5>
<p class="card-text">{{ offer.description }}</p>
</a>
<div class="card-footer offer-footer">
<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>
<p class="zip"><i class="fas fa-map-marker-alt mt-3"></i> {{ offer.zipCode }}</p>
<div class="alert alert-warning" role="alert">There are currently no active offers.</div>
{% endblock %}