Create and display comments

This commit is contained in:
Bat
2018-05-10 10:44:57 +01:00
parent 424517fab0
commit a3d73cb2c4
7 changed files with 100 additions and 9 deletions
+20
View File
@@ -0,0 +1,20 @@
{% extends "base" %}
{% block title %}
Comment "{{ post.title }}"
{% endblock title %}
{% block content %}
<h1>Comment "{{ post.title }}"</h1>
<form method="post">
<label for="content">Content</label>
<textarea name="content"></textarea>
{% if responding_to %}
<input name="respond_to" value="{{ responding_to }}">
{% endif %}
<input type="submit" value="Submit comment"/>
</form>
{% endblock content %}
+16 -7
View File
@@ -5,11 +5,20 @@
{% endblock title %}
{% block content %}
<h1>{{ post.title }}</h1>
<p>Published in {{ blog.title }}</p>
<hr>
<p>
{{ post.content | safe }}
</p>
<p>License: {{ post.license }}</p>
<h1>{{ post.title }}</h1>
<p>Published in {{ blog.title }}</p>
<hr>
<p>
{{ post.content | safe }}
</p>
<p>License: {{ post.license }}</p>
<hr>
<h2>Comments</h2>
{% for comment in comments %}
<div>
<b>{{ comment.author.display_name }}</b>
<div>{{ comment.content | safe }}</div>
</div>
{% endfor %}
<a href="comment">Comment</a>
{% endblock content %}