Admin edit comment
This commit is contained in:
parent
34ae3d3ec4
commit
dd6b8c76ba
6 changed files with 204 additions and 76 deletions
|
|
@ -8,14 +8,17 @@
|
|||
{% if comments_pending %}
|
||||
<div id="comments_pending">
|
||||
{% for comment in comments_pending %}
|
||||
<div class="comment{% if comment.needs_approval %} comment_pending{% endif %}" id="comment-{{ comment.id }}">
|
||||
<div class="comment{% if comment.needs_approval %} comment_pending{% endif %}" id="comment-{{ comment.id | safe }}">
|
||||
<span class="comment-author">{{ comment.author }}</span>
|
||||
<span class="comment-date">{{ comment.post_time | date(format="%F %R", locale=config.lang) }}</span>
|
||||
{% if comment.editable %}
|
||||
<a href="?edit={{ comment.id | safe }}#edit_comment-form">Edit</a>
|
||||
{% endif %}
|
||||
{% if admin and comment.needs_approval %}
|
||||
<a href="?approve={{ comment.id }}">Approve</a>
|
||||
<a href="?approve={{ comment.id | safe }}">Approve</a>
|
||||
{% endif %}
|
||||
{% if admin %}
|
||||
<a href="?remove={{ comment.id }}">Remove</a>
|
||||
<a href="?remove={{ comment.id | safe }}">Remove</a>
|
||||
{% endif %}
|
||||
<p class="comment-text">{{ comment.text }}</p>
|
||||
</div>
|
||||
|
|
@ -24,14 +27,17 @@
|
|||
{% endif %}
|
||||
<div id="comments">
|
||||
{% for comment in comments %}
|
||||
<div class="comment{% if comment.needs_approval %} comment_pending{% endif %}" id="comment-{{ comment.id }}">
|
||||
<div class="comment{% if comment.needs_approval %} comment_pending{% endif %}" id="comment-{{ comment.id | safe }}">
|
||||
<span class="comment-author">{{ comment.author }}</span>
|
||||
<span class="comment-date">{{ comment.post_time | date(format="%F %R", locale=config.lang) }}</span>
|
||||
{% if comment.editable %}
|
||||
<a href="?edit={{ comment.id | safe }}#edit_comment-form">Edit</a>
|
||||
{% endif %}
|
||||
{% if admin and comment.needs_approval %}
|
||||
<a href="?approve={{ comment.id }}">Approve</a>
|
||||
<a href="?approve={{ comment.id | safe }}">Approve</a>
|
||||
{% endif %}
|
||||
{% if admin %}
|
||||
<a href="?remove={{ comment.id }}">Remove</a>
|
||||
<a href="?remove={{ comment.id | safe }}">Remove</a>
|
||||
{% endif %}
|
||||
<p class="comment-text">{{ comment.text }}</p>
|
||||
</div>
|
||||
|
|
@ -47,12 +53,32 @@
|
|||
</ul>
|
||||
{% endif %}
|
||||
<label for="new_comment-author">Your name:</label>
|
||||
<input type="text" id="new_comment-author" name="author" maxlength="{{ config.comment_author_max_len }}"{% if new_comment_author %} value="{{ new_comment_author }}"{% endif %}/><br/>
|
||||
<input type="text" id="new_comment-author" name="author" maxlength="{{ config.comment_author_max_len | safe }}"{% if new_comment_author %} value="{{ new_comment_author }}"{% endif %}/><br/>
|
||||
<label for="new_comment-email">Your e-mail:</label>
|
||||
<input type="email" id="new_comment-email" name="email" maxlength="{{ config.comment_email_max_len }}"{% if new_comment_email %} value="{{ new_comment_email }}"{% endif %}/><br/>
|
||||
<input type="email" id="new_comment-email" name="email" maxlength="{{ config.comment_email_max_len | safe }}"{% if new_comment_email %} value="{{ new_comment_email }}"{% endif %}/><br/>
|
||||
<label for="new_comment-text">Your comment:</label><br/>
|
||||
<textarea id="new_comment-text" name="text" maxlength="{{ config.comment_text_max_len }}">{% if new_comment_text %}{{ new_comment_text }}{% endif %}</textarea><br/>
|
||||
<textarea id="new_comment-text" name="text" maxlength="{{ config.comment_text_max_len | safe }}">{% if new_comment_text %}{{ new_comment_text }}{% endif %}</textarea><br/>
|
||||
<button type="submit" name="a" value="new_comment">Post comment</button>
|
||||
</form>
|
||||
{% if edit_comment %}
|
||||
<form id="edit_comment-form" action="#edit_comment-form" method="post">
|
||||
{% if edit_comment_errors %}
|
||||
<p>Whoops, the following error occurred:</p>
|
||||
<ul id="edit_comment-errors" class="errors">
|
||||
{% for error in edit_comment_errors %}
|
||||
<li class="error">{{ error | safe }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<input type="hidden" name="id" value="{{ edit_comment | safe }}" autocomplete="off"/>
|
||||
<label for="edit_comment-author">Your name:</label>
|
||||
<input type="text" id="edit_comment-author" name="author" maxlength="{{ config.comment_author_max_len | safe }}"{% if edit_comment_author %} value="{{ edit_comment_author }}"{% endif %}/><br/>
|
||||
<label for="edit_comment-email">Your e-mail:</label>
|
||||
<input type="email" id="edit_comment-email" name="email" maxlength="{{ config.comment_email_max_len | safe }}"{% if edit_comment_email %} value="{{ edit_comment_email }}"{% endif %}/><br/>
|
||||
<label for="edit_comment-text">Your comment:</label><br/>
|
||||
<textarea id="edit_comment-text" name="text" maxlength="{{ config.comment_text_max_len | safe }}">{% if edit_comment_text %}{{ edit_comment_text }}{% endif %}</textarea><br/>
|
||||
<button type="submit" name="a" value="edit_comment">Edit comment</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue