From d6f30b71d88dc336495ba3c3770e41061d4fd237 Mon Sep 17 00:00:00 2001 From: flifloo Date: Tue, 18 Aug 2020 17:08:29 +0200 Subject: [PATCH] Add locales to profile --- locales/en.json | 11 ++++++++--- views/layout.pug | 2 +- views/profile.pug | 20 ++++++++++---------- views/register.pug | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/locales/en.json b/locales/en.json index 82b0245..b517b5f 100644 --- a/locales/en.json +++ b/locales/en.json @@ -2,7 +2,6 @@ "layout": { "home": "Home", "sandwiches": "Sandwiches", - "commands": "Commands", "administration": "Administration", "logout": "Logout", "login": "Login", @@ -32,12 +31,18 @@ }, "register": { "title": "Register", - "email": "Email", "submit": "Register" }, + "profile": { + "title": "Profile", + "infos": "Infos", + "save": "Save" + }, "firstName": "First name", "lastName": "Last name", "username": "Username", "password": "Password", - "department": "Department" + "email": "Email", + "department": "Department", + "commands": "Commands" } diff --git a/views/layout.pug b/views/layout.pug index d9627b0..7019b34 100644 --- a/views/layout.pug +++ b/views/layout.pug @@ -14,7 +14,7 @@ html a(href="/sandwiches")=__("layout.sandwiches") if user.permissions >= 2 p - - a(href="/commands")=__("layout.commands") + a(href="/commands")=__("commands") if user.permissions >= 3 p - a(href="/admin")=__("layout.administration") diff --git a/views/profile.pug b/views/profile.pug index d8faa83..50f1f0e 100644 --- a/views/profile.pug +++ b/views/profile.pug @@ -2,36 +2,36 @@ extends layout block content div.card - h1 Profile + h1=__("profile.title") form(action="/profile" method="POST") - h2 Infos + h2=__("profile.infos") div.field - label(for="username") Username: + label(for="username")=__("username")+":" input#username(type="text" name="username" value=user.username disabled required) div.field - label(for="email") Email: + label(for="email")=__("email")+":" input#email(type="email" name="email" value=user.email required) div.field - label(for="firstName") First name: + label(for="firstName")=__("firstName")+":" input#firstName(type="text" name="firstName" value=user.firstName required) div.field - label(for="lastName") Last name: + label(for="lastName")=__("lastName")+":" input#lastName(type="text" name="lastName" value=user.lastName required) div.field - label(for="department") Department: + label(for="department")=__("department")+":" input#department(type="list" list="department-list" name="department" value=user.DepartmentName required) div.field - label(for="password") Password: + label(for="password")=__("password")+":" input#password(type="password" name="password") div.field - input(type="submit" value="Save") + input(type="submit" value=__("profile.save")) datalist#department-list each department in departments option(value=department.name) div.card#userCommandList - h1 Commands + h1=__("commands") each command in commands div h2=command.id diff --git a/views/register.pug b/views/register.pug index 4f636f7..d2916ec 100644 --- a/views/register.pug +++ b/views/register.pug @@ -7,7 +7,7 @@ block content label(for="username")=__("username")+":" input#username(type="text" name="username" required) div.field - label(for="email")=__("register.email")+":" + label(for="email")=__("email")+":" input#email(type="email" name="email" required) div.field label(for="firstName")=__("firstName")+":"