change homepage route

This commit is contained in:
Jannis Portmann 2021-05-09 11:20:45 +02:00
parent 19d2bfbcc3
commit d10ef764bc
7 changed files with 80 additions and 64 deletions

View file

@ -1,20 +1,35 @@
{% extends 'base.html.twig' %}
{% block title %}Hello OfferController!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
{% for message in app.flashes('success') %}
<div class="alert alert-success" role="alert">
{{ message }}
</div>
{% endfor %}
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ '/home/thisfro/repos/plant-exchange/src/Controller/OfferController.php'|file_link(0) }}">src/Controller/OfferController.php</a></code></li>
<li>Your template at <code><a href="{{ '/home/thisfro/repos/plant-exchange/templates/offer/index.html.twig'|file_link(0) }}">templates/offer/index.html.twig</a></code></li>
</ul>
</div>
{% endblock %}
<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 %}
<a href="{{ path('show_offer', {'id': offer.id}) }}" class="mb-5">
<div class="card offer h-100">
{% if offer.photoFilename %}
<img class="card-img-top" src="{{ asset('uploads/photos/' ~ offer.photofilename) }}" />
{% endif %}
<div class="card-body">
<h5 class="card-title">{{ offer.title }}</h5>
<p class="card-text">{{ offer.description }}</p>
</div>
<div class="card-footer offer-footer">
<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>
</div>
</a>
{% endfor %}
</div>
{% else %}
<div class="alert alert-warning" role="alert">There are currently no active offers.</div>
{% endif %}
{% endblock %}