Ajout de la page login + affichage des commentaires par utilisateur

pull/12/head
lebeaulato 4 months ago
parent 6451b22dc3
commit b416e774af

@ -2,8 +2,8 @@
{
public class Commentary
{
public int Id { get; set; }
public int IdUser { get; set; }
//public int Id { get; set; }
//public int IdUser { get; set; }
public string Text { get; set; }
public DateTime DateCreation { get; set; }
}

@ -1,4 +1,4 @@
@page "/"
@page "/Accueil"
<PageTitle>Accueil</PageTitle>

@ -31,9 +31,10 @@ else
@if(user.Comments != null)
{
<p class="titleComments"><strong>▶ Commentaire(s) posté(s) par @user.Name : </strong></p>
@foreach (var comment in user.Comments)
{
<p class="commentaire"><strong>Commentaire (@comment.) :</strong> @comment.Text</p>
<p class="comments">@comment.DateCreation.ToShortDateString() - @comment.Text</p>
}
}
else

@ -0,0 +1,81 @@
@page "/"
<h1>▶ Connexion ◀</h1>
<div class="login">
@* <form method="post" action="{{ racine }}/validlogin"> *@
<p> <strong>Identifiant *</strong></p>
<input type="text" class="connexion" name="pseudo" id="pseudo" placeholder="Entrez votre pseudo" required />
<p> <strong> Mot de passe *</strong></p>
<input type="password" class="connexion" name="mdp" id="mdp" placeholder="Entrez votre mdp" required />
<div class="buttonSubmitDiv">
<button class="buttonSudmite">Se Connecter</button>
</div>
@* </form> *@
</div>
<style>
.buttonSubmitDiv {
text-align: center;
}
h1 {
text-align: center;
font-size: 32px;
margin-top: 10%;
}
p {
margin-top: 6%;
margin-bottom: 2%;
font-size: 20px;
font-family: "Lemon", serif;
}
.login {
width: 35vw;
margin-left: 30.5vw;
margin-top: 3vh;
border-radius: 25px;
padding: 2vw;
background-color: #cfcfcf;
}
.buttonSudmite {
border: none;
padding: 2%;
margin-top:5%;
border-radius: 25px;
width: 50%;
font-size: 1.25em;
background-color: white;
}
.connexion {
width: 94%;
height: 40px;
padding-left: 3%;
margin-left: 1%;
margin-top: -1%;
border-radius: 25px;
border: none;
font-size: 15px;
}
</style>
@code {
private void ShowFullSite()
{
// Code pour afficher l'ensemble du menu
// Cela peut être un appel à une méthode ou un service qui change l'état de la visibilité du menu
}
}

@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration.UserSecrets;
using WF_WebAdmin.Model;
namespace WF_WebAdmin.Pages
{
public partial class Login
{
}
}

@ -11,7 +11,13 @@
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="oi oi-home" aria-hidden="true"></span> Accueil
<span class="oi oi-home" aria-hidden="true"></span> Login
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="Accueil">
<span class="oi oi-plus" aria-hidden="true"></span> Accueil
</NavLink>
</div>
<div class="nav-item px-3">
@ -57,3 +63,4 @@
collapseNavMenu = !collapseNavMenu;
}
}

@ -86,7 +86,7 @@ button {
border-radius: 25px;
}
.pseudo, .mail, .idUser, .dateCrea, .idQuote, .contentQuote, .CaracterQuote, .SourceQuote, .langueQuote, .UserPropositionQuote {
.pseudo, .mail, .idUser, .dateCrea, .idQuote, .contentQuote, .CaracterQuote, .SourceQuote, .langueQuote, .UserPropositionQuote, titleComments, comments {
margin-left: 10px;
}

@ -5,7 +5,17 @@
"Name": "Admin",
"Email": "admin@gmail.com",
"DateCreation": "2024-12-12",
"IsAdmin": true
"IsAdmin": true,
"Comments": [
{
"Text": "Commentaire 1",
"DateCreation": "2024-12-12"
},
{
"Text": "Commentaire 2",
"DateCreation": "2024-11-12"
}
]
},
{
"Id": 2,
@ -21,7 +31,13 @@
"Name": "testeur",
"Email": "testeur@gmail.com",
"DateCreation": "2024-08-02",
"IsAdmin": false
"IsAdmin": false,
"Comments": [
{
"Text": "Premier test effectué, tout semble OK.",
"DateCreation": "2024-08-02"
}
]
},
{
"Id": 4,
@ -37,7 +53,13 @@
"Name": "jean_doe",
"Email": "jean.doe@gmail.com",
"DateCreation": "2024-06-25",
"IsAdmin": false
"IsAdmin": false,
"Comments": [
{
"Text": "Utilisateur très actif, peut être un peu trop intrusif.",
"DateCreation": "2024-06-25"
}
]
},
{
"Id": 6,
@ -69,7 +91,13 @@
"Name": "support_mark",
"Email": "support.mark@gmail.com",
"DateCreation": "2024-11-20",
"IsAdmin": false
"IsAdmin": false,
"Comments": [
{
"Text": "Support rapide et efficace, mais manquant un peu de détails.",
"DateCreation": "2024-11-20"
}
]
},
{
"Id": 10,
@ -85,7 +113,13 @@
"Name": "designer_steve",
"Email": "designer.steve@gmail.com",
"DateCreation": "2024-07-01",
"IsAdmin": false
"IsAdmin": false,
"Comments": [
{
"Text": "Le design doit être retravaillé pour plus de clarté.",
"DateCreation": "2024-07-01"
}
]
},
{
"Id": 12,
@ -126,37 +160,5 @@
"Email": "admin.kate@gmail.com",
"DateCreation": "2024-04-16",
"IsAdmin": true
},
{
"Id": 17,
"Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7",
"Name": "support_olivia",
"Email": "support.olivia@gmail.com",
"DateCreation": "2024-07-30",
"IsAdmin": false
},
{
"Id": 18,
"Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7",
"Name": "assistant_jack",
"Email": "assistant.jack@gmail.com",
"DateCreation": "2024-10-03",
"IsAdmin": false
},
{
"Id": 19,
"Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7",
"Name": "developer_bob",
"Email": "developer.bob@gmail.com",
"DateCreation": "2024-06-01",
"IsAdmin": false
},
{
"Id": 20,
"Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7",
"Name": "admin_sophie",
"Email": "admin.sophie@gmail.com",
"DateCreation": "2024-12-05",
"IsAdmin": true
}
]
Loading…
Cancel
Save