Open platform to collect and prioritize feedback
add ico and hot reload views
goenning808b00d3427a
diff --git a/public/imgs/favicon.ico b/public/imgs/favicon.iconew file mode 100644index 000000000..af3b9b867Binary files /dev/null and b/public/imgs/favicon.ico differdiff --git a/public/imgs/wchy-logo.png b/public/imgs/wchy-logo.pngnew file mode 100644index 000000000..2f003b248Binary files /dev/null and b/public/imgs/wchy-logo.png differdiff --git a/public/imgs/wchy-logo2.png b/public/imgs/wchy-logo2.pngnew file mode 100644index 000000000..0df0dc325Binary files /dev/null and b/public/imgs/wchy-logo2.png differdiff --git a/router/renderer.go b/router/renderer.goindex 7db090587..1ef1bbf37 100644--- a/router/renderer.go+++ b/router/renderer.go@@ -17,23 +17,25 @@ type HTMLRenderer struct {templates map[string]*template.Template}+var path string+// NewHTMLRenderer creates a new HTMLRendererfunc NewHTMLRenderer() *HTMLRenderer {renderer := &HTMLRenderer{}renderer.templates = make(map[string]*template.Template)- path := "views/"+ path = "views/"if env.IsTest() {path = os.Getenv("GOPATH") + "/src/github.com/WeCanHearYou/wchy/" + path}- renderer.add(path, "index.html")+ renderer.add("index.html")return renderer}//Render a template based on parameters-func (r *HTMLRenderer) add(path, name string) {+func (r *HTMLRenderer) add(name string) {tpl, err := template.ParseFiles(path+"base.html", path+name)if err != nil {log.Fatal(err)@@ -44,6 +46,10 @@ func (r *HTMLRenderer) add(path, name string) {//Render a template based on parametersfunc (r *HTMLRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error {+ if env.IsDevelopment() {+ r.add(name)+ }+tmpl, ok := r.templates[name]if !ok {panic(fmt.Errorf("The template %s does not exist", name))diff --git a/router/router.go b/router/router.goindex 22f8a6b27..e367decd9 100644--- a/router/router.go+++ b/router/router.go@@ -21,6 +21,7 @@ func GetMainEngine(ctx *context.WchyContext) *echo.Echo {c.NoContent(http.StatusInternalServerError)}router.Use(MultiTenant(ctx))+ router.Static("/public", "public")router.GET("/", handler.Index(ctx))api := router.Group("/api")diff --git a/views/base.html b/views/base.htmlindex c2d8e961c..13f8415aa 100644--- a/views/base.html+++ b/views/base.html@@ -4,6 +4,8 @@<meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" type="text/css" href="/assets/semantic-ui-css/semantic.min.css">+ <link rel="ico" type="text/css" href="/assets/semantic-ui-css/semantic.min.css">+ <link rel="icon" type="image/x-icon" href="/public/imgs/favicon.ico"><title>{{template "title" .}}</title><style>.ideas-list .vote-col {diff --git a/views/index.html b/views/index.htmlindex b6754108e..dd7752d45 100644--- a/views/index.html+++ b/views/index.html@@ -16,30 +16,12 @@<p>A text container is used for the main container, which is useful for single column layouts</p></div>- <div class="ui container">- <ul>- </ul>- </div>-<div class="ui container ideas-list"><h3>All Ideas</h3><div class="ui divided items">{{ range $value := .Ideas }}<div class="item">- <div class="vote-col">- <div class="ui statistic">- <div class="value">- 82- </div>- <div class="label">- Votes- </div>- </div>- <button class="mini ui green button">- Vote- </button>- </div><div class="content"><a class="header">{{ $value.Title }}</a><div class="meta">