Skip to content
Snippets Groups Projects
Commit 2962f2fe authored by mhdaltaweel's avatar mhdaltaweel
Browse files

document page

parent a60c2f43
No related branches found
No related tags found
1 merge request!2Doc
......@@ -33,14 +33,13 @@ app.get("/", defaut).get("/accueil",defaut);
app.get("/db/:collection", collection).get("/db", dbAdmin);
app.get("/login", (req, res) => res.render("login")).post("/login", postLogin);
//route pour creation compte
app.get("/signup" , (req ,res)=>{
res.render("signup", { title: 'Inscription' });
});
app.all("*", (req, res) => res.status(404).send("<h1>Il semblerait que cette page n'existe pas.</h1>"));
const saltRounds = 10;
app.post('/signup', async (req, res) => {
try {
......@@ -53,15 +52,32 @@ app.post('/signup', async (req, res) => {
// Insère les données dans la base de données
await db.insert('users', { username, email, password:hashedPassword });
res.send('Inscription réussie');
//res.send('Inscription réussie');
res.redirect("/login");
} catch (error) {
console.error(error);
res.status(500).send('Erreur lors de l\'inscription');
}
});
//route pour document
app.get("/document" , (req ,res)=>{
res.render("document", { title: 'doc' });
});
app.all("*", (req, res) => res.status(404).send("<h1>Il semblerait que cette page n'existe pas.</h1>"));
function defaut(req, res){
const ind = {method : req.method, url : req.url}
res.render("index",ind);
......
.spreadsheet-container {
display: flex;
justify-content: center;
margin-top: 20px;
}
table {
border-collapse: collapse;
}
td, th {
border: 1px solid #ddd;
text-align: center;
min-width: 60px;
height: 30px;
padding: 4px;
}
th {
background-color: #f4f4f4;
height: 40px;
}
tr:nth-child(odd) td {
background-color: #f9f9f9;
}
\ No newline at end of file
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f4f4f4;
}
.home-container {
text-align: center;
}
.button-container {
margin-top: 20px;
}
.button {
display: inline-block;
padding: 10px 20px;
margin: 0 10px;
text-decoration: none;
color: white;
background-color: #007bff;
border-radius: 5px;
transition: background-color 0.3s ease;
}
.button:hover {
background-color: #0056b3;
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Signup Page</title>
<link rel="stylesheet" href="/css/spreadsheet-style.css">
</head>
<body>
<%- include('partials/header') %>
<div class="spreadsheet-container">
<table>
<% for(let row = 0; row < 18; row++) { %>
<tr>
<% for(let col = 0; col < 9; col++) { %>
<% if(row === 0) { %>
<th><%= String.fromCharCode(65 + col) %></th>
<% } else { %>
<td contenteditable="true"></td>
<% } %>
<% } %>
</tr>
<% } %>
</table>
</div>
<script>
// JavaScript pour la gestion des événements peut être ajouté ici
</script>
</body>
<%- include('partials/footer') %>
</html>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Index</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Accueil</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<h1>Requête reçu</h1>
<p> La requête <%= method %> a été reçu à l'adresse <%= url %> </p>
<% if (locals.user) {%>
<p>Bonjour <%= locals.user.username %></p>
<% } else { %>
<p>Vous n'êtes pas connecté</p>
<% } %>
<div class="home-container">
<h1>Bienvenue sur Notre Application de Tableur</h1>
<p>Organisez vos données efficacement et en toute simplicité.</p>
<div class="button-container">
<a href="/login" class="button">Se Connecter</a>
<a href="/signup" class="button">S'inscrire</a>
</div>
</div>
<script>
// JavaScript pour d'autres interactions si nécessaire
</script>
</body>
</html>
\ No newline at end of file
......@@ -3,16 +3,19 @@
<head>
<meta charset="UTF-8">
<title>Connexion</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<h1>Connexion</h1>
<form action="/login" method="post">
<input type="text" name="username" value="<%= locals.username ?? '' %>">
<input type="password" name="password" value="<%= locals.password ?? '' %>">
<input type="submit" value="Se connecter">
</form>
<% if (locals.error) {%>
<p><%= locals.error %></p>
<% } %>
<div class="signin-container">
<h1>Connexion</h1>
<form action="/login" method="post">
<input type="text" name="username" value="<%= locals.username ?? '' %>">
<input type="password" name="password" value="<%= locals.password ?? '' %>">
<input type="submit" class="button" value="Se connecter">
</form>
<% if (locals.error) {%>
<p><%= locals.error %></p>
<% } %>
</div>
</body>
</html>
\ No newline at end of file
......@@ -26,6 +26,7 @@
</div>
<button type="submit">S'inscrire</button>
</form>
<p>Déjà inscrit? <a href="/login">Se connecter</a></p>
</div>
</div>
</body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment