28 lines
705 B
HTML
28 lines
705 B
HTML
{% macro render_comment_pre(comment) %}
|
|
<div class=comment>
|
|
<p><sub><i>{{ comment.author }}</i></sub></p>
|
|
<p>{{ comment.text }}</p>
|
|
{% 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/">
|
|
<p><textarea name="text"></textarea></p>
|
|
<p><input type="submit" value="Post comment"></p>
|
|
</form>
|
|
{% endif %}
|
|
{% endmacro %}
|