From 3762d6aafae3ff532f61260995d398f7bce65ad4 Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Sun, 22 May 2016 13:27:37 -0700 Subject: [PATCH] Gemini section show auth message issues --- documize/section/gemini.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/documize/section/gemini.go b/documize/section/gemini.go index 741c576d..479031e9 100644 --- a/documize/section/gemini.go +++ b/documize/section/gemini.go @@ -26,6 +26,7 @@ import ( // the HTML that is rendered by this section. const renderTemplate = ` +{{if .Authenticated}}

The Gemini workspace {{.Config.WorkspaceName}} contains {{.Config.ItemCount}} items.

@@ -49,6 +50,9 @@ const renderTemplate = ` {{end}}
+{{else}} +

Authenticate with Gemini to see items.

+{{end}} ` type gemini struct { @@ -83,6 +87,7 @@ func (*gemini) Render(config, data string) string { payload.Items = items payload.Config = c + payload.Authenticated = c.UserID > 0 t := template.New("items") t, _ = t.Parse(renderTemplate) @@ -182,8 +187,9 @@ func (*gemini) Refresh(config, data string) (newData string) { // Gemini helpers type geminiRender struct { - Config geminiConfig - Items []geminiItem + Config geminiConfig + Items []geminiItem + Authenticated bool } type geminiItem struct {