Flash a notification when offering added

This commit is contained in:
Jannis Portmann 2021-04-30 17:21:15 +02:00
parent 990da0e669
commit 48174c8998
2 changed files with 9 additions and 0 deletions

View file

@ -53,6 +53,9 @@ class AppController extends AbstractController
$this->entityManager->persist($offering);
$this->entityManager->flush();
$this->addFlash("success", "Successfully added the new offering!");
return $this->redirectToRoute('homepage');
}
return $this->render('app/new_listing.html.twig', [

View file

@ -2,6 +2,12 @@
{% block body %}
{% for message in app.flashes('success') %}
<div class="alert alert-success" role="alert">
{{ message }}
</div>
{% endfor %}
<h1>Offerings</h1>
{% if offerings|length > 0 %}
<div class="card-deck d-flex justify-content-around">