diff options
Diffstat (limited to 'management/editor/editor.go')
-rw-r--r-- | management/editor/editor.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/management/editor/editor.go b/management/editor/editor.go index 511edb2..404e7cd 100644 --- a/management/editor/editor.go +++ b/management/editor/editor.go @@ -10,7 +10,6 @@ import ( // Editable ensures data is editable type Editable interface { - Editor() *Editor MarshalEditor() ([]byte, error) } @@ -36,7 +35,7 @@ type Field struct { // Form takes editable content and any number of Field funcs to describe the edit // page for any content struct added by a user func Form(post Editable, fields ...Field) ([]byte, error) { - editor := post.Editor() + editor := &Editor{} editor.ViewBuf = &bytes.Buffer{} _, err := editor.ViewBuf.WriteString(`<table><tbody class="row"><tr class="col s8"><td>`) @@ -149,7 +148,8 @@ func Form(post Editable, fields ...Field) ([]byte, error) { save = form.find('button.save-post'), del = form.find('button.delete-post'), external = form.find('.post-controls.external'), - id = form.find('input[name=id]'); + id = form.find('input[name=id]'), + timestamp = $('.__ponzu.content-only'); // hide if this is a new post, or a non-post editor page if (id.val() === '-1' || form.attr('action') !== '/admin/edit') { @@ -162,6 +162,11 @@ func Form(post Editable, fields ...Field) ([]byte, error) { external.hide(); } + // no timestamp on addons + if (form.attr('action') === '/admin/addon') { + timestamp.hide(); + } + save.on('click', function(e) { e.preventDefault(); |