Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
94 lines (87 sloc) 2.84 KB
{% extends "base.html" %}
{% import "_macros.html" as macros with context %}
{% block sidebar %}
{% include "_admin-nav.html" %}
{% endblock %}
{% block scripts %}
<script type="text/javascript">
$(document).ready(function() {
$('a.confirm').click(function(event) {
if (!confirm('Are you sure?')) {
event.preventDefault();
return false;
}
return true;
});
});
</script>
{% endblock %}
{% block content %}
<h1>Posts</h1>
<table class="dashboard articles">
<thead>
<tr>
<th>Published</th>
<th>Title</th>
<th>Tags</th>
<th>Cmts</th>
<th></th>
</tr>
</thead>
<tbody>
{% for post in posts %}
<tr>
<td>
<input type="checkbox" disabled="disabled"{% if post.published %} checked="checked"{% endif %}/>
<a href="{{url_for('edit_post', slug=post.slug)}}">{{post.pubdate|datetime('%Y-%m-%d')}}</a>
</td>
<td><a href="{{url_for('edit_post', slug=post.slug)}}">{{post.title}}</a></td>
<td><a href="{{url_for('edit_post', slug=post.slug)}}">{{post.tags|join(', ')}}</a></td>
<td><a href="{{url_for('edit_post', slug=post.slug)}}"></a></td>
<td><a href="{{url_for('delete_post', slug=post.slug)}}" class="confirm"><img src="{{staticurl('delete.png')}}" width="16" height="16" class="icon"/></a></td>
</tr>
{% endfor %}
</tbody>
</table>
<h1>Moderation Queue</h1>
<table class="dashboard comments">
<thead>
<tr>
<th>On Post</th>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
{% for comment in comments %}
<form class="moderate" action="{{url_for('moderate', slug=comment.post.slug, index=comment.index)}}" method="post">
<input type="hidden" name="csrf" value="{{g.csrf}}"/>
<tr>
<td><a href="{{url_for('edit_post', slug=comment.post.slug)}}">{{comment.post.title}}</a></td>
<td>{{comment.author}}</td>
<td>{{comment.email}}</td>
</tr>
<tr>
<td colspan="3">
{# comments shouldn't get this far if they contain HTML, so this *should* be ok to do #}
<textarea name="body">{{comment.body|safe}}</textarea>
</td>
</tr>
<tr class="noborder">
<td>
<input type="submit" name="approve" value="Approve"/>
</td>
<td></td>
<td>
<input type="submit" name="reject" value="Reject"/>
</td>
</tr>
</form>
{% else %}
<tr>
<td colspan="3"><em>No unmoderated comments</em></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
Jump to Line
Something went wrong with that request. Please try again.