From 8a5ed3f507d37c52e2a68a23ced6942cc752221d Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 26 Feb 2020 22:49:27 +0100 Subject: Initial ability to configure accounts from web interface --- templates/config.html | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ templates/home.html | 43 +++++++++++++++++++------------ 2 files changed, 98 insertions(+), 16 deletions(-) create mode 100644 templates/config.html (limited to 'templates') diff --git a/templates/config.html b/templates/config.html new file mode 100644 index 0000000..2d64444 --- /dev/null +++ b/templates/config.html @@ -0,0 +1,71 @@ +{{define "title"}}Account configuration |{{end}} + +{{define "body"}} +
+

Configure account

+ Go back +
+ +{{if .ErrorMessage}} +
An error occurred. +
{{ .ErrorMessage }}
+
+{{end}} + +
+
+ + + {{if .InvalidName}} +
Invalid name (must not be empty)
+ {{end}} +
+
+ + +
+ {{$config := .Config}} + {{$errors := .Errors}} + {{range $i, $schema := .Schema}} +
+ + {{if $schema.FixedValue}} + + {{else if $schema.IsBoolean}} + {{$value := index $config $schema.Name}} + + + {{else if $schema.IsPassword}} + + {{else}} + + {{end}} + {{$error := index $errors $schema.Name}} + {{if $error}} +
{{$error}}
+ {{end}} +
+ {{end}} + +
+ +{{end}} diff --git a/templates/home.html b/templates/home.html index 40a0e5c..da3e478 100644 --- a/templates/home.html +++ b/templates/home.html @@ -8,23 +8,34 @@ Log out - - - - - - - - - - {{range $name, $acc := .Accounts}} +{{ if .Accounts }} +
Account nameProtocol
+ - - - + + + - {{end}} - -
{{ $name }}{{ $acc.Protocol }}Modifier etcAccount nameProtocol
+ + + {{range $i, $acc := .Accounts}} + + {{ $acc.AccountName }} + {{ $acc.Protocol }} + + Modify + Delete + + + {{end}} + + +{{end}} + +
Add account
+ +IRC +XMPP +Mattermost {{end}} -- cgit v1.2.3