summaryrefslogtreecommitdiff
path: root/management/editor/editor.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-17 15:04:29 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-17 15:04:29 -0700
commite82ae68634df85b06ff816525aa64a72ac9d8771 (patch)
tree919d8064fa2f12899486b907d9c0a878f8423cb3 /management/editor/editor.go
parent48f47310204df4cb1bdb5ee8db761ab942b20527 (diff)
adding partial time helper and hard coding date & time inputs
Diffstat (limited to 'management/editor/editor.go')
-rw-r--r--management/editor/editor.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/management/editor/editor.go b/management/editor/editor.go
index 486c22f..c7500b6 100644
--- a/management/editor/editor.go
+++ b/management/editor/editor.go
@@ -43,6 +43,20 @@ func Form(post Editable, fields ...Field) ([]byte, error) {
// content items with Item embedded have some default fields we need to render
editor.ViewBuf.Write([]byte(`<tr class="col s4 default-fields"><td>`))
+
+ publishTime := `
+<div class="input-field col s12">
+ <label class="active" for="Publish-Date">Publish Date</label>
+ <input value="" class="date __ponzu" label="Publish Date" type="date" name="date" />
+</div>
+<div class="input-field col s12">
+ <label class="active" for="Publish-Time">Publish Time</label>
+ <input value="" class="time __ponzu" label="Publish Time" type="time" name="time" />
+</div>
+ `
+
+ editor.ViewBuf.Write([]byte(publishTime))
+
addPostDefaultFieldsToEditorView(post, editor)
submit := `
@@ -87,20 +101,6 @@ func addFieldToEditorView(e *Editor, f Field) {
func addPostDefaultFieldsToEditorView(p Editable, e *Editor) {
defaults := []Field{
Field{
- View: Input("Date", p, map[string]string{
- "label": "Publish Date",
- "type": "date",
- "class": "date __ponzu",
- }),
- },
- Field{
- View: Input("Time", p, map[string]string{
- "label": "Publish Time",
- "type": "time",
- "class": "time __ponzu",
- }),
- },
- Field{
View: Input("Slug", p, map[string]string{
"label": "URL Slug",
"type": "text",