Rename templates and port ClusterCockpit navbar + layout

This commit is contained in:
Jan Eitzinger
2022-02-01 17:48:56 +01:00
parent 3dd1d48f86
commit d24e261db2
16 changed files with 237 additions and 122 deletions

View File

@@ -190,7 +190,7 @@ func Login(db *sqlx.DB) http.Handler {
if err != nil {
log.Warnf("login of user %#v failed: %s", username, err.Error())
rw.WriteHeader(http.StatusUnauthorized)
templates.Render(rw, r, "login.html", &templates.Page{
templates.Render(rw, r, "login.tmpl", &templates.Page{
Title: "Login failed",
Login: &templates.LoginPage{
Error: "Username or password incorrect",
@@ -291,7 +291,7 @@ func Auth(next http.Handler) http.Handler {
log.Warn("authentication failed: no session or jwt found")
rw.WriteHeader(http.StatusUnauthorized)
templates.Render(rw, r, "login.html", &templates.Page{
templates.Render(rw, r, "login.tmpl", &templates.Page{
Title: "Authentication failed",
Login: &templates.LoginPage{
Error: "No valid session or JWT provided",
@@ -349,7 +349,7 @@ func Logout(rw http.ResponseWriter, r *http.Request) {
}
}
templates.Render(rw, r, "login.html", &templates.Page{
templates.Render(rw, r, "login.tmpl", &templates.Page{
Title: "Logout successful",
Login: &templates.LoginPage{
Info: "Logout successful",