diff options
author | Andinus <andinus@nand.sh> | 2020-03-27 22:20:25 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-03-27 22:20:25 +0530 |
commit | 79b376a659a1d58db01f60ad049110363fbf15fc (patch) | |
tree | 961754d43fa2763d0ff896f3d1e5c8f567100056 | |
parent | 248dff015bf5f6ce2598678c0dac892f9f80e400 (diff) | |
download | perseus-79b376a659a1d58db01f60ad049110363fbf15fc.tar.gz |
Add version number
-rw-r--r-- | core/version.go | 6 | ||||
-rw-r--r-- | handler/web/page.go | 1 | ||||
-rw-r--r-- | handler/web/register.go | 3 | ||||
-rw-r--r-- | web/register.html | 2 |
4 files changed, 11 insertions, 1 deletions
diff --git a/core/version.go b/core/version.go new file mode 100644 index 0000000..3e45c6f --- /dev/null +++ b/core/version.go @@ -0,0 +1,6 @@ +package core + +// Version will return the current version. +func Version() string { + return "v0.1.0" +} diff --git a/handler/web/page.go b/handler/web/page.go index cf96395..647984d 100644 --- a/handler/web/page.go +++ b/handler/web/page.go @@ -9,4 +9,5 @@ type Page struct { Error []string Success []string Notice []string + Version string } diff --git a/handler/web/register.go b/handler/web/register.go index 232768e..1e76af2 100644 --- a/handler/web/register.go +++ b/handler/web/register.go @@ -8,12 +8,13 @@ import ( "strings" "tildegit.org/andinus/perseus/auth" + "tildegit.org/andinus/perseus/core" "tildegit.org/andinus/perseus/storage/sqlite3" ) // HandleRegister handles /register pages. func HandleRegister(w http.ResponseWriter, r *http.Request, db *sqlite3.DB) { - p := Page{} + p := Page{Version: core.Version()} p.Notice = []string{ "Only [a-z] & [0-9] allowed for username", "Password length must be greater than 8 characters", diff --git a/web/register.html b/web/register.html index d39e2cf..e71979e 100644 --- a/web/register.html +++ b/web/register.html @@ -45,6 +45,8 @@ / <a href="https://andinus.nand.sh/perseus">Perseus</a> <span style="float:right"> + Perseus {{ .Version }} + / <a href="https://tildegit.org/andinus/perseus"> Source Code </a> |