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

91 lines
3.7 KiB
Twig
Raw Normal View History

2021-05-01 15:33:45 +02:00
{% extends 'base.html.twig' %}
2021-09-03 16:37:34 +02:00
{% block title %}Offer: {{ offer.title }}{% endblock %}
2021-05-01 15:33:45 +02:00
{% block body %}
2021-05-28 17:33:10 +02:00
{% for message in app.flashes('error') %}
<div class="alert alert-danger" role="alert">
{{ message }}
</div>
{% endfor %}
{% for message in app.flashes('success') %}
<div class="alert alert-success" role="success">
{{ message }}
</div>
{% endfor %}
2021-05-09 11:20:45 +02:00
{% if offer.byUser == user %}
<div class="alert alert-info" role="alert">This is your offer!</div>
{% endif %}
2021-05-13 23:41:52 +02:00
<div class="show-offer-container d-flex flex-wrap">
<div class="show-img-container">
2021-05-04 14:28:18 +02:00
<img class="mb-3 img-fluid rounded" alt="Generic placeholder image" src="{{ asset('uploads/photos/' ~ offer.photofilename) }}">
</div>
<div class="show-offer-info w-50">
<h1 class="mb-3">{{ offer.title }}</h1>
<div class="mb-3 d-flex">
<p class="pr-3">
<i class="fas fa-user"></i>
{% if offer.byUser == user %}
Me
{% else %}
{{ offer.byUser }}
{% endif %}
</p>
<p class="pr-3">
<i class="fas fa-map-marker-alt"></i> {{ offer.zipCode }}
{% if distance > 0 %}
(ca. {{ distance }} km)
{% endif %}
</p>
</div>
2021-05-04 14:28:18 +02:00
<h3>Description</h3>
<p>{{ offer.description }}</p>
</div>
</div>
2021-05-09 11:20:45 +02:00
{% if offer.byUser == user %}
<a href="{{ path('edit_offer', {'id': offer.id}) }}" class="btn btn-info mb-3"><i class="fas fa-pen"></i></a>
<button type="button" class="btn btn-danger mb-3" data-toggle="modal" data-target="#exampleModal"><i class="fas fa-trash-alt"></i></button>
2021-05-15 18:58:28 +02:00
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Warning</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to delete this offer?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<a type="button" class="btn btn-danger" href="{{ path('delete_offer', {'id': offer.id}) }}">Delete</a>
</div>
</div>
</div>
</div>
2021-05-09 11:20:45 +02:00
{% else %}
<h3>Wishes</h3>
<p>{{ offer.byUser }} would like some of the following in return:</p>
<div class="mb-3">
{% 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 %}
2021-05-04 12:33:58 +02:00
</div>
2021-06-06 14:05:42 +02:00
<a class="btn btn-primary mb-3" href="{{ path('trade', {'id': offer.id}) }}">Offer trade</a>
2021-05-04 14:28:18 +02:00
{% endif %}
2021-05-15 18:58:28 +02:00
{% endblock %}