Adding register.pug and register route
This commit is contained in:
parent
5d2fba4d69
commit
09a9d16ae7
11 changed files with 173 additions and 115 deletions
2
app.js
2
app.js
|
@ -12,6 +12,7 @@ const loginRouter = require("./routes/login");
|
|||
const edtRouter = require("./routes/edt");
|
||||
const homeRouter = require("./routes/home");
|
||||
const marksRouter = require("./routes/marks");
|
||||
const registerRouter = require("./routes/register");
|
||||
|
||||
let app = express();
|
||||
const sessionMiddleware = session({
|
||||
|
@ -47,6 +48,7 @@ app.use("/email", require("./routes/email"));
|
|||
app.use("/edt", edtRouter);
|
||||
app.use("/home", homeRouter);
|
||||
app.use("/marks", marksRouter);
|
||||
app.use('/register', registerRouter);
|
||||
|
||||
// catch 404 and forward to error handler
|
||||
app.use((req, res) => {
|
||||
|
|
10
package-lock.json
generated
10
package-lock.json
generated
|
@ -1055,11 +1055,11 @@
|
|||
"cookie": "0.4.0",
|
||||
"cookie-signature": "1.0.6",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"on-headers": "1.0.2",
|
||||
"parseurl": "1.3.3",
|
||||
"depd": "~2.0.0",
|
||||
"on-headers": "~1.0.2",
|
||||
"parseurl": "~1.3.3",
|
||||
"safe-buffer": "5.2.0",
|
||||
"uid-safe": "2.1.5"
|
||||
"uid-safe": "~2.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"depd": {
|
||||
|
@ -3668,7 +3668,7 @@
|
|||
"resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz",
|
||||
"integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==",
|
||||
"requires": {
|
||||
"random-bytes": "1.0.0"
|
||||
"random-bytes": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"umzug": {
|
||||
|
|
|
@ -17,6 +17,20 @@ h2 {
|
|||
#signin, #signup, #forgotPsw {
|
||||
padding: 4vw; }
|
||||
|
||||
.notregister, .alreadyregister {
|
||||
border: none;
|
||||
color: #0099ff;
|
||||
background-color: transparent;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 20px;
|
||||
cursor: pointer; }
|
||||
|
||||
.invisible {
|
||||
display: none; }
|
||||
|
||||
.signinup {
|
||||
margin-top: 15vh;
|
||||
background-color: #2a2a2a;
|
||||
|
@ -34,7 +48,7 @@ h2 {
|
|||
width: 40%;
|
||||
display: block;
|
||||
margin: auto;
|
||||
font-size: 35px;
|
||||
font-size: 25px;
|
||||
border: 2px solid #2C3531;
|
||||
cursor: pointer;
|
||||
transition-duration: 0.3s; }
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -27,6 +27,20 @@ h2
|
|||
#signin, #signup, #forgotPsw
|
||||
padding: 4vw;
|
||||
|
||||
.notregister, .alreadyregister
|
||||
border: none;
|
||||
color: $secondary;
|
||||
background-color: transparent;
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 20px;
|
||||
cursor: pointer;
|
||||
|
||||
.invisible
|
||||
display: none;
|
||||
|
||||
.signinup
|
||||
margin-top: 15vh;
|
||||
background-color: $dark2;
|
||||
|
@ -45,7 +59,7 @@ h2
|
|||
width: 40%;
|
||||
display: block;
|
||||
margin: auto;
|
||||
font-size: 35px;
|
||||
font-size: 25px;
|
||||
border: 2px solid #2C3531;
|
||||
cursor: pointer;
|
||||
transition-duration: 0.3s
|
||||
|
|
8
routes/register.js
Normal file
8
routes/register.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
let express = require("express");
|
||||
let router = express.Router();
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
res.render("register", { title: "L'ETU" });
|
||||
});
|
||||
|
||||
module.exports = router;
|
|
@ -1,6 +1,6 @@
|
|||
extends index
|
||||
extends layout
|
||||
|
||||
block home
|
||||
block content
|
||||
h1(id="welcome") Welcome Back Benoit !
|
||||
div(class="row home")
|
||||
if admin === false
|
||||
|
|
101
views/index.pug
101
views/index.pug
|
@ -1,60 +1,53 @@
|
|||
extends layout
|
||||
|
||||
block content
|
||||
- var student = true
|
||||
- var teacher = false
|
||||
- var admin = false
|
||||
div(class="row" id="page")
|
||||
div(class="col s2" id="panel")
|
||||
block navbar
|
||||
if student === true
|
||||
div(id="navprofile" class="student")
|
||||
p Kezel Benoit
|
||||
p G4S3
|
||||
a Logout
|
||||
if teacher === true
|
||||
div(id="navprofile" class="teacher")
|
||||
p Kezel Benoit
|
||||
a Logout
|
||||
if admin === true
|
||||
div(id="navprofile" class="admin")
|
||||
p Kezel Benoit
|
||||
a Logout
|
||||
|
||||
div(id="navtop")
|
||||
ul
|
||||
if student === true
|
||||
div(id="navprofile" class="student")
|
||||
p Kezel Benoit
|
||||
p G4S3
|
||||
a Logout
|
||||
li
|
||||
a Home
|
||||
li(class="active")
|
||||
a Planning
|
||||
li
|
||||
a Marks
|
||||
li
|
||||
a(href="https://mail.univ-lyon1.fr/owa/") Mail
|
||||
li
|
||||
a(href="https://clarolineconnect.univ-lyon1.fr/") Claroline
|
||||
li
|
||||
a School and student life
|
||||
if teacher === true
|
||||
div(id="navprofile" class="teacher")
|
||||
p Kezel Benoit
|
||||
a Logout
|
||||
li
|
||||
a Home
|
||||
li(class="active")
|
||||
a Planning
|
||||
li
|
||||
a Marks
|
||||
li
|
||||
a(href="https://mail.univ-lyon1.fr/owa/") Mail
|
||||
li
|
||||
a(href="https://clarolineconnect.univ-lyon1.fr/") Claroline
|
||||
if admin === true
|
||||
div(id="navprofile" class="admin")
|
||||
p Kezel Benoit
|
||||
a Logout
|
||||
li(class="active")
|
||||
a Accueil
|
||||
li
|
||||
a Notes
|
||||
li
|
||||
a Vie scolaire et étudiante
|
||||
li
|
||||
a Gestion des profils
|
||||
|
||||
div(id="navtop")
|
||||
ul
|
||||
if student === true
|
||||
li
|
||||
a Home
|
||||
li(class="active")
|
||||
a Planning
|
||||
li
|
||||
a Marks
|
||||
li
|
||||
a(href="https://mail.univ-lyon1.fr/owa/") Mail
|
||||
li
|
||||
a(href="https://clarolineconnect.univ-lyon1.fr/") Claroline
|
||||
li
|
||||
a School and student life
|
||||
if teacher === true
|
||||
li
|
||||
a Home
|
||||
li(class="active")
|
||||
a Planning
|
||||
li
|
||||
a Marks
|
||||
li
|
||||
a(href="https://mail.univ-lyon1.fr/owa/") Mail
|
||||
li
|
||||
a(href="https://clarolineconnect.univ-lyon1.fr/") Claroline
|
||||
if admin === true
|
||||
li(class="active")
|
||||
a Accueil
|
||||
li
|
||||
a Notes
|
||||
li
|
||||
a Vie scolaire et étudiante
|
||||
li
|
||||
a Gestion des profils
|
||||
|
||||
div(class="col s10" id="main")
|
||||
include marks.pug
|
||||
|
|
|
@ -7,5 +7,12 @@ html
|
|||
link(rel="stylesheet", href="/stylesheets/style.css")
|
||||
script(src="/socket.io/socket.io.js")
|
||||
body
|
||||
block content
|
||||
- var student = true
|
||||
- var teacher = false
|
||||
- var admin = false
|
||||
div(class="row" id="page")
|
||||
div(class="col s2" id="panel")
|
||||
block navbar
|
||||
div(class="col s10" id="main")
|
||||
block content
|
||||
script(src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js")
|
||||
|
|
|
@ -1,55 +1,41 @@
|
|||
extends layout
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title= title
|
||||
link(href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet")
|
||||
link(rel="stylesheet", href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css")
|
||||
link(rel="stylesheet", href="/stylesheets/style.css")
|
||||
script(src="/socket.io/socket.io.js")
|
||||
body
|
||||
div(class='row main-form')
|
||||
div(class='col s12 m8 offset-m2 signinup z-depth-5' id="signin")
|
||||
h2 Welcome back
|
||||
form#login
|
||||
div(class="input-field col s12")
|
||||
i(class="material-icons prefix") mail
|
||||
input(type="text" id="mail-input" class="autocomplete")
|
||||
label(for="mail-input") Email
|
||||
|
||||
block content
|
||||
div(class='row main-form')
|
||||
div(class='col s12 m8 offset-m2 signinup z-depth-5' id="signin")
|
||||
h2 Welcome back
|
||||
form#login
|
||||
div(class="input-field col s12")
|
||||
i(class="material-icons prefix") lock
|
||||
input(type="password" id="password-input" class="autocomplete")
|
||||
label(for="password-input") Password
|
||||
|
||||
input(type='submit' value='Login')
|
||||
button(class="notregister") Not registered ?
|
||||
|
||||
|
||||
|
||||
div(class='col s12 m8 offset-m2 signinup z-depth-5 invisible' id="forgotPsw")
|
||||
h2 Forgot password
|
||||
form
|
||||
div(class="input-field col s12")
|
||||
i(class="material-icons prefix") mail
|
||||
input(type="text" id="mail-input" class="autocomplete")
|
||||
label(for="mail-input") Email
|
||||
input(type="text" id="mailforgot-input" class="autocomplete")
|
||||
label(for="mailforgot-input") Email
|
||||
|
||||
div(class="input-field col s12")
|
||||
i(class="material-icons prefix") lock
|
||||
input(type="password" id="password-input" class="autocomplete")
|
||||
label(for="password-input") Password
|
||||
input(type='submit' value='Send email')
|
||||
|
||||
input(type='submit' value='Login')
|
||||
|
||||
div(class='col s12 m8 offset-m2 signinup z-depth-5' id="signup")
|
||||
h2 Welcome
|
||||
form#register
|
||||
div(class="input-field col s6")
|
||||
i(class="material-icons prefix") portrait
|
||||
input(type="text" id="firstname-input" class="autocomplete")
|
||||
label(for="firstname-input") First Name
|
||||
|
||||
div(class="input-field col s6")
|
||||
input(type="text" id="lastname-input" class="autocomplete")
|
||||
label(for="lastname-input") Last Name
|
||||
|
||||
div(class="input-field col s12")
|
||||
i(class="material-icons prefix") mail
|
||||
input(type="text" id="mailreg-input" class="autocomplete")
|
||||
label(for="mailreg-input") Email
|
||||
|
||||
div(class="input-field col s12")
|
||||
i(class="material-icons prefix") lock
|
||||
input(type="password" id="passwordreg-input" class="autocomplete")
|
||||
label(for="passwordreg-input") Password
|
||||
|
||||
input(type='submit' value='Register')
|
||||
|
||||
div(class='col s12 m8 offset-m2 signinup z-depth-5' id="forgotPsw")
|
||||
h2 Forgot password
|
||||
form
|
||||
div(class="input-field col s12")
|
||||
i(class="material-icons prefix") mail
|
||||
input(type="text" id="mailforgot-input" class="autocomplete")
|
||||
label(for="mailforgot-input") Email
|
||||
|
||||
input(type='submit' value='Send email')
|
||||
|
||||
script(src="/javascripts/login.js")
|
||||
script(src="/javascripts/register.js")
|
||||
script(src="/javascripts/login.js")
|
||||
script(src="/javascripts/register.js")
|
||||
script(src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js")
|
34
views/register.pug
Normal file
34
views/register.pug
Normal file
|
@ -0,0 +1,34 @@
|
|||
doctype html
|
||||
html
|
||||
head
|
||||
title= title
|
||||
link(href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet")
|
||||
link(rel="stylesheet", href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css")
|
||||
link(rel="stylesheet", href="/stylesheets/style.css")
|
||||
script(src="/socket.io/socket.io.js")
|
||||
body
|
||||
div(class='row main-form')
|
||||
div(class='col s12 m8 offset-m2 signinup z-depth-5' id="signup")
|
||||
h2 Welcome
|
||||
form#register
|
||||
div(class="input-field col s6")
|
||||
i(class="material-icons prefix") portrait
|
||||
input(type="text" id="firstname-input" class="autocomplete")
|
||||
label(for="firstname-input") First Name
|
||||
|
||||
div(class="input-field col s6")
|
||||
input(type="text" id="lastname-input" class="autocomplete")
|
||||
label(for="lastname-input") Last Name
|
||||
|
||||
div(class="input-field col s12")
|
||||
i(class="material-icons prefix") mail
|
||||
input(type="text" id="mailreg-input" class="autocomplete")
|
||||
label(for="mailreg-input") Email
|
||||
|
||||
div(class="input-field col s12")
|
||||
i(class="material-icons prefix") lock
|
||||
input(type="password" id="passwordreg-input" class="autocomplete")
|
||||
label(for="passwordreg-input") Password
|
||||
|
||||
input(type='submit' value='Register')
|
||||
button(class="alreadyregister") Already registered ?
|
Reference in a new issue