Skip to content
Snippets Groups Projects
Commit 257c98f4 authored by mhdaltaweel's avatar mhdaltaweel
Browse files

Merge branch 'createDoc' of https://gitlab.univ-lorraine.fr/villaum55u/dp_projet into createDoc

parents 7c9f22bb 7e98b14d
No related branches found
No related tags found
1 merge request!2Doc
...@@ -5,7 +5,6 @@ const db = require('./db/Database.js'); ...@@ -5,7 +5,6 @@ const db = require('./db/Database.js');
const auth = require('./controller/AuthController.js'); const auth = require('./controller/AuthController.js');
const bodyParser = require('body-parser'); const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser'); const cookieParser = require('cookie-parser');
const bcrypt = require('bcrypt');
const { createHash, randomBytes } = require('crypto'); const { createHash, randomBytes } = require('crypto');
...@@ -83,6 +82,14 @@ app.get("/document", (req, res) => { ...@@ -83,6 +82,14 @@ app.get("/document", (req, res) => {
res.render("document", { title: 'Créer un Document' }); res.render("document", { title: 'Créer un Document' });
}); });
app.get("/mydocuments", (req, res) => {
if (!res.locals.user) {
return res.redirect("/login"); // Redirige vers la page de connexion si l'utilisateur n'est pas connecté
}
res.render("mydocuments", { title: 'Mes Documents' });
});
// route pour la sauvegarde de documents // route pour la sauvegarde de documents
app.post('/document/save', async (req, res) => { app.post('/document/save', async (req, res) => {
......
...@@ -20,4 +20,52 @@ ...@@ -20,4 +20,52 @@
tr:nth-child(odd) td { tr:nth-child(odd) td {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
\ No newline at end of file .navbar {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #081229;
color: white;
}
.navbar_ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #081229;
}
.navbar li {
float: left;
text-align: center;
padding: 20px 16px;
}
.navbar li a {
display: block;
color: white;
text-decoration: none;
}
.navbar li a:hover {
background-color: #111;
}
.navbar button{
float : right;
background: #0b3595;
border: 0;
outline : none;
border-radius: 30px;
color: white;
}
footer {
text-align: center;
padding: 5px;
background-color: #081229;
color: #FFF;
}
public/res/construction.png

71.6 KiB

...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Signup Page</title> <title>Création document</title>
<link rel="stylesheet" href="/css/spreadsheet-style.css"> <link rel="stylesheet" href="/css/spreadsheet-style.css">
</head> </head>
......
<!DOCTYPE html>
<html>
<head>
<title>Construction en cours</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: Arial, sans-serif;
background-color: #f1f1f1;
}
.container {
text-align: center;
}
.message {
font-size: 24px;
font-weight: bold;
color: #333;
margin-bottom: 20px;
}
.image {
width: 200px;
height: 200px;
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1 class="message">Construction en cours</h1>
<img class="image" src="res/construction.png" alt="Construction en cours">
<p>Veuillez revenir ultérieurement.</p>
</div>
</body>
</html>
<footer> <footer>
<!-- Contenu de ton pied de page ici --> <!-- Contenu de ton pied de page ici -->
<p> this is footer</p> <p> CollabSheet </p>
</footer> </footer>
</body>
</html>
...@@ -3,13 +3,22 @@ ...@@ -3,13 +3,22 @@
<p>this is header</p> <p>this is header</p>
<div class="navbar">
<% if (locals.user) { %> <ul class="navbar_ul">
<div class="main-content"> <% if (locals.user) { %>
Bonjour, <%= locals.user.username %>! <li>Bonjour, <%= locals.user.username %> !</li>
<form action="/logout" method="post"> <% } %>
<button type="submit">Se Déconnecter</button> <li><a href="/">Accueil</a></li>
</form> <li><a href="/mydocuments">Documents</a></li>
</div> <li><a href="/document">Créer un document</a></li>
<% } %> <% if (locals.user) { %>
<form action="/logout" method="post">
<li><button type="submit">Se Déconnecter</button> </li>
</form>
<% } else { %>
<li><a href="/register">Inscription</a></li>
<li><a href="/login">Connexion</a></li>
<% } %>
</ul>
</div>
</header> </header>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment