From 0fa915dc917a63685178b20f7bd2836eec221e02 Mon Sep 17 00:00:00 2001 From: flifloo Date: Sun, 27 Sep 2020 20:58:21 +0200 Subject: [PATCH] Login, register & forget rework --- locales/en.json | 4 ++-- locales/fr.json | 4 ++-- views/forget.pug | 40 ++++++++++++++++++-------------- views/index.pug | 2 +- views/login.pug | 32 ++++++++++++++----------- views/register.pug | 58 +++++++++++++++++++++++++--------------------- 6 files changed, 78 insertions(+), 62 deletions(-) diff --git a/locales/en.json b/locales/en.json index 9367764..3eb3839 100644 --- a/locales/en.json +++ b/locales/en.json @@ -32,7 +32,6 @@ "pay": "Pay", "payment": "Payment method", "creditCard": "Credit card", - "chooseDepartment": "Choose your department", "chooseSandwich": "Choose your sandwich" }, "login": { @@ -94,5 +93,6 @@ "sandwich": "Sandwich", "contact": "Contact", "messageSend": "The message has been sent", - "forgetPassword": "Forgot your password" + "forgetPassword": "Forgot your password", + "chooseDepartment": "Choose your department" } diff --git a/locales/fr.json b/locales/fr.json index ed404e9..e3690bc 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -32,7 +32,6 @@ "pay": "Payer", "payment": "Mode de paiement", "creditCard": "CB", - "chooseDepartment": "Choisissez votre département", "chooseSandwich": "Choisissez votre sandwiche" }, "login": { @@ -95,5 +94,6 @@ "contact": "Contact", "messageSend": "Le message a bien été envoyé", "forgetPassword": "Mot de passe oublié", - "send": "send" + "send": "send", + "chooseDepartment": "Choisissez votre département" } \ No newline at end of file diff --git a/views/forget.pug b/views/forget.pug index 332068d..f034ba8 100644 --- a/views/forget.pug +++ b/views/forget.pug @@ -1,20 +1,26 @@ extends layout block content - div.card - h1=__("forgetPassword") - if (!token) - form(action="/forget" method="POST") - div.field - label(for="email")=__("email") - input#email(type="email" name="email" required) - div.field - +submit(value=__("send")) - else - form(action="/forget" method="POST") - input(type="hidden" name="token" value=token) - div.field - label(for="password")=__("password") - input#password(type="password" name="password" required) - div.field - +submit(value=__("send")) + div.container + div.row + h3=__("forgetPassword") + if (!token) + form(action="/forget" method="POST") + div.row + div.input-field.col.s12 + input#email(type="email" name="email" required) + label(for="email")=__("email") + div.row + div.input-field.col.s12 + +submit(__("send")) + else + form(action="/forget" method="POST") + div.row + input(type="hidden" name="token" value=token) + div.row + div.input-field.col.s12 + input#password(type="password" name="password" required) + label(for="password")=__("password") + div.row + div.input-field.col.s12 + +submit(__("send")) diff --git a/views/index.pug b/views/index.pug index 4f1787b..0a1c968 100644 --- a/views/index.pug +++ b/views/index.pug @@ -8,7 +8,7 @@ block content div.row div.input-field.col.s12 select(name="department" required) - option(value="" disabled selected hidden)=__("index.chooseDepartment") + option(value="" disabled selected hidden)=__("chooseDepartment") each department in departments option(value=department.name)=department.name label=__("department")+":" diff --git a/views/login.pug b/views/login.pug index 8867af1..897a555 100644 --- a/views/login.pug +++ b/views/login.pug @@ -1,18 +1,22 @@ extends layout block content - div.card - form(action="/login" method="POST") - h1=__("login.title") - div.field - label(for="username")=__("username")+":" - input#username(type="text" name="username" required) - div.field - label(for="password")=__("password")+":" - input#password(type="password" name="password" required) - div.field - +submit(value=__("login.submit")) + div.container + div.row + form(action="/login" method="POST") + h3=__("login.title") + div.row + div.input-field.col.s12 + input#username(type="text" name="username" required) + label(for="username")=__("username")+":" + div.row + div.input-field.col.s12 + input#password(type="password" name="password" required) + label(for="password")=__("password")+":" + div.row.center + div.input-field.col.s12 + +submit(__("login.submit")) - div.field - a(href="/forget") - input(type="button" value=__("forgetPassword")) + div.row.center + div.input-field.col.s12 + a.btn.waves-effect.waves-light.red(href="/forget")=__("forgetPassword") diff --git a/views/register.pug b/views/register.pug index 9a0414c..a980d81 100644 --- a/views/register.pug +++ b/views/register.pug @@ -1,29 +1,35 @@ extends layout block content - form.card(action="/register" method="POST") - h1=__("register.title") - div.field - label(for="username")=__("username")+":" - input#username(type="text" name="username" required) - div.field - label(for="email")=__("email")+":" - input#email(type="email" name="email" required) - div.field - label(for="firstName")=__("firstName")+":" - input#firstName(type="text" name="firstName" required) - div.field - label(for="lastName")=__("lastName")+":" - input#lastName(type="text" name="lastName" required) - div.field - label(for="department")=__("department")+":" - +list("department", "department-list", "department", "", "off", true) - div.field - label(for="password")=__("password")+":" - input#password(type="password" name="password" required) - div.field - +submit(value=__("register.submit")) - - datalist#department-list - each department in departments - option(value=department.name) + div.container + div.row + form(action="/register" method="POST") + h3=__("register.title") + div.row + div.input-field.col.s6 + input#username(type="text" name="username" required) + label(for="username")=__("username")+":" + div.input-field.col.s6 + input#email(type="email" name="email" required) + label(for="email")=__("email")+":" + div.row + div.input-field.col.s6 + input#firstName(type="text" name="firstName" required) + label(for="firstName")=__("firstName")+":" + div.input-field.col.s6 + input#lastName(type="text" name="lastName" required) + label(for="lastName")=__("lastName")+":" + div.row + div.input-field.col.s12 + select(name="department" required) + option(value="" disabled selected hidden)=__("chooseDepartment") + each department in departments + option(value=department.name)=department.name + label=__("department")+":" + div.row + div.input-field.col.s12 + input#password(type="password" name="password" required) + label(for="password")=__("password")+":" + div.row.center + div.input-field.col.s12 + +submit(__("register.submit"))