From 48f47310204df4cb1bdb5ee8db761ab942b20527 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Mon, 17 Oct 2016 14:30:30 -0700 Subject: adding initial updates to provide better time recording for post editing & creation --- content/item.go | 11 ++++++++--- management/editor/editor.go | 10 +++++++++- management/manager/manager.go | 2 ++ system/api/handlers.go | 2 ++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/content/item.go b/content/item.go index e96a34e..09f0760 100644 --- a/content/item.go +++ b/content/item.go @@ -1,8 +1,13 @@ package content +import "time" + // Item should only be embedded into content type structs. type Item struct { - ID int `json:"id"` - Slug string `json:"slug"` - Timestamp string `json:"timestamp"` + ID int `json:"id"` + Slug string `json:"slug"` + Time string `json:"time"` + Date string `json:"date"` + Timestamp time.Time `json:"timestamp"` + Updated time.Time `json:"updated"` } diff --git a/management/editor/editor.go b/management/editor/editor.go index f8b1970..486c22f 100644 --- a/management/editor/editor.go +++ b/management/editor/editor.go @@ -87,9 +87,17 @@ func addFieldToEditorView(e *Editor, f Field) { func addPostDefaultFieldsToEditorView(p Editable, e *Editor) { defaults := []Field{ Field{ - View: Input("Timestamp", p, map[string]string{ + 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{ diff --git a/management/manager/manager.go b/management/manager/manager.go index c0056ac..75680d7 100644 --- a/management/manager/manager.go +++ b/management/manager/manager.go @@ -13,6 +13,8 @@ const managerHTML = `
+ + {{ .Editor }}