43 lines
1.7 KiB
Twig
43 lines
1.7 KiB
Twig
{% extends 'base.html.twig' %}
|
|
|
|
{% block title %}Hello PostController!{% 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>
|
|
<div class="container-fluid">
|
|
<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>
|
|
<div class="card-footer text-muted">{{ post.createdAt.format('Y-m-d H:i:s') }}</div>
|
|
</div>
|
|
{% endfor %}
|
|
<div class="container-fluid">
|
|
<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'}}) }}
|
|
</div>
|
|
|
|
<div class="form-outline">
|
|
{{ form_widget(form.content) }}
|
|
{{ form_label(form.content, null, {'label_attr': {'class': 'form-label'}}) }}
|
|
</div>
|
|
{{ form_row(form.comment) }}
|
|
{{ form_end(form) }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|