Allow editing comments

This commit is contained in:
David Hoppenbrouwers
2022-10-08 14:11:28 +02:00
parent 47f92b2d83
commit bba6bee92c
5 changed files with 62 additions and 2 deletions

View File

@@ -11,6 +11,7 @@
<a href="{{ url_for('comment', comment_id = comment.parent_id) }}#"> parent</a>
{%- endif -%}
{%- if comment.author_id == session.get('user_id') -%}
<a href="{{ url_for('edit_comment', comment_id = comment.id) }}"> edit</a>
{%- endif -%}
{%- if comment.author_id == session.get('user_id') -%}
<a href="{{ url_for('confirm_delete_comment', comment_id = comment.id) }}"> delete</a>

View File

@@ -0,0 +1,17 @@
{% extends 'base.html' %}
{% block content %}
<form method="post">
<table class=form>
<tr>
<td>Thread</td>
<td>{{ thread_title }}</td>
</tr>
<tr>
<td>Text</td>
<td><textarea name="text">{{ text }}</textarea></td>
</tr>
</table>
<p><input type="submit" value="Post"></p>
</form>
{% endblock %}

View File

@@ -2,7 +2,7 @@
{%- from 'comment.html' import render_comment, reply, thread_author with context %}
{%- block content %}
<i>{{ thread_author(author_id, author, create_time, modify_time) }}</i>
{{ thread_author(author_id, author, create_time, modify_time) }}
<p>{{ minimd(text) | safe }}</p>
{{- reply() }}