From b94cf83f90fdd19a2dcf1125f75c66ff436ff75a Mon Sep 17 00:00:00 2001 From: Sergio Vera Date: Tue, 7 Jan 2025 13:41:58 +0100 Subject: [PATCH] Improve users layout --- .../webserver/embedded/translations/es.yml | 1 + .../webserver/embedded/translations/fr.yml | 1 + .../webserver/embedded/views/user/edit.html | 189 +++++++++--------- .../webserver/embedded/views/user/index.html | 2 +- .../webserver/embedded/views/user/new.html | 150 +++++++------- 5 files changed, 178 insertions(+), 165 deletions(-) diff --git a/internal/webserver/embedded/translations/es.yml b/internal/webserver/embedded/translations/es.yml index a1627f5..3d322e5 100644 --- a/internal/webserver/embedded/translations/es.yml +++ b/internal/webserver/embedded/translations/es.yml @@ -43,6 +43,7 @@ "Delete": "Eliminar" "Update your profile": "Actualizar tu perfil" "Logout": "Cerrar sesión" +"New user": "Nuevo usuario" "Edit user": "Editar usuario" "Name cannot be empty": "Debes introducir un nombre" "Incorrect email address": "Dirección de correo electrónico incorrecta" diff --git a/internal/webserver/embedded/translations/fr.yml b/internal/webserver/embedded/translations/fr.yml index 5e595a5..2bd9fdf 100644 --- a/internal/webserver/embedded/translations/fr.yml +++ b/internal/webserver/embedded/translations/fr.yml @@ -43,6 +43,7 @@ "Delete": "Supprimer" "Update your profile": "Mettre à jour votre profil" "Logout": "Se déconnecter" +"New user": "Nouvel utilisateur" "Edit user": "Modifier l'utilisateur" "Name cannot be empty": "Le nom ne peut pas être vide" "Incorrect email address": "Adresse e-mail incorrecte" diff --git a/internal/webserver/embedded/views/user/edit.html b/internal/webserver/embedded/views/user/edit.html index 1d0924b..e172d04 100644 --- a/internal/webserver/embedded/views/user/edit.html +++ b/internal/webserver/embedded/views/user/edit.html @@ -1,105 +1,110 @@ - -
-
-
-
- - - {{if ne (index .Errors "name") ""}} -
- {{t .Lang .Errors.name}} +
+
+

{{t .Lang "Edit user"}}

+
+ +
+
+ +
+ + + {{if ne (index .Errors "name") ""}} +
+ {{t .Lang .Errors.name}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "username") ""}} -
- {{t .Lang .Errors.username}} +
+ + + {{if ne (index .Errors "username") ""}} +
+ {{t .Lang .Errors.username}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "email") ""}} -
- {{t .Lang .Errors.email}} +
+ + + {{if ne (index .Errors "email") ""}} +
+ {{t .Lang .Errors.email}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "sendtoemail") ""}} -
- {{t .Lang .Errors.sendtoemail}} +
+ + + {{if ne (index .Errors "sendtoemail") ""}} +
+ {{t .Lang .Errors.sendtoemail}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "wordsperminute") ""}} -
- {{t .Lang .Errors.wordsperminute}} +
+ + + {{if ne (index .Errors "wordsperminute") ""}} +
+ {{t .Lang .Errors.wordsperminute}} +
+ {{end}}
- {{end}} -
- - - -
-
-
- {{if eq .Session.Uuid .User.Uuid}} -
- - - {{if ne (index .Errors "oldpassword") ""}} -
- {{t .Lang .Errors.oldpassword}} + + + +
+
+
+ {{if eq .Session.Uuid .User.Uuid}} +
+ + + {{if ne (index .Errors "oldpassword") ""}} +
+ {{t .Lang .Errors.oldpassword}} +
+ {{end}}
{{end}} -
- {{end}} -
- - - {{if ne (index .Errors "password") ""}} -
- {{t .Lang .Errors.password .MinPasswordLength}} +
+ + + {{if ne (index .Errors "password") ""}} +
+ {{t .Lang .Errors.password .MinPasswordLength}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "confirmpassword") ""}} -
- {{t .Lang .Errors.confirmpassword}} +
+ + + {{if ne (index .Errors "confirmpassword") ""}} +
+ {{t .Lang .Errors.confirmpassword}} +
+ {{end}}
- {{end}} -
- - - + + + +
diff --git a/internal/webserver/embedded/views/user/index.html b/internal/webserver/embedded/views/user/index.html index 360fa15..d9650fb 100644 --- a/internal/webserver/embedded/views/user/index.html +++ b/internal/webserver/embedded/views/user/index.html @@ -1,6 +1,6 @@ {{$lang := .Lang}} {{$admins := .Admins}} -
+

{{t $lang "Users"}}

diff --git a/internal/webserver/embedded/views/user/new.html b/internal/webserver/embedded/views/user/new.html index f596521..9edd92a 100644 --- a/internal/webserver/embedded/views/user/new.html +++ b/internal/webserver/embedded/views/user/new.html @@ -1,81 +1,87 @@ -
-
- - - {{if ne (index .Errors "name") ""}} -
- {{t .Lang .Errors.name}} -
- {{end}} +
+
+

{{t .Lang "New user"}}

-
- - - {{if ne (index .Errors "username") ""}} -
- {{t .Lang .Errors.username}} + + +
+ + + {{if ne (index .Errors "name") ""}} +
+ {{t .Lang .Errors.name}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "email") ""}} -
- {{t .Lang .Errors.email}} +
+ + + {{if ne (index .Errors "username") ""}} +
+ {{t .Lang .Errors.username}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "sendtoemail") ""}} -
- {{t .Lang .Errors.sendtoemail}} +
+ + + {{if ne (index .Errors "email") ""}} +
+ {{t .Lang .Errors.email}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "wordsperminute") ""}} -
- {{t .Lang .Errors.wordsperminute}} +
+ + + {{if ne (index .Errors "sendtoemail") ""}} +
+ {{t .Lang .Errors.sendtoemail}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "password") ""}} -
- {{t .Lang .Errors.password .MinPasswordLength}} +
+ + + {{if ne (index .Errors "wordsperminute") ""}} +
+ {{t .Lang .Errors.wordsperminute}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "confirmpassword") ""}} -
- {{t .Lang .Errors.confirmpassword}} +
+ + + {{if ne (index .Errors "password") ""}} +
+ {{t .Lang .Errors.password .MinPasswordLength}} +
+ {{end}}
- {{end}} -
-
- - - {{if ne (index .Errors "role") ""}} -
- {{t .Lang .Errors.role}} +
+ + + {{if ne (index .Errors "confirmpassword") ""}} +
+ {{t .Lang .Errors.confirmpassword}} +
+ {{end}} +
+
+ + + {{if ne (index .Errors "role") ""}} +
+ {{t .Lang .Errors.role}} +
+ {{end}}
- {{end}} -
- - + + +