diff options
author | Julien Dessaux | 2021-09-11 12:27:59 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-09-11 12:27:59 +0200 |
commit | aff4790d22728d89e7e2dac8af262c92087b5b39 (patch) | |
tree | a9e4ccae95529835abb0b18e856f3f40b98c0f8e /internal/webui/utils.go | |
parent | Changed the way html pages title is set (diff) | |
download | trains-aff4790d22728d89e7e2dac8af262c92087b5b39.tar.gz trains-aff4790d22728d89e7e2dac8af262c92087b5b39.tar.bz2 trains-aff4790d22728d89e7e2dac8af262c92087b5b39.zip |
Piece evry last week changes together in a big rewrite of the webui
Diffstat (limited to '')
-rw-r--r-- | internal/webui/utils.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/webui/utils.go b/internal/webui/utils.go index be8baf3..28a7add 100644 --- a/internal/webui/utils.go +++ b/internal/webui/utils.go @@ -2,6 +2,7 @@ package webui import ( "embed" + "html/template" "log" "net/http" @@ -16,6 +17,13 @@ var templatesFS embed.FS //go:embed static/* var staticFS embed.FS +// Template functions +var funcMap = template.FuncMap{ + "odd": func(i int) bool { + return i%2 == 1 + }, +} + // the environment that will be passed to our handlers type env struct { conf *config.Config |