Paginated comments

This commit is contained in:
2024-07-28 00:33:23 -04:00
parent cd8fe1d509
commit e538b82bf5
3 changed files with 35 additions and 2 deletions

View File

@@ -6,6 +6,8 @@
<h2>{{ conference }} Conference<h2>
{% if comments|length > 0 %}
<div>There are {{ comments|length }} comments.</div>
{% for comment in comments %}
{% if comment.photoFilename %}
<img src="{{ asset('uploads/photos/' ~ comment.photofilename) }}" style="max-width: 200px"/>
@@ -18,6 +20,13 @@
<p>{{ comment.text }}</p>
{% endfor %}
{% if previous >= 0 %}
<a href="{{ path('conference', { id: conference.id, offset: previous }) }}">Previous</a>
{% endif %}
{% if next < comments|length %}
<a href="{{ path('conference', { id: conference.id, offset: next }) }}">Next</a>
{% endif %}
{% else %}
<div>No comments have been posted yet for this conference.</div>
{% endif %}