{% extends 'base.html.twig' %}
{% block title %}Post - {{ post.title }}{% endblock %}
{% block body %}
<div class="container justify-content-center">
<div class="container-fluid">
<h3>{{ post.title }}</h3>
<blockquote class="blockquote">
<p>{{ post.description }}</p>
</blockquote>
<p>{{ post.content }}</p>
</div>
<h3>Comments</h3>
{% for comment in post.comments|filter(c => c.valid) %}
<div class="card">
<div class="card-body">
<h5 class="card-title">{{ comment.username }}</h5>
<p class="card-text">{{ comment.content }}</p>
<div class="card-footer text-muted">{{ post.createdAt.format('Y-m-d H:i:s') }}</div>
{% endfor %}
<h4>Post a new comment</h4>
{{ form_start(form) }}
{{ form_errors(form) }}
<div class="form-outline">
{{ form_widget(form.username) }}
{{ form_label(form.username, null, {'label_attr': {'class': 'form-label'}}) }}
{{ form_widget(form.content) }}
{{ form_label(form.content, null, {'label_attr': {'class': 'form-label'}}) }}
{{ form_row(form.comment) }}
{{ form_end(form) }}
{% endblock %}