diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-30 23:31:37 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-30 23:31:37 -0700 |
commit | dd4a88bed52b6127503824218fb97645d44e1a7d (patch) | |
tree | a4f5aad277aadee61ee9d4aa319de836d694b595 /management/editor/editor.go | |
parent | b1dd82806b8e31ff62d5cbb0612998411a8a1259 (diff) |
adding initial code for merging pending to private content
Diffstat (limited to 'management/editor/editor.go')
-rw-r--r-- | management/editor/editor.go | 16 |
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> ` |