fausses données pour user et validation des citations

pull/9/head
Leni BEAULATON 4 months ago
parent 32dfc656e3
commit 069c587cde

@ -10,5 +10,6 @@
public DateTime DateSrc { get; set; } public DateTime DateSrc { get; set; }
public int Like { get; set; } public int Like { get; set; }
public string Langue { get; set; } public string Langue { get; set; }
public string UserProposition { get; set; }
} }
} }

@ -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; }
}
}

@ -16,7 +16,7 @@ namespace WF_WebAdmin.Pages
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
quotes = await Http.GetFromJsonAsync<Quote[]>($"{NavigationManager.BaseUri}fake-data.json"); quotes = await Http.GetFromJsonAsync<Quote[]>($"{NavigationManager.BaseUri}fake-dataQuote.json");
} }
} }
} }

@ -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<User[]>($"{NavigationManager.BaseUri}fake-dataUser.json");
}
}
}

@ -2,40 +2,25 @@
<PageTitle>Gestion utilisateur</PageTitle> <PageTitle>Gestion utilisateur</PageTitle>
@if(users != null)
{
<h3>Gestion des utilisateurs</h3> <h3>Gestion des utilisateurs</h3>
<p>Utilisateurs présents:</p> <p>Utilisateurs présents:</p>
@foreach (var user in users)
{
<div class="userDiv"> <div class="userDiv">
<img class="imgProfil" src="https://tse4.mm.bing.net/th/id/OIP.fc5TQflh0cbxB1GUeOdk6gHaK8?w=123&h=180&c=7&r=0&o=5&pid=1.7" /> <img class="imgProfil" src="@user.Image" />
<p class="idUser"><strong>Identifiant d'utilisateur :</strong> 345</p> <p class="idUser"><strong>Identifiant d'utilisateur :</strong> @user.Id</p>
<p class="pseudo"><strong>Nom d'utilisateur :</strong> Demo</p> <p class="pseudo"><strong>Nom d'utilisateur :</strong> @user.Name</p>
<p class="mail"><strong>Email de l'utilisateur :</strong> demo@gmail.com</p> <p class="mail"><strong>Email de l'utilisateur :</strong> @user.Email</p>
<p class="dateCrea"><strong>Date de création de l'utilisateur :</strong> 12/12/24</p> <p class="dateCrea"><strong>Date de création de l'utilisateur :</strong> @user.DateCreation.ToShortDateString()</p>
<button>Supprimer l'utilisateur</button> <button>Supprimer l'utilisateur</button>
</div> </div>
<!-- A mettre dans le fichier CSS-->
<style>
.userDiv{
margin-right:20px;
border-radius:25px;
background-color:gray;
}
.imgProfil{
border-radius:25px;
} }
.pseudo, .mail, .idUser, .dateCrea {
margin-left:10px;
} }
</style>
@code { @code {
} }

@ -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<Quote[]>($"{NavigationManager.BaseUri}fake-dataValidQuote.json");
}
}
}

@ -1,5 +1,26 @@
@page "/ValidQuote" @page "/ValidQuote"
@if(quotes != null){
<h3>Citations non validées</h3>
<p>Citations en attente de validation:</p>
@foreach(var quote in quotes)
{
<div class="QuoteDiv">
<img class="imgQuote" src="@quote.ImgPath" />
<p class="idQuote"><strong>Identifiant de la citation :</strong>@quote.Id </p>
<p class="contentQuote"><strong>Citation:</strong>@quote.Content</p>
<p class="CaracterQuote"><strong>Personnage :</strong> @quote.Charac</p>
<p class="SourceQuote"><strong>Source :</strong> @quote.TitleSrc</p>
<p class="langueQuote"><strong>Langue :</strong> @quote.Langue</p>
<p class="UserPropositionQuote">@quote.UserProposition a proposé cette citation</p>
<button>Valider la citation</button>
<button>Rejetter la citation</button>
</div>
}
}
<h3>ValidQuote</h3>

@ -21,7 +21,7 @@
</div> </div>
<div class="nav-item px-3"> <div class="nav-item px-3">
<NavLink class="nav-link" href="ValidQuote"> <NavLink class="nav-link" href="ValidQuote">
<span class="oi oi-list-rich" aria-hidden="true"></span> ValidQuote <span class="oi oi-list-rich" aria-hidden="true"></span> Validation de citations
</NavLink> </NavLink>
</div> </div>

@ -73,3 +73,19 @@ button {
background-color: lightgrey; background-color: lightgrey;
padding: 1vh; 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;
}

@ -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"
}
]

@ -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 ny a pas dun côté le bien et le mal, il y a une part de lumière et dombre en chacun de nous. Ce qui compte cest celle que lon choisit de montrer dans nos actes, ça cest ce que lon est vraiment.'",
"Charac": "Sirius Black",
"TitleSrc": "Harry Potter et Lordre 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"
}
]
Loading…
Cancel
Save