This repository has been archived on 2024-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
pflaenz.li-Symfony/templates/user/public.html.twig

63 lines
2.4 KiB
Twig
Raw Normal View History

2021-05-13 12:11:02 +02:00
{% extends 'base.html.twig' %}
2021-09-04 16:08:40 +02:00
{% block title %}User {{ username }}{% endblock %}
2021-05-13 12:11:02 +02:00
{% 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>
<div class="mb-4">
{% if wishes == [] %}
<div class="alert alert-warning" role="alert">
There are currently no wishes!
</div>
{% else %}
<ul class="list-group">
{% for wish in wishes %}
<li class="list-group-item"> {{ wish.title }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
<hr>
<div class="mb-3">
<h1>{{ username }}'s Offers</h1>
</div>
{% 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">
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>
<p class="card-text">{{ offer.description }}</p>
</div>
</a>
<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.id }) }}">
2021-05-13 12:11:02 +02:00
<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 currently no active offers.</div>
{% endif %}
{% endblock %}