disply all offerings on homepage

This commit is contained in:
jannisp 2021-04-26 17:31:24 +02:00
parent 8ab7341dc6
commit 0cc7902f7f
6 changed files with 107 additions and 13 deletions

View file

@ -1,9 +1,18 @@
{% extends 'base.html.twig' %}
{% block title %}User{% endblock %}
{% block body %}
<div class="mb-3">
<h1>Hello {{ user.username }}!</p>
</div>
{% endblock %}
{% if offerings|length > 0 %}
{% for offering in offerings %}
{% if offering.photoFilename %}
<img src="{{ asset('uploads/photos/' ~ offering.photofilename) }}" />
{% endif %}
<h4>{{ offering.title }}</h4>
<small>
{{ offering.createdAt|format_datetime('medium', 'short') }}
</small>
{% endfor %}
{% else %}
<p>There are currently no active listings</p>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,9 @@
{% extends 'base.html.twig' %}
{% block title %}User{% endblock %}
{% block body %}
<div class="mb-3">
<h1>Hello {{ user.username }}!</p>
</div>
{% endblock %}