summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-09-21 12:01:51 +0200
committerKevin Chabowski <kevin@kch42.de>2013-09-21 12:01:51 +0200
commit210c7b6c0eb4dac9bd7cbd9025dcb8032320dbde (patch)
treed72ed72f5565b384893c93d10262599f76babe3f
parentac949695791da439496c4ce96ddda3153437e23a (diff)
downloadmailremind-210c7b6c0eb4dac9bd7cbd9025dcb8032320dbde.tar.gz
mailremind-210c7b6c0eb4dac9bd7cbd9025dcb8032320dbde.tar.bz2
mailremind-210c7b6c0eb4dac9bd7cbd9025dcb8032320dbde.zip
Added index page
-rw-r--r--main.go6
-rw-r--r--tpls.go2
-rw-r--r--tpls/index.tpl7
-rw-r--r--tpls/master.tpl5
4 files changed, 18 insertions, 2 deletions
diff --git a/main.go b/main.go
index 503453f..b44e7e5 100644
--- a/main.go
+++ b/main.go
@@ -7,6 +7,7 @@ import (
"github.com/gorilla/mux"
"github.com/gorilla/sessions"
"github.com/kch42/mailremind/confhelper"
+ "github.com/kch42/mailremind/model"
_ "github.com/kch42/mailremind/model/mysql"
"github.com/kch42/simpleconf"
"log"
@@ -82,6 +83,7 @@ func main() {
router.HandleFunc("/jobedit", mkHttpHandler(jobedit, tplJobedit))
router.HandleFunc("/jobedit/{ID}", mkHttpHandler(jobedit, tplJobedit))
router.HandleFunc("/settings", mkHttpHandler(settings, tplSettings))
+ router.HandleFunc("/", mkHttpHandler(index, tplIndex))
http.Handle("/", router)
@@ -89,3 +91,7 @@ func main() {
log.Fatalf("Could not ListenAndServe: %s", err)
}
}
+
+func index(user model.User, sess *sessions.Session, req *http.Request) (interface{}, model.User) {
+ return nil, user
+}
diff --git a/tpls.go b/tpls.go
index 92cbeb0..a861664 100644
--- a/tpls.go
+++ b/tpls.go
@@ -27,6 +27,7 @@ var (
tplJobs *template.Template
tplJobedit *template.Template
tplSettings *template.Template
+ tplIndex *template.Template
)
func initTpls() {
@@ -41,6 +42,7 @@ func initTpls() {
tplJobs = loadTpl(tplpath, "jobs")
tplJobedit = loadTpl(tplpath, "jobedit")
tplSettings = loadTpl(tplpath, "settings")
+ tplIndex = loadTpl(tplpath, "index")
}
type msgTpldata struct {
diff --git a/tpls/index.tpl b/tpls/index.tpl
new file mode 100644
index 0000000..af205de
--- /dev/null
+++ b/tpls/index.tpl
@@ -0,0 +1,7 @@
+{{define "title"}}Start{{end}}
+
+{{define "content"}}
+{{/* START EDITING HERE */}}
+ <strong>You should edit this start page to provide some info of your mailremind installation. Do so by editing the tpls/index.tpl template file. You need to restart mailremind to reload the template.</strong>
+{{/* STOP EDITING HERE */}}
+{{end}} \ No newline at end of file
diff --git a/tpls/master.tpl b/tpls/master.tpl
index 7d6a249..7fcd100 100644
--- a/tpls/master.tpl
+++ b/tpls/master.tpl
@@ -28,8 +28,9 @@
</div>
<div id="footer">
- © 2013 Bla bla....<br />
- Foo!
+{{/* START EDITING FOOTER HERE */}}
+ <strong>PLEASE EDIT THIS FOOTER TO CONTAIN SOME CONTACT DATA. YOU CAN DO SO BY EDITING THE tpls/master.tpl TEMPLATE.</strong>
+{{/* STOP EDITING FOOTER HERE */}}
</div>
</div>
</body>