From 31c53a3c73815918515af8692021e3c29ef63d65 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 17 Dec 2016 02:50:10 -0800 Subject: testing reference input type --- addons/reference/reference.go | 43 +++---------------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) (limited to 'addons/reference/reference.go') diff --git a/addons/reference/reference.go b/addons/reference/reference.go index 2681146..3865e71 100644 --- a/addons/reference/reference.go +++ b/addons/reference/reference.go @@ -10,11 +10,11 @@ import ( "github.com/bosssauce/ponzu/system/db" ) -// New returns the []byte of a HTML element plus internal with a label. // IMPORTANT: // The `fieldName` argument will cause a panic if it is not exactly the string // form of the struct field that this editor input is representing -func New(fieldName string, p interface{}, attrs map[string]string, contentType, fmtString string) []byte { +func Select(fieldName string, p interface{}, attrs map[string]string, contentType string) []byte { ct, ok := content.Types[contentType] if !ok { log.Println("Cannot reference an invalid content type:", contentType) @@ -40,7 +40,7 @@ func New(fieldName string, p interface{}, attrs map[string]string, contentType, // make sure it is an Identifiable item, ok := t.(content.Identifiable) if !ok { - log.Println("Cannot use type", contentType, "as reference as it does not implement content.Identifiable") + log.Println("Cannot use type", contentType, "as a reference since it does not implement content.Identifiable") return nil } @@ -49,42 +49,5 @@ func New(fieldName string, p interface{}, attrs map[string]string, contentType, options[k] = v } - options[""] = contentType + "Content loading..." - return editor.Select(fieldName, p, attrs, options) } - -/* - -*/ -- cgit v1.2.3