diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-01-11 11:37:56 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-01-11 11:37:56 -0800 |
commit | ac82561825ab76f2b5db5c4086541e590fcb70cb (patch) | |
tree | a90bc1a4d8f26006916e48d346e4fd384859e1f4 /management/editor/editor.go | |
parent | bc35db8c462646b8e0ed3bbc94ceca51808a7787 (diff) |
extending the "addon" platform within ponzu to register, present and manage addons
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(); |