diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/home.html | 30 | ||||
-rw-r--r-- | templates/layout.html | 18 | ||||
-rw-r--r-- | templates/login.html | 30 |
3 files changed, 78 insertions, 0 deletions
diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..40a0e5c --- /dev/null +++ b/templates/home.html @@ -0,0 +1,30 @@ +{{define "title"}}{{end}} + +{{define "body"}} +<div class="alert alert-info"> + Logged in as <strong>{{ .Login.MxId }}</strong> +</div> +<div class="d-flex"> + <a class="ml-auto btn btn-sm btn-dark" href="/logout">Log out</a> +</div> + +<table class="table mt-4"> + <thead> + <tr> + <th>Account name</th> + <th>Protocol</th> + <th></th> + </tr> + </thead> + <tbody> + {{range $name, $acc := .Accounts}} + <tr> + <td>{{ $name }}</td> + <td>{{ $acc.Protocol }}</td> + <td>Modifier etc</td> + </tr> + {{end}} + </tbody> +</table> + +{{end}} diff --git a/templates/layout.html b/templates/layout.html new file mode 100644 index 0000000..e67da05 --- /dev/null +++ b/templates/layout.html @@ -0,0 +1,18 @@ +<!doctype html> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + + <link rel="stylesheet" href="/static/css/bootstrap.min.css"> + + <title>{{template "title"}} Easybridge</title> +</head> +<body> + <div class="container"> + <h1>Easybridge manager</h1> + <hr /> + {{template "body" .}} + </div> +</body> +</html> diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..47435ac --- /dev/null +++ b/templates/login.html @@ -0,0 +1,30 @@ +{{define "title"}}{{end}} + +{{define "body"}} +<h4>Log in</h4> + +<div class="alert alert-info"> + Log in using your Matrix credentials on {{ .MatrixDomain }} +</div> + +<form method="POST"> + {{if .WrongPass}} + <div class="alert alert-danger">Wrong password.</div> + {{end}} + {{if .ErrorMessage}} + <div class="alert alert-danger">Unable to log in. + <div style="font-size: 0.8em">{{ .ErrorMessage }}</div> + </div> + {{end}} + <div class="form-group"> + <label for="username">Username:</label> + <input type="text" name="username" id="username" class="form-control" value="{{ .Username }}" /> + </div> + <div class="form-group"> + <label for="password">Password:</label> + <input type="password" name="password" id="password" class="form-control" /> + </div> + <button type="submit" class="btn btn-primary">Log in</button> +</form> + +{{end}} |