summaryrefslogtreecommitdiff
path: root/management/editor
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-12-06 00:19:20 -0800
committerSteve Manuel <nilslice@gmail.com>2016-12-06 00:19:20 -0800
commit13ce408afe0b929b7e4d1624fb03821e6462ff86 (patch)
tree2e41149945448d87f6eb2b0ff1e2d909f4f3cf39 /management/editor
parent8ad81923d89ff85cbcbf870d671a978cc933e118 (diff)
testing fix for only one tag stored, not being displayed as it is ignored via string search for __ponzu separator
Diffstat (limited to 'management/editor')
-rw-r--r--management/editor/elements.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/management/editor/elements.go b/management/editor/elements.go
index 7cb4f69..f483151 100644
--- a/management/editor/elements.go
+++ b/management/editor/elements.go
@@ -341,12 +341,16 @@ func Tags(fieldName string, p interface{}, attrs map[string]string) []byte {
// get the saved tags if this is already an existing post
values := valueFromStructField(fieldName, p)
- fmt.Println(values)
var tags []string
if strings.Contains(values, "__ponzu") {
tags = strings.Split(values, "__ponzu")
}
+ // case where there is only one tag stored, thus has no separator
+ if len(values) > 0 && !strings.Contains(values, "__ponzu") {
+ tags = append(tags, values)
+ }
+
html := `
<div class="col s12 __ponzu-tags ` + name + `">
<label class="active">` + attrs["label"] + ` (Type and press "Enter")</label>