aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/app/handler/about/status.go')
-rw-r--r--pkg/app/handler/about/status.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkg/app/handler/about/status.go b/pkg/app/handler/about/status.go
new file mode 100644
index 0000000..1a6b05c
--- /dev/null
+++ b/pkg/app/handler/about/status.go
@@ -0,0 +1,35 @@
+package about
+
+import (
+ "html/template"
+ "net/http"
+ "soko/pkg/app/utils"
+ "soko/pkg/database"
+ "soko/pkg/models"
+ "time"
+)
+
+// Index shows the landing page of the about pages
+func Status(w http.ResponseWriter, r *http.Request) {
+ templates := template.Must(
+ template.Must(
+ template.New("status").
+ Funcs(template.FuncMap{
+ "timeSince" : time.Since,
+ }).
+ ParseGlob("web/templates/layout/*.tmpl")).
+ ParseGlob("web/templates/about/status.tmpl"))
+
+ var applicationData []*models.Application
+ database.DBCon.Model(&applicationData).Select()
+
+ templates.ExecuteTemplate(w, "status.tmpl", struct {
+ Header models.Header
+ Application models.Application
+ Applications []*models.Application
+ }{
+ Header: models.Header{Title: "About – ", Tab: "about"},
+ Application: utils.GetApplicationData(),
+ Applications: applicationData,
+ })
+}