diff --git a/cmd/main_test.go b/cmd/main_test.go index 805550c3..356bc7d8 100644 --- a/cmd/main_test.go +++ b/cmd/main_test.go @@ -534,7 +534,7 @@ func RunServiceHandler(t *testing.T) { assert.Nil(t, err) rr := httptest.NewRecorder() route.ServeHTTP(rr, req) - assert.True(t, strings.Contains(rr.Body.String(), "Statup | Google Service")) + assert.True(t, strings.Contains(rr.Body.String(), "Google Status")) assert.True(t, strings.Contains(rr.Body.String(), "footer")) } @@ -596,7 +596,7 @@ func RunUserViewHandler(t *testing.T) { assert.Nil(t, err) rr := httptest.NewRecorder() route.ServeHTTP(rr, req) - assert.True(t, strings.Contains(rr.Body.String(), "Statup | Users")) + assert.True(t, strings.Contains(rr.Body.String(), "Statup | testadmin")) assert.True(t, strings.Contains(rr.Body.String(), "footer")) assert.True(t, handlers.IsAuthenticated(req)) } diff --git a/handlers/api_handlers_test.go b/handlers/api_handlers_test.go index be617eed..d0c3e3b0 100644 --- a/handlers/api_handlers_test.go +++ b/handlers/api_handlers_test.go @@ -241,7 +241,7 @@ func TestApiServiceDataHandler(t *testing.T) { grouping := []string{"minute", "hour", "day"} for _, g := range grouping { params := "?start=0&end=999999999999&group=" + g - rr, err := httpRequestAPI(t, "GET", "/api/services/1/data"+params, nil) + rr, err := httpRequestAPI(t, "GET", "/api/services/5/data"+params, nil) assert.Nil(t, err) body := rr.Body.String() var obj core.DateScanObj diff --git a/handlers/handlers.go b/handlers/handlers.go index 41e6c158..b56fbc45 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -143,9 +143,17 @@ var handlerFuncs = func(w http.ResponseWriter, r *http.Request) template.FuncMap "FromUnix": func(t int64) string { return utils.Timezoner(time.Unix(t, 0), core.CoreApp.Timezone).Format("Monday, January 02") }, + "NewService": func() *types.Service { + return new(types.Service) + }, + "NewUser": func() *types.User { + return new(types.User) + }, } } +var mainTmpl = `{{define "main" }} {{ template "base" . }} {{ end }}` + // executeResponse will render a HTTP response for the front end user func executeResponse(w http.ResponseWriter, r *http.Request, file string, data interface{}, redirect interface{}) { utils.Http(r) @@ -153,36 +161,49 @@ func executeResponse(w http.ResponseWriter, r *http.Request, file string, data i http.Redirect(w, r, url, http.StatusSeeOther) return } - nav, _ := source.TmplBox.String("nav.html") - footer, _ := source.TmplBox.String("footer.html") - chartIndex, _ := source.JsBox.String("chart_index.js") + + templates := []string{"base.html", "head.html", "nav.html", "footer.html", "scripts.html", "form_service.html", "form_notifier.html", "form_user.html"} + + javascripts := []string{"chart_index.js"} + render, err := source.TmplBox.String(file) if err != nil { utils.Log(4, err) } - t := template.New("message") + + // setup the main template and handler funcs + t := template.New("main") t.Funcs(handlerFuncs(w, r)) - t, err = t.Parse(nav) + t, err = t.Parse(mainTmpl) if err != nil { utils.Log(4, err) } - t, err = t.Parse(footer) - if err != nil { - utils.Log(4, err) + + // render all templates + for _, temp := range templates { + tmp, _ := source.TmplBox.String(temp) + t, err = t.Parse(tmp) + if err != nil { + utils.Log(4, err) + } } + + // render all javascript files + for _, temp := range javascripts { + tmp, _ := source.JsBox.String(temp) + t, err = t.Parse(tmp) + if err != nil { + utils.Log(4, err) + } + } + + // render the page requested _, err = t.Parse(render) if err != nil { utils.Log(4, err) } - _, err = t.Parse(chartIndex) - if err != nil { - utils.Log(4, err) - } - fmt.Println(t.Templates()) - fmt.Println(t.DefinedTemplates()) - - t.Lookup("chartIndex").Funcs(handlerFuncs(w, r)) + // execute the template err = t.Execute(w, data) if err != nil { utils.Log(4, err) diff --git a/handlers/handlers_test.go b/handlers/handlers_test.go index be42f403..dbd92d34 100644 --- a/handlers/handlers_test.go +++ b/handlers/handlers_test.go @@ -108,7 +108,7 @@ func TestServicesViewHandler(t *testing.T) { Router().ServeHTTP(rr, req) body := rr.Body.String() assert.Equal(t, 200, rr.Code) - assert.Contains(t, body, "Statup | Google Service") + assert.Contains(t, body, "Google Status") assert.Contains(t, body, "Statup made with ❤️") } @@ -252,7 +252,7 @@ func TestUsersEditHandler(t *testing.T) { Router().ServeHTTP(rr, req) body := rr.Body.String() assert.Equal(t, 200, rr.Code) - assert.Contains(t, body, "Statup | Users") + assert.Contains(t, body, "Statup | admin") assert.Contains(t, body, "

User admin

") assert.Contains(t, body, "value=\"info@statup.io\"") assert.Contains(t, body, "value=\"##########\"") @@ -347,7 +347,7 @@ func TestViewHTTPServicesHandler(t *testing.T) { Router().ServeHTTP(rr, req) body := rr.Body.String() assert.Equal(t, 200, rr.Code) - assert.Contains(t, body, "Statup | Crystal Castles - Kept Service") + assert.Contains(t, body, "Crystal Castles - Kept Status") assert.Contains(t, body, "Statup made with ❤️") } @@ -358,7 +358,7 @@ func TestViewTCPServicesHandler(t *testing.T) { Router().ServeHTTP(rr, req) body := rr.Body.String() assert.Equal(t, 200, rr.Code) - assert.Contains(t, body, "Statup | Local Postgres Service") + assert.Contains(t, body, "Local Postgres Status") assert.Contains(t, body, "Statup made with ❤️") } @@ -403,7 +403,7 @@ func TestServicesUpdateHandler(t *testing.T) { Router().ServeHTTP(rr, req) body := rr.Body.String() assert.Equal(t, 200, rr.Code) - assert.Contains(t, body, "Statup | The Bravery - An Honest Mistake Service") + assert.Contains(t, body, "The Bravery - An Honest Mistake Status") assert.Contains(t, body, "Statup made with ❤️") } diff --git a/source/tmpl/base.html b/source/tmpl/base.html index 0a26ceea..9396c24d 100644 --- a/source/tmpl/base.html +++ b/source/tmpl/base.html @@ -1,21 +1,11 @@ +{{ define "base" }} - - - -{{if USE_CDN}} - - - -{{ else }} - - - -{{end}} - - {{.Name}} Status - +{{block "head" .}} {{end}} - + {{template "content" .}} + +{{template "scripts" .}} +{{end}} diff --git a/source/tmpl/dashboard.html b/source/tmpl/dashboard.html index 14de330c..faa882f3 100644 --- a/source/tmpl/dashboard.html +++ b/source/tmpl/dashboard.html @@ -1,97 +1,57 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - - Statup | Dashboard - - - - +{{define "title"}}Statup | Dashboard{{end}} +{{define "content"}}
- {{template "nav" }} -
- -
- -
- {{ CoreApp.ServicesCount }} - Total Services -
- -
- {{ CoreApp.Count24HFailures }} - Failures last 24 Hours -
- -
- {{ CoreApp.CountOnline }} - Online Services -
-
- -
- -
- -

Services

- -
- {{ range Services }} - -
-
{{.Name}}
- {{if .Online}} ONLINE {{else}} OFFLINE {{end}} -
-

{{.SmallText}}

-
- {{ end }} +
+
+ {{ CoreApp.ServicesCount }} + Total Services +
+
+ {{ CoreApp.Count24HFailures }} + Failures last 24 Hours +
+
+ {{ CoreApp.CountOnline }} + Online Services +
+
+
+
+

Services

+ + + {{ range Services }} + {{ if .LimitedFailures }} +

{{.Name}} Failures

+
+ {{ range .LimitedFailures }} + +
+
{{.ParseError}}
+ {{.Ago}} +
+

{{.Issue}}

+
+ {{ end }} +
+ {{ end }} + {{ end }} + +
- - {{ range Services }} - {{ if .LimitedFailures }} -

{{.Name}} Failures

-
- {{ range .LimitedFailures }} - -
-
{{.ParseError}}
- {{.Ago}} -
-

{{.Issue}}

-
- {{ end }} -
- {{ end }} - {{ end }} - -
-
- -{{template "footer"}} - -{{if USE_CDN}} - - - -{{ else }} - - - {{end}} - - - diff --git a/source/tmpl/error_404.html b/source/tmpl/error_404.html index 0ead8898..86b90624 100644 --- a/source/tmpl/error_404.html +++ b/source/tmpl/error_404.html @@ -1,44 +1,10 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - - Statup | Page Not Found - - - - +{{define "title"}}Statup Page Not Found{{end}} +{{define "content"}}
-
- - - -
-
- -{{template "footer"}} - -{{if USE_CDN}} - - - -{{ else }} - - - {{end}} - - - \ No newline at end of file diff --git a/source/tmpl/footer.html b/source/tmpl/footer.html index 95056d1b..e93201d2 100644 --- a/source/tmpl/footer.html +++ b/source/tmpl/footer.html @@ -1,9 +1,9 @@ {{ define "footer"}} - + {{ end }} diff --git a/source/tmpl/form_notifier.html b/source/tmpl/form_notifier.html new file mode 100644 index 00000000..9daf56f0 --- /dev/null +++ b/source/tmpl/form_notifier.html @@ -0,0 +1,65 @@ +{{define "form_notifier"}} +{{$n := .Select}} +
+{{if $n.Title}}

{{$n.Title}}

{{end}} +{{if $n.Description}}

{{safe $n.Description}}

{{end}} + +{{range .Form}} +
+ + + {{if .SmallText}}{{safe .SmallText}}{{end}} +
+{{end}} + +
+
+
+
+
Limit
+
+ +
+
Per Minute
+
+
+
+ +
+ + + + +
+ + + +
+ +
+ + {{if $n.CanTest}} +
+ +
+ +
+ + + +
+ {{end}} + +
+ +{{if $n.Author}} + + {{$n.Title}} Notifier created by {{$n.Author}} + +{{ end }} +
+{{end}} diff --git a/source/tmpl/form_service.html b/source/tmpl/form_service.html new file mode 100644 index 00000000..a268e1a6 --- /dev/null +++ b/source/tmpl/form_service.html @@ -0,0 +1,93 @@ +{{define "form_service"}} +{{$url := "/service"}} +{{if .}} + {{$url = "/service/{{.Id}}"}} +{{end}} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + You can insert Regex to validate the response +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + 10,000+ will be checked in Microseconds (1 millisecond = 1000 microseconds). +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+{{end}} diff --git a/source/tmpl/form_user.html b/source/tmpl/form_user.html new file mode 100644 index 00000000..e96ad8ca --- /dev/null +++ b/source/tmpl/form_user.html @@ -0,0 +1,43 @@ +{{define "form_user"}} +{{$url := "/user"}} +{{if .}} + {{$url = "/user/{{.Id}}"}} +{{end}} +
+
+ +
+ +
+
+ + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+{{end}} diff --git a/source/tmpl/head.html b/source/tmpl/head.html new file mode 100644 index 00000000..477f36b0 --- /dev/null +++ b/source/tmpl/head.html @@ -0,0 +1,17 @@ +{{ define "head"}} + + + +{{if USE_CDN}} + + + +{{ else }} + + + +{{end}} +{{block "extra_css" .}} {{end}} +{{block "title" .}} {{end}} + +{{end}} diff --git a/source/tmpl/help.html b/source/tmpl/help.html index c2058256..5b4510fa 100644 --- a/source/tmpl/help.html +++ b/source/tmpl/help.html @@ -1,31 +1,15 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - Statup | Help - - - +{{define "title"}}Statup | Help{{end}} +{{define "content"}}
- {{if Auth}} {{template "nav"}} {{end}} - -
- {{ safe . }} -
- +
+ {{ safe . }} +
- +{{end}} +{{define "extra_css"}} - -{{template "footer"}} - -{{if USE_CDN}} - - - -{{ else }} - - - {{end}} - - - diff --git a/source/tmpl/index.html b/source/tmpl/index.html index 88ea3224..a8ba2649 100644 --- a/source/tmpl/index.html +++ b/source/tmpl/index.html @@ -1,29 +1,11 @@ - - - - - - {{if USE_CDN}} - - - - {{ else }} - - - - {{end}} - - {{.Name}} Status - - - +{{define "title"}}{{CoreApp.Name}} Status{{end}} +{{define "content"}}
-

{{.Name}}

- {{ if .Description }} -
{{ .Description }}
- {{ end }} +{{ if .Description }} +
{{ .Description }}
+{{ end }}
@@ -40,8 +22,7 @@
- -
+
{{ if not Services }} {{end}} - {{ range Services }} -
-
-
-
-

{{ .Name }} - {{if .Online}} - ONLINE - {{ else }} - OFFLINE - {{end}}

+{{ range Services }} +
+
+
+
+

{{ .Name }} + {{if .Online}} + ONLINE + {{ else }} + OFFLINE + {{end}}

-
-
- {{.Online24}}% - Online last 24 Hours -
-
- {{.AvgTime}}ms - Average Response -
-
- {{.AvgUptime24}}% - Uptime last 24 Hours -
+
+
+ {{.Online24}}% + Online last 24 Hours
+
+ {{.AvgTime}}ms + Average Response +
+
+ {{.AvgUptime24}}% + Uptime last 24 Hours +
+
-
-
- {{ if .AvgUptime24 }} -
- -
- {{ end }} -
-
- {{.SmallText}} -
- -
+ {{ if .AvgUptime24 }} +
+ +
{{ end }} +
+
+ {{.SmallText}} +
+ +
+
-
- -{{template "footer"}} - -{{if USE_CDN}} - - - - -{{ else }} - - - - -{{end}} - -{{ if .Style }} - {{ end }} - +
+
+{{end}} +{{define "extra_scripts"}} - - - +{{end}} diff --git a/source/tmpl/login.html b/source/tmpl/login.html index 5fea4b59..9db0ed79 100644 --- a/source/tmpl/login.html +++ b/source/tmpl/login.html @@ -1,69 +1,34 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - Statup | Login - - - - +{{define "title"}}Statup Login{{end}} +{{define "content"}}
- -
- -
- -
- - {{ if .Error }} - - {{ end }} - -
-
- -
- -
-
-
- -
- -
-
-
-
- -
-
-
- +
+
+
- + {{ if .Error }} + + {{ end }} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
- -{{template "footer"}} - -{{if USE_CDN}} - - - -{{ else }} - - - {{end}} - - - \ No newline at end of file diff --git a/source/tmpl/logs.html b/source/tmpl/logs.html index e9b1640d..94c2b6f2 100644 --- a/source/tmpl/logs.html +++ b/source/tmpl/logs.html @@ -1,45 +1,15 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - Statup | Logs - - - +{{define "title"}}Statup | Logs{{end}} +{{define "content"}}
- {{if Auth}} {{template "nav"}} {{end}} - -
- - - -
- +
+ +
- -{{template "footer"}} - -{{if USE_CDN}} - - - -{{ else }} - - - {{end}} - +{{define "extra_css"}} - - - \ No newline at end of file +{{end}} diff --git a/source/tmpl/scripts.html b/source/tmpl/scripts.html new file mode 100644 index 00000000..d198df88 --- /dev/null +++ b/source/tmpl/scripts.html @@ -0,0 +1,14 @@ +{{define "scripts"}} +{{if USE_CDN}} + + + + +{{ else }} + + + + +{{end}} +{{block "extra_scripts" .}} {{end}} +{{end}} diff --git a/source/tmpl/service.html b/source/tmpl/service.html index 58de3f60..4adc134e 100644 --- a/source/tmpl/service.html +++ b/source/tmpl/service.html @@ -1,22 +1,6 @@ +{{define "title"}}{{.Service.Name}} Status{{end}} +{{ define "content" }} {{$s := .Service}} - - - - - -{{if USE_CDN}} - - - -{{ else }} - - - -{{end}} - - Statup | {{$s.Name}} Service - -
@@ -24,228 +8,130 @@ {{template "nav"}} {{end}} -
+
- {{if $s.Online }} - ONLINE - {{ else }} - OFFLINE - {{end}} + {{if $s.Online }} + ONLINE + {{ else }} + OFFLINE + {{end}} -

{{ $s.Name }} - {{if $s.Online }} - ONLINE - {{ else }} - OFFLINE - {{end}}

+

{{ $s.Name }} + {{if $s.Online }} + ONLINE + {{ else }} + OFFLINE + {{end}}

-
- -
- {{$s.Online24}}% - Online last 24 Hours -
- -
- {{$s.AvgTime}}ms - Average Response -
- -
- {{$s.TotalUptime}}% - Total Uptime -
-
- -
- -
- -
- {{FromUnix .Start}} - {{FromUnix .End}} - - - -
-
-
- - {{if not $s.Online}} -
{{$s.DowntimeText}}
- {{end}} - - {{ if $s.LimitedFailures }} -
- {{ range $s.LimitedFailures }} - -
-
{{.ParseError}}
- {{.Ago}} -
-

{{.Issue}}

-
- {{ end }} -
- {{ end }} +
+
+ {{$s.Online24}}% + Online last 24 Hours
+
+ {{$s.AvgTime}}ms + Average Response +
+ +
+ {{$s.TotalUptime}}% + Total Uptime +
+
+ +
+ +
+ +
+ {{FromUnix .Start}} + {{FromUnix .End}} + + + +
+
+
+ + {{if not $s.Online}} +
{{$s.DowntimeText}}
+ {{end}} + + {{ if $s.LimitedFailures }} +
+ {{ range $s.LimitedFailures }} + +
+
{{.ParseError}}
+ {{.Ago}} +
+

{{.Issue}}

+
+ {{ end }} +
+ {{ end }} + +
{{if Auth}} -
+
-

Edit Service

+

Edit Service

-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- - You can insert Regex to validate the response -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- - 10,000+ will be checked in Microseconds (1 millisecond = 1000 microseconds). -
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
- -
-
+ {{template "form_service" $s}} -
+
-
-

Last Response

- -
- -
- +
+

Last Response

+ +
+ +
+ +
-
-
-

Service Checkins

-{{ range $s.Checkins }} -
Check #{{.Id}} Checked in {{.Ago}}
- -{{ end }} +
+

Service Checkins

+ {{ range $s.Checkins }} +
Check #{{.Id}} Checked in {{.Ago}}
+ + {{ end }} -
-
- -
- + +
+ +
+ +
+
+ +
-
- +
+
+ +
-
-
-
- -
-
- -
+ +
{{end}} - -
- -{{template "footer"}} - +{{end}} +{{define "extra_scripts"}} {{if USE_CDN}} - - - - {{ else }} - - - - {{end}} - +{{$s := .Service}} - - - +{{end}} diff --git a/source/tmpl/services.html b/source/tmpl/services.html index 96a13500..f38ec274 100644 --- a/source/tmpl/services.html +++ b/source/tmpl/services.html @@ -1,157 +1,49 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - Statup | Services - - - - +{{define "title"}}Statup | Services{{end}} +{{define "content"}}
- {{template "nav"}}

Services

- - - - - - - - - - {{range .}} - - - - - - {{end}} - -
NameStatus
{{.Name}}{{if .Online}}ONLINE{{else}}OFFLINE{{end}} -
- View - Delete -
-
+ + + + + + + + + + {{range .}} + + + + + + {{end}} + +
NameStatus
{{.Name}}{{if .Online}}ONLINE{{else}}OFFLINE{{end}} +
+ View + Delete +
+
-

Create Service

+

Create Service

-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- - You can insert Regex to validate the response -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- - 10,000+ will be checked in Microseconds (1 millisecond = 1000 microseconds). -
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
-
-
- -
+ {{template "form_service" NewService}}
- -{{template "footer"}} - -{{if USE_CDN}} - - - - -{{ else }} - - - - +
+{{end}} +{{define "extra_scripts"}} +{{if USE_CDN}} + +{{ else }} + {{end}} - - - - \ No newline at end of file +{{end}} diff --git a/source/tmpl/settings.html b/source/tmpl/settings.html index 0d502593..69223580 100644 --- a/source/tmpl/settings.html +++ b/source/tmpl/settings.html @@ -1,265 +1,182 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - - - - Statup | Settings - - - - +{{define "title"}}Statup | Settings{{end}} +{{define "content"}}
- {{template "nav"}} -
-
- -
- - -
+
{{if Error}} {{end}} -
-
-

Settings

+
+
+

Settings

-
+ -
- - -
- -
- - -
- -
-
- - +
+ +
-
- - - + +
+ + +
+ +
+
+ + +
+
+ + + +
+
-
- -
- - -
- -
- Current: {{.CurrentTime}} - -
- - - -
- -
- +
+ +
-
-
- -
- - You can Regenerate API Keys if you need to. +
+ Current: {{.CurrentTime}} +
-
- + - - -
- -
- - {{if not .UsingAssets }} - Enable Local Assets - {{ else }} -
- -
-
- +
+ +
+ +
-
- -
-
- -
-
- - Delete All Assets - - {{end}} -
- {{ range .Notifications }} - {{$n := .Select}} -
-
- {{if $n.Title}}

{{$n.Title}}

{{end}} - {{if $n.Description}}

{{safe $n.Description}}

{{end}} +
+ +
+ + You can Regenerate API Keys if you need to. +
+
- {{range .Form}} -
- - - {{if .SmallText}}{{safe .SmallText}}{{end}} -
+ + +
+ +
+ +
+ + {{if not .UsingAssets }} + Enable Local Assets + {{ else }} +
+ +
+
+ +
+
+ +
+
+ +
+
+ + Delete All Assets +
{{end}} - -
-
-
-
-
Limit
-
- -
-
Per Minute
-
-
-
- - - - -
+ {{ range .Notifications }} + {{$n := .Select}} +
- + {{template "form_notifier" .}} -
- -
- - {{if $n.CanTest}} -
- -
- -
- - - -
- {{end}} - -
- - {{if $n.Author}} - - {{$n.Title}} Notifier created by {{$n.Author}} - - {{ end }} - - - {{ if $n.Logs }} - Sent {{$n.SentLastHour}} in the last hour
+ {{ if $n.Logs }} + Sent {{$n.SentLastHour}} in the last hour
{{ range $n.Logs }}
- {{.Message}} -

Sent {{.Time.Ago}}

+ {{.Message}} +

Sent {{.Time.Ago}}

{{ end }} + {{ end }} +
{{ end }} -
- {{ end }} -
- {{ range .Repos }} +
+ {{ range .Repos }}
{{ .Name }}
@@ -267,13 +184,13 @@ Add
- {{ end }} -
+ {{ end }} +
- + {{ range .Plugins }} @@ -289,32 +206,19 @@
{{end}} +
-
+
-
-{{template "footer"}} - -{{if USE_CDN}} - - -{{ else }} - - {{end}} - +{{define "extra_css"}} + + +{{end}} +{{define "extra_scripts"}} - -{{if USE_CDN}} - -{{else}} - {{end}} - - - - diff --git a/source/tmpl/setup.html b/source/tmpl/setup.html index 8974448d..8b92e66b 100644 --- a/source/tmpl/setup.html +++ b/source/tmpl/setup.html @@ -1,131 +1,93 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - - Statup | Setup - - - - +{{define "title"}}Statup | Setup{{end}} +{{define "content"}}
-
-
- - {{ if .Error }} - - {{ end }} - -
- -
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - + {{ if .Error }} + + {{ end }} + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
+
-
+
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
+
-
+
+
+ +
+
- - - -
- - - -
-
- -{{template "footer"}} - -{{if USE_CDN}} - - - -{{ else }} - - +{{end}} +{{define "extra_scripts"}} {{end}} - - - \ No newline at end of file diff --git a/source/tmpl/user.html b/source/tmpl/user.html index 51c72360..b2ca54b9 100644 --- a/source/tmpl/user.html +++ b/source/tmpl/user.html @@ -1,81 +1,10 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - - Statup | Users - - - - +{{define "title"}}Statup | {{.Username}}{{end}} +{{define "content"}}
- {{template "nav"}} -
-

User {{.Username}}

-
-
- -
- -
-
- - - - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
-
-
- + {{template "form_user" .}}
-
- -{{template "footer"}} - -{{if USE_CDN}} - - - -{{ else }} - - - {{end}} - - - \ No newline at end of file diff --git a/source/tmpl/users.html b/source/tmpl/users.html index 204c1abb..b01f10e9 100644 --- a/source/tmpl/users.html +++ b/source/tmpl/users.html @@ -1,105 +1,35 @@ - - - - - -{{if USE_CDN}} - - -{{ else }} - - -{{end}} - - Statup | Users - - - - +{{define "title"}}Statup | Users{{end}} +{{define "content"}}
- {{template "nav"}} - -
- +

Users

+ + + + + + + + + {{range .}} + + + + + {{end}} + +
Username
{{.Username}} +
+ Edit + Delete +
+
- - - - - - - - - {{range .}} - - - - - {{end}} - -
Username
{{.Username}} -
- Edit - Delete -
-
+

Create User

-

Create User

-
-
- -
- -
-
- - - - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
-
-
- -
+ {{template "form_user" NewUser}} +
- -{{template "footer"}} - -{{if USE_CDN}} - - - -{{ else }} - - - {{end}} - - - \ No newline at end of file