Add theme

This commit is contained in:
David Hoppenbrouwers
2022-10-07 19:13:16 +02:00
parent a6695b3e39
commit 09cb2df004
11 changed files with 164 additions and 32 deletions

View File

@@ -1,19 +1,27 @@
{% macro render_comment(comment) %}
<div style="margin-left:20px">
<p><i>{{ comment.author }}</i></p>
{% macro render_comment_pre(comment) %}
<div class=comment>
<p><sub><i>{{ comment.author }}</i></sub></p>
<p>{{ comment.text }}</p>
<sup><a href="{{ url_for("comment", comment_id = comment.id) }}">reply</a></sup>
{% endmacro %}
{% macro render_comment_post(comment) %}
{% for c in comment.children %}
{{ render_comment(c) }}
{% endfor %}
</div>
{% endmacro %}
{% macro render_comment(comment) %}
{{ render_comment_pre(comment) }}
<sup><a href="{{ url_for("comment", comment_id = comment.id) }}">reply</a></sup>
{{ render_comment_post(comment) }}
{% endmacro %}
{% macro reply() %}
{% if 'user_id' in session %}
<form method="post" action="comment/">
<textarea name="text"></textarea>
<input type="submit" value="Post comment">
<p><textarea name="text"></textarea></p>
<p><input type="submit" value="Post comment"></p>
</form>
{% endif %}
{% endmacro %}