From b0b5bd7319da5057a57853e9eab0a0d6977cf863 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 10 Feb 2016 16:47:02 -0500 Subject: [PATCH] Added glyphicons --- main.go | 2 ++ routes.go | 4 ++++ templates/index.tmpl | 4 ++-- templates/list.tmpl | 2 +- templates/view.tmpl | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 840dbc5..ee0217b 100644 --- a/main.go +++ b/main.go @@ -21,6 +21,7 @@ var AllowedIPs = map[string]bool{ // RuntimeArgs contains all runtime // arguments available var RuntimeArgs struct { + WikiName string ExternalIP string Port string DatabaseLocation string @@ -40,6 +41,7 @@ func main() { flag.StringVar(&RuntimeArgs.AdminKey, "a", "", "key to access admin priveleges") flag.StringVar(&RuntimeArgs.ServerCRT, "crt", "", "location of ssl crt") flag.StringVar(&RuntimeArgs.ServerKey, "key", "", "location of ssl key") + flag.StringVar(&RuntimeArgs.WikiName, "w", "AwwKoala", "custom name for wiki") flag.CommandLine.Usage = func() { fmt.Println(`AwwKoala: A Websocket Wiki and Kind Of A List Application run this to start the server and then visit localhost at the port you specify diff --git a/routes.go b/routes.go index c60e860..9b2a192 100644 --- a/routes.go +++ b/routes.go @@ -40,6 +40,7 @@ func editNote(c *gin.Context) { if currentVersion { c.HTML(http.StatusOK, "index.tmpl", gin.H{ "Title": title, + "WikiName": RuntimeArgs.WikiName, "ExternalIP": RuntimeArgs.ExternalIP, "CurrentText": currentText, "NumRows": numRows, @@ -48,6 +49,7 @@ func editNote(c *gin.Context) { } else { c.HTML(http.StatusOK, "index.tmpl", gin.H{ "Title": title, + "WikiName": RuntimeArgs.WikiName, "ExternalIP": RuntimeArgs.ExternalIP, "CurrentText": currentText, "NumRows": numRows, @@ -112,6 +114,7 @@ func renderMarkdown(c *gin.Context, currentText string, title string, versions [ html2 = strings.Replace(html2, "$", "$", -1) c.HTML(http.StatusOK, "view.tmpl", gin.H{ "Title": title, + "WikiName": RuntimeArgs.WikiName, "Body": template.HTML([]byte(html2)), "Versions": versions, }) @@ -172,6 +175,7 @@ func renderList(c *gin.Context, title string) { c.HTML(http.StatusOK, "list.tmpl", gin.H{ "Title": title, + "WikiName": RuntimeArgs.WikiName, "ListItems": listItems, }) } diff --git a/templates/index.tmpl b/templates/index.tmpl index ef7f259..79d918d 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -55,7 +55,7 @@ - AwwKoala + {{ .WikiName }}