1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
Blog/templates/post/index.html.twig

44 lines
1.7 KiB
Twig
Raw Normal View History

2021-01-14 11:14:37 +01:00
{% extends 'base.html.twig' %}
{% block title %}Post - {{ post.title }}{% endblock %}
2021-01-14 11:14:37 +01:00
{% block body %}
2021-01-14 16:19:35 +01:00
<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>
2021-01-16 19:32:42 +01:00
{% for comment in post.comments|filter(c => c.valid) %}
2021-01-14 16:19:35 +01:00
<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>
2021-01-14 11:14:37 +01:00
{% endblock %}