From 069c587cde4937a2ab4d2216e1132332ee751931 Mon Sep 17 00:00:00 2001 From: Leni BEAULATON Date: Mon, 6 Jan 2025 09:52:44 +0100 Subject: [PATCH] =?UTF-8?q?fausses=20donn=C3=A9es=20pour=20user=20et=20val?= =?UTF-8?q?idation=20des=20citations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WF-WebAdmin/WF-WebAdmin/Model/Quote.cs | 1 + WF-WebAdmin/WF-WebAdmin/Model/User.cs | 12 +++++ WF-WebAdmin/WF-WebAdmin/Pages/Accueil.cs | 2 +- WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.cs | 21 ++++++++ .../WF-WebAdmin/Pages/DeleteUser.razor | 49 +++++++------------ WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.cs | 21 ++++++++ .../WF-WebAdmin/Pages/ValidQuote.razor | 23 ++++++++- WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor | 2 +- WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css | 16 ++++++ .../{fake-data.json => fake-dataQuote.json} | 0 .../WF-WebAdmin/wwwroot/fake-dataUser.json | 31 ++++++++++++ .../wwwroot/fake-dataValidQuote.json | 20 ++++++++ 12 files changed, 163 insertions(+), 35 deletions(-) create mode 100644 WF-WebAdmin/WF-WebAdmin/Model/User.cs create mode 100644 WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.cs create mode 100644 WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.cs rename WF-WebAdmin/WF-WebAdmin/wwwroot/{fake-data.json => fake-dataQuote.json} (100%) create mode 100644 WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUser.json create mode 100644 WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataValidQuote.json diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs b/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs index 7ef671e..9fcb751 100644 --- a/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs +++ b/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs @@ -10,5 +10,6 @@ public DateTime DateSrc { get; set; } public int Like { get; set; } public string Langue { get; set; } + public string UserProposition { get; set; } } } diff --git a/WF-WebAdmin/WF-WebAdmin/Model/User.cs b/WF-WebAdmin/WF-WebAdmin/Model/User.cs new file mode 100644 index 0000000..d599e5b --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/User.cs @@ -0,0 +1,12 @@ +namespace WF_WebAdmin.Model +{ + public class User + { + public int Id { get; set; } + public string Image { get; set; } + public string Name { get; set; } + public string Email { get; set; } + public DateTime DateCreation { get; set; } + + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.cs b/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.cs index 4858265..6553676 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.cs @@ -16,7 +16,7 @@ namespace WF_WebAdmin.Pages protected override async Task OnInitializedAsync() { - quotes = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-data.json"); + quotes = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-dataQuote.json"); } } } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.cs b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.cs new file mode 100644 index 0000000..e913791 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.cs @@ -0,0 +1,21 @@ +using Microsoft.AspNetCore.Components; +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Pages +{ + public partial class DeleteUser + { + private User[] users; + + [Inject] + public HttpClient Http { get; set; } + + [Inject] + public NavigationManager NavigationManager { get; set; } + + protected override async Task OnInitializedAsync() + { + users = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-dataUser.json"); + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor index aa80b37..933820d 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor @@ -2,40 +2,25 @@ Gestion utilisateur -

Gestion des utilisateurs

- -

Utilisateurs présents:

- -
- -

Identifiant d'utilisateur : 345

-

Nom d'utilisateur : Demo

-

Email de l'utilisateur : demo@gmail.com

-

Date de création de l'utilisateur : 12/12/24

- -
- - - - @code { } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.cs b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.cs new file mode 100644 index 0000000..b8cd783 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.cs @@ -0,0 +1,21 @@ +using Microsoft.AspNetCore.Components; +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Pages +{ + public partial class ValidQuote + { + private Quote[] quotes; + + [Inject] + public HttpClient Http { get; set; } + + [Inject] + public NavigationManager NavigationManager { get; set; } + + protected override async Task OnInitializedAsync() + { + quotes = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-dataValidQuote.json"); + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor index ba82a6e..595445f 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor @@ -1,5 +1,26 @@ @page "/ValidQuote" +@if(quotes != null){ +

Citations non validées

+

Citations en attente de validation:

+ + @foreach(var quote in quotes) + { +
+ +

Identifiant de la citation :@quote.Id

+

Citation:@quote.Content

+

Personnage : @quote.Charac

+

Source : @quote.TitleSrc

+

Langue : @quote.Langue

+

@quote.UserProposition a proposé cette citation

+ + +
+ } +} + + + -

ValidQuote

diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor index fe2ca2d..2e82fc0 100644 --- a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor +++ b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor @@ -21,7 +21,7 @@ diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css b/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css index dd9be2b..d91bb8d 100644 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css @@ -72,4 +72,20 @@ button { border-radius: 25px; background-color: lightgrey; padding: 1vh; +} + +/*Page DeleteUser*/ +.userDiv, .QuoteDiv { + margin-right: 20px; + margin-bottom: 10px; + border-radius: 25px; + background-color: #C3C4C5; +} + +.imgProfil, .imgQuote { + border-radius: 25px; +} + +.pseudo, .mail, .idUser, .dateCrea, .idQuote, .contentQuote, .CaracterQuote, .SourceQuote, .langueQuote, .UserPropositionQuote { + margin-left: 10px; } \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-data.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json similarity index 100% rename from WF-WebAdmin/WF-WebAdmin/wwwroot/fake-data.json rename to WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUser.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUser.json new file mode 100644 index 0000000..60632fc --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUser.json @@ -0,0 +1,31 @@ +[ + { + "Id": 1, + "Image": "https://tse4.mm.bing.net/th/id/OIP.fc5TQflh0cbxB1GUeOdk6gHaK8?w=123&h=180&c=7&r=0&o=5&pid=1.7", + "Name": "Demo", + "Email": "demo@gmail.com", + "DateCreation": "2024-12-12" + + }, + { + "Id": 2, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", + "Name": "exploit", + "Email": "exploit@gmail.com", + "DateCreation": "2024-11-12" + }, + { + "Id": 3, + "Image": "https://tse4.mm.bing.net/th/id/OIP.XNQPKwc1OUfvnSO9MsxDYgHaE7?w=202&h=180&c=7&r=0&o=5&pid=1.7", + "Name": "testeur", + "Email": "testeur@gmail.com", + "DateCreation": "2024-08-02" + }, + { + "Id": 4, + "Image": "https://tse2.mm.bing.net/th/id/OIP.3vXkEUJ9J8s-GsnBC6I3KAHaF0?w=185&h=180&c=7&r=0&o=5&pid=1.7", + "Name": "dev", + "Email": "dev@gmail.com", + "DateCreation": "2024-10-10" + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataValidQuote.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataValidQuote.json new file mode 100644 index 0000000..e004ed9 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataValidQuote.json @@ -0,0 +1,20 @@ +[ + { + "Id": 1, + "ImgPath": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7", + "Content": "'Dans le monde il n’y a pas d’un côté le bien et le mal, il y a une part de lumière et d’ombre en chacun de nous. Ce qui compte c’est celle que l’on choisit de montrer dans nos actes, ça c’est ce que l’on est vraiment.'", + "Charac": "Sirius Black", + "TitleSrc": "Harry Potter et L’ordre du Phoenix", + "Langue": "fr", + "UserProposition": "demo" + }, + { + "Id": 2, + "ImgPath": "https://tse2.mm.bing.net/th/id/OIP.zR4rzkK7q2wCcNwZd6jjegHaIC?w=163&h=180&c=7&r=0&o=5&pid=1.7", + "Content": "'Une autre citation'", + "Charac": "Un personnage", + "TitleSrc": "Un super film", + "Langue": "fr", + "UserProposition": "exploit" + } +] \ No newline at end of file