summaryrefslogtreecommitdiff
path: root/management/editor
diff options
context:
space:
mode:
Diffstat (limited to 'management/editor')
-rw-r--r--management/editor/editor.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/management/editor/editor.go b/management/editor/editor.go
index 3b26adb..6a17acb 100644
--- a/management/editor/editor.go
+++ b/management/editor/editor.go
@@ -110,15 +110,22 @@ func Form(post Editable, fields ...Field) ([]byte, error) {
<button class="right waves-effect waves-light btn red delete-post" type="submit">Delete</button>
</div>
+<div class="input-field external post-controls">
+ <div>This post is pending approval. By clicking 'Approve' it will be immediately published.</div>
+ <button class="right waves-effect waves-light btn blue approve-post" type="submit">Approve</button>
+</div>
+
<script>
$(function() {
var form = $('form'),
del = form.find('button.delete-post'),
+ approve = form.find('.post-controls.external'),
id = form.find('input[name=id]');
// hide delete button if this is a new post, or a non-post editor page
if (id.val() === '-1' || form.attr('action') !== '/admin/edit') {
del.hide();
+ approve.hide();
}
del.on('click', function(e) {
@@ -131,6 +138,15 @@ func Form(post Editable, fields ...Field) ([]byte, error) {
form.submit();
}
});
+
+ approve.find('button').on('click', function(e) {
+ e.preventDefault();
+ var action = form.attr('action');
+ action = action + '/approve';
+ form.attr('action', action);
+
+ form.submit();
+ });
});
</script>
`