Add support for editing posts
This commit is contained in:
@@ -15,5 +15,8 @@ Edited {{post.updated}}
|
||||
<br style="clear:both"/>
|
||||
<a href="{% url forums.views.post id=post.id%}">permalink</a>
|
||||
<a href="{%url forums.views.reply post.id%}">Reply »</a>
|
||||
{% if post.user == user or perms.forums.edit_posts %}
|
||||
<a href="{%url forums.views.editPost post.id%}">Edit »</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
10
templates/forums/edit.html
Normal file
10
templates/forums/edit.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% extends "forums/reply.html" %}
|
||||
|
||||
{% block form %}
|
||||
{{post}}
|
||||
<form method="POST" action="{% url forums.views.editPost postID=post.pk %}">
|
||||
{% csrf_token %}
|
||||
{{form.as_p}}
|
||||
<input type="submit" value="Submit"/>
|
||||
</form>
|
||||
{% endblock %}
|
@@ -19,16 +19,20 @@ $(function() {
|
||||
{% endblock %}
|
||||
|
||||
{%block content%}
|
||||
{% if parent %}
|
||||
<div class="item">
|
||||
<h2>Replying to:</h2>
|
||||
{% include 'forums/_reply.html' with post=post %}
|
||||
{% include 'forums/_reply.html' with post=parent%}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="item">
|
||||
{% block form %}
|
||||
<form method="POST" action="{%url forums.views.reply post.id %}">
|
||||
{% csrf_token %}
|
||||
{{form.as_p}}
|
||||
<input type="submit" value="Submit"/>
|
||||
</form>
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="item" id="forum-preview">
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user