Allow editing comments
This commit is contained in:
@@ -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>
|
||||
|
||||
17
templates/edit_comment.html
Normal file
17
templates/edit_comment.html
Normal 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 %}
|
||||
@@ -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() }}
|
||||
|
||||
Reference in New Issue
Block a user