diff --git a/WF-WebAdmin/.idea/.idea.WF-WebAdmin/.idea/.gitignore b/WF-WebAdmin/.idea/.idea.WF-WebAdmin/.idea/.gitignore new file mode 100644 index 0000000..f755717 --- /dev/null +++ b/WF-WebAdmin/.idea/.idea.WF-WebAdmin/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/.idea.WF-WebAdmin.iml +/modules.xml +/contentModel.xml +/projectSettingsUpdater.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/WF-WebAdmin/.idea/.idea.WF-WebAdmin/.idea/indexLayout.xml b/WF-WebAdmin/.idea/.idea.WF-WebAdmin/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/WF-WebAdmin/.idea/.idea.WF-WebAdmin/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/WF-WebAdmin/.idea/.idea.WF-WebAdmin/.idea/vcs.xml b/WF-WebAdmin/.idea/.idea.WF-WebAdmin/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/WF-WebAdmin/.idea/.idea.WF-WebAdmin/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/DailyQuoteDTO.cs b/WF-WebAdmin/WF-WebAdmin/Converter/DailyQuoteDTO.cs new file mode 100644 index 0000000..0fb7042 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Converter/DailyQuoteDTO.cs @@ -0,0 +1,12 @@ +namespace WF_WebAdmin.Converter +{ + public class DailyQuoteDTO + { + private int Id { get; set; } + + public DailyQuoteDTO(int id) + { + this.Id = id; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/DailyQuoteExtension.cs b/WF-WebAdmin/WF-WebAdmin/Converter/DailyQuoteExtension.cs new file mode 100644 index 0000000..63ec57e --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Converter/DailyQuoteExtension.cs @@ -0,0 +1,13 @@ +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Converter +{ + public class DailyQuoteExtension + { + public DailyQuoteDTO DailyQuoteToDTO(DailyQuote dq) + { + DailyQuoteDTO dailyQuote = new DailyQuoteDTO(dq.Id); + return dailyQuote; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs new file mode 100644 index 0000000..092db9d --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs @@ -0,0 +1,43 @@ +using Microsoft.AspNetCore.DataProtection.KeyManagement; +using System; + +namespace WF_WebAdmin.Converter +{ + public class QuoteDTO + { + public int Id { get; set; } + public string Content { get; set; } + public int Likes { get; set; } + public string Langue { get; set; } + public bool? IsValide { get; set; } + public string? Reason { get; set; } + public int? IdCaracter { get; set; } + public string NameCharac { get; set; } + public int? IdSource { get; set; } + public string TitleSrc { get; set; } + public DateTime DateSrc { get; set; } + public int? IdUserVerif { get; set; } + public string NameUser { get; set; } + public int? IdImg { get; set; } + public string ImgPath { get; set; } + + public QuoteDTO(int id_quote,string content,int likes,string langue,bool? isValide,string? reason,int? id_caracter,string name_charac,int? id_source,string title,DateTime date,int? id_user_verif,string name_user ,int? id_img,string img_path) + { + this.Id = id_quote; + this.Content = content; + this.Likes = likes; + this.Langue = langue; + this.IsValide = isValide; + this.Reason = reason; + this.IdCaracter = id_caracter; + this.NameCharac = name_charac; + this.IdSource = id_source; + this.TitleSrc = title; + this.DateSrc = date; + this.IdUserVerif = id_user_verif; + this.NameUser = name_user; + this.IdImg = id_img; + this.ImgPath =img_path; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs new file mode 100644 index 0000000..088520a --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs @@ -0,0 +1,19 @@ +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Converter +{ + public class QuoteExtension + { + public QuoteDTO QuoteToDTO(Quote q) + { + QuoteDTO quote = new QuoteDTO(q.Id, q.Content, q.Like, q.Langue, null,null, null,q.Charac,null,q.TitleSrc,q.DateSrc,null,q.UserProposition,null,q.ImgPath); + return quote; + } + + public Quote DTOToQuote(QuoteDTO q) + { + Quote quote = new Quote(q.Id, q.Content,q.NameCharac,q.ImgPath,q.TitleSrc,q.DateSrc,q.Likes,q.Langue,q.NameUser); + return quote; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/UserDTO.cs b/WF-WebAdmin/WF-WebAdmin/Converter/UserDTO.cs new file mode 100644 index 0000000..53a6032 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Converter/UserDTO.cs @@ -0,0 +1,24 @@ +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Converter +{ + public class UserDTO + { + public string Image { get; set; } + public string Name { get; set; } + public string Email { get; set; } + public DateTime DateCreation { get; set; } + + public Boolean IsAdmin { get; set; } + public List Comments { get; set; } + + public UserDTO(string image, string name, string email, DateTime dateCreation) + { + + this.Image = image; + this.Name = name; + this.Email = email; + this.DateCreation = dateCreation; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/UserExtension.cs b/WF-WebAdmin/WF-WebAdmin/Converter/UserExtension.cs new file mode 100644 index 0000000..ebcf0e4 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Converter/UserExtension.cs @@ -0,0 +1,19 @@ +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Converter +{ + public class UserExtension + { + public User UserToDTO(UserDTO u) + { + User user = new User(u.Image, u.Name, u.Email, u.DateCreation,u.IsAdmin); + return user; + } + + public UserDTO DTOToUser(User u) + { + UserDTO user = new UserDTO(u.Image, u.Name, u.Email, u.DateCreation); + return user; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs b/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs new file mode 100644 index 0000000..acb43ef --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/Commentary.cs @@ -0,0 +1,10 @@ +namespace WF_WebAdmin.Model +{ + public class Commentary + { + //public int Id { get; set; } + //public int IdUser { get; set; } + public string Text { get; set; } + public DateTime DateCreation { get; set; } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Model/DailyQuote.cs b/WF-WebAdmin/WF-WebAdmin/Model/DailyQuote.cs new file mode 100644 index 0000000..a60d8a7 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/DailyQuote.cs @@ -0,0 +1,12 @@ +namespace WF_WebAdmin.Model +{ + public class DailyQuote + { + public int Id { get; set; } + + public DailyQuote(int Id) + { + this.Id = Id; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs b/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs new file mode 100644 index 0000000..c6035df --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs @@ -0,0 +1,14 @@ +namespace WF_WebAdmin.Model +{ + public class Quiz + { + public int Id { get; set; } + public string Question { get; set; } + public string AnswerA { get; set; } + public string AnswerB { get; set; } + public string AnswerC { get; set; } + public string AnswerD { get; set; } + public string CAnswer { get; set; } + public string UserProposition { get; set; } + } +} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs b/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs index 9fcb751..5a56083 100644 --- a/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs +++ b/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs @@ -1,15 +1,67 @@ -namespace WF_WebAdmin.Model +using Microsoft.AspNetCore.DataProtection.KeyManagement; + +namespace WF_WebAdmin.Model { public class Quote { public int Id { get; set; } public string Content { get; set; } + public int Like { get; set; } + public string Langue { get; set; } public string Charac { get; set; } public string ImgPath { get; set; } public string TitleSrc { get; set; } public DateTime DateSrc { get; set; } - public int Like { get; set; } + public string UserProposition { get; set; } + + public Quote(int id, string content, string charac, string imgPath, string titleSrc, DateTime dateSrc, int like, string langue, string userProposition) + { + Id = id; + Content = content; + Charac = charac; + ImgPath = imgPath; + TitleSrc = titleSrc; + DateSrc = dateSrc; + Like = like; + Langue = langue; + UserProposition = userProposition; + } + /* + public int Id { get; set; } + public string Content { get; set; } + public int Likes { get; set; } public string Langue { get; set; } - public string UserProposition { get; set; } + public bool IsValide { get; set; } + public string? Reason { get; set; } + public int IdCaracter { get; set; } + public int IdSource { get; set; } + public int? IdUserVerif { get; set; } + + public Quote(int id, string content, int likes, string langue, bool isValide, string? reason, int idCaracter, int idSource, int idUserVerif) + { + Id = id; + Content = content; + Likes = likes; + Langue = langue; + IsValide = isValide; + Reason = reason; + IdCaracter = idCaracter; + IdSource = idSource; + IdUserVerif = idUserVerif; + } + + public Quote(int id, string content, int likes, string langue, bool isValide, string? reason, int idCaracter, int idSource, int? idUserVerif) + { + Id = id; + Content = content; + Likes = likes; + Langue = langue; + IsValide = isValide; + Reason = reason; + IdCaracter = idCaracter; + IdSource = idSource; + IdUserVerif = idUserVerif; + } + */ } } diff --git a/WF-WebAdmin/WF-WebAdmin/Model/User.cs b/WF-WebAdmin/WF-WebAdmin/Model/User.cs index d599e5b..9e398dd 100644 --- a/WF-WebAdmin/WF-WebAdmin/Model/User.cs +++ b/WF-WebAdmin/WF-WebAdmin/Model/User.cs @@ -8,5 +8,19 @@ public string Email { get; set; } public DateTime DateCreation { get; set; } + public Boolean IsAdmin { get; set; } + + public List Comments { get; set; } + + public User(string image, string name, string email, DateTime dateCreation, bool isAdmin) + { + this.Image = image; + this.Name = name; + this.Email = email; + this.DateCreation = dateCreation; + IsAdmin = isAdmin; + } + + public User() { } } } diff --git a/WF-WebAdmin/WF-WebAdmin/Model/UserLogin.cs b/WF-WebAdmin/WF-WebAdmin/Model/UserLogin.cs new file mode 100644 index 0000000..b8f12b1 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/UserLogin.cs @@ -0,0 +1,22 @@ +using System; +namespace WF_WebAdmin.Model +{ + public class UserLogin + { + public int Id { get; set; } + public string Image { get; set; } + public string Name { get; set;} + public Boolean IsAdmin { get; set; } + public string Mdp { get; set; } + public UserLogin(int id,string image, string name, bool isAdmin, string mdp) + { + Id = id; + this.Image = image; + this.Name = name; + this.IsAdmin = isAdmin; + this.Mdp = mdp; + } + + public UserLogin() { } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.razor b/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.razor index bba7495..1cd75b6 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.razor @@ -1,39 +1,32 @@ -@page "/" +@page "/Accueil" Accueil -

Accueil

+

Bienvenu sur le tableau de bord de What the Fantasy

- +

Citation du jour

-@if (quotes != null) +@if (Dailyquote != null) { - - - - - - - - - - - - - - @foreach (var quote in quotes) - { - - - - - - - - - - } - -
IdContentCharactéreTitle SourceLikeLangueDate Source
@quote.Id@quote.Content@quote.Charac@quote.TitleSrc@quote.Like@quote.Langue@quote.DateSrc.ToShortDateString()
-} \ No newline at end of file + @foreach(var quote in Dailyquote) + { +
+ +

@quote.Content

+ +

Personnage : @quote.Charac

+

Source : @quote.TitleSrc

+ +
+ } + +} +else +{ +

Aucune citation du jour

+} + +

Changement de la citation manuellement

+ + diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.cs b/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.razor.cs similarity index 56% rename from WF-WebAdmin/WF-WebAdmin/Pages/Accueil.cs rename to WF-WebAdmin/WF-WebAdmin/Pages/Accueil.razor.cs index 6553676..379853e 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/Accueil.razor.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Components; +using Blazorise.DataGrid; +using Microsoft.AspNetCore.Components; using WF_WebAdmin.Model; @@ -6,7 +7,7 @@ namespace WF_WebAdmin.Pages { public partial class Accueil { - private Quote[] quotes; + private Quote[] Dailyquote; [Inject] public HttpClient Http { get; set; } @@ -16,7 +17,8 @@ namespace WF_WebAdmin.Pages protected override async Task OnInitializedAsync() { - quotes = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-dataQuote.json"); + Dailyquote = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-dataDailyQuote.json"); + } } } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor index d586324..24155f1 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor @@ -5,22 +5,58 @@

Gestion des utilisateurs

-@if (users != null) +@if(users == null) +{ +

Aucun utilisateur présent sur le site

+} + +else {

Utilisateurs présents:

@foreach (var user in users) {
-

Identifiant d'utilisateur : @user.Id

-

Nom d'utilisateur : @user.Name

+ @if (user.IsAdmin) + { +

Nom d'utilisateur : @user.Name (Administrateur)

+ } + else + { +

Nom d'utilisateur : @user.Name

+ } +

Email de l'utilisateur : @user.Email

Date de création de l'utilisateur : @user.DateCreation.ToShortDateString()

- + @if (user.Comments != null) + { +

▶ Commentaire(s) posté(s) par @user.Name :

+ @foreach (var comment in user.Comments) + { +

@comment.DateCreation.ToShortDateString() - @comment.Text

+ } + } + else + { +

Aucun commentaire sur le site

+ } + + + + @if (!user.IsAdmin) + { + + } + else + { + + } +
} - @if (showDeletePopup) + + @if (showPopupDelete) {
@@ -47,7 +83,18 @@
} } -else -{ -

Aucun utilisateurs présents sur le site

+ + + @if (showPopupAdmin) + { +
+
+

Êtes-vous sûr de vouloir changer le rôle de cet utilisateur ?

+ + +
+
+ } + + } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs index bca070f..7dc042d 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs @@ -10,8 +10,11 @@ namespace WF_WebAdmin.Pages private bool showDeletePopup = false; private bool showModifyPopup = false; private User userToDelete = null; - private User selectedUser; - + private User selectedUser; + private bool showPopupDelete = false; + private bool showPopupAdmin = false; + private User userToAdmin = null; + [Inject] public HttpClient Http { get; set; } @@ -23,15 +26,20 @@ namespace WF_WebAdmin.Pages protected override async Task OnInitializedAsync() { - userService = new UserServiceStub($"fake-dataUser.json"); + userService = new UserServiceStub($"fake-dataUsers.json"); users = await userService.GetUsersJson(); } private void ShowDeleteConfirmation(User user) + { + + } + + // ------- Popup remove user ------- + private void ShowConfirmation(User user) { - // Afficher la modale et mémoriser l'utilisateur à supprimer userToDelete = user; - showDeletePopup = true; + showPopupDelete = true; } private void ShowModifyConfirmation(User user) @@ -45,7 +53,7 @@ namespace WF_WebAdmin.Pages { if (userToDelete != null) { - userService = new UserServiceStub($"fake-dataUser.json"); + userService = new UserServiceStub($"fake-dataUsers.json"); await userService.DeleteUserJson(userToDelete.Id); ClosePopup(); } @@ -53,7 +61,7 @@ namespace WF_WebAdmin.Pages private async Task ModifyUser() { - userService = new UserServiceStub($"fake-dataUser.json"); + userService = new UserServiceStub($"fake-dataUsers.json"); await userService.UpdateUserJson(selectedUser); ClosePopup(); } @@ -62,7 +70,33 @@ namespace WF_WebAdmin.Pages { showDeletePopup = false; showModifyPopup = false; + showPopupDelete = false; + showPopupAdmin = false; + } + + + // ------- Popup admin ------- + private void ShowConfirmationAdmin(User user) + { + userToAdmin = user; + showPopupAdmin = true; } - } + + + private async Task Admin() + { + if (!userToAdmin.IsAdmin) + { + userToAdmin.IsAdmin = true; + ClosePopup(); + } + else + { + userToAdmin.IsAdmin = false; + ClosePopup(); + } + } + + } } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor b/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor new file mode 100644 index 0000000..411b655 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor @@ -0,0 +1,29 @@ +@page "/" +@using WF_WebAdmin.Model + +

▶ Connexion ◀

+ + +

Indice de connexion : admin / admin

+ + +@code { + +} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor.cs new file mode 100644 index 0000000..0fbc64d --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/Login.razor.cs @@ -0,0 +1,67 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Configuration.UserSecrets; +using WF_WebAdmin.Model; + + + +namespace WF_WebAdmin.Pages +{ + public partial class Login + { + + private UserLogin userLogin = new UserLogin(); + + [Inject] + public UserLogin uLogin { get; set; } + + private string ErrorConnexion; + + private List usersConnexion; + [Inject] + public HttpClient Http { get; set; } + + [Inject] + public NavigationManager NavigationManager { get; set; } + + protected override async Task OnInitializedAsync() + { + usersConnexion = await Http.GetFromJsonAsync>($"{NavigationManager.BaseUri}fake-dataUserLogin.json"); + + } + + + public void validlogin() + { + if (!string.IsNullOrEmpty(userLogin.Name) || !string.IsNullOrEmpty(userLogin.Mdp)) + { + foreach (var user in usersConnexion) + { + if(userLogin.Name == user.Name && userLogin.Mdp == user.Mdp) + { + if(user.IsAdmin) + { + uLogin.Id = userLogin.Id; + uLogin.Name = user.Name; + uLogin.Image = user.Image; + + NavigationManager.NavigateTo(NavigationManager.BaseUri + "/accueil"); + return; + + } + else + { + ErrorConnexion = "Connexion échouée, le nom ou le mot de passe sont incorrectes"; + } + + } + else + { + ErrorConnexion = "Connexion échouée, le nom ou le mot de passe sont incorrectes"; + } + } + + } + + } + } +} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor index ca2883e..cb8f955 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor @@ -3,7 +3,7 @@ Corection des citation -

Corection des citation

+

Correction des citations

Ajouter une recherche

diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Quiz.razor b/WF-WebAdmin/WF-WebAdmin/Pages/Quiz.razor deleted file mode 100644 index 4a38264..0000000 --- a/WF-WebAdmin/WF-WebAdmin/Pages/Quiz.razor +++ /dev/null @@ -1,4 +0,0 @@ -@page "/Quiz" - - -

Quiz

diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor new file mode 100644 index 0000000..db4c5ef --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor @@ -0,0 +1,54 @@ +@page "/ValidQuiz" +@using System.Dynamic +@using WF_WebAdmin.Model + +

Quiz à valider

+ +@if (quizzes == null) +{ +

Chargement des quiz ...

+} +else +{ +

Quizs en attente de validation :

+ + + + + + + + + + + + + + + + + @foreach (var quiz in quizzes) + { + + + + + + + + + +
+ + +
+ + } + +
#QuestionRéponse ARéponse BRéponse CRéponse DRéponse CorrecteUtilisateurActions
@quiz.Id@quiz.Question@quiz.AnswerA@quiz.AnswerB@quiz.AnswerC@quiz.AnswerD@quiz.CAnswer@quiz.UserProposition
+ +} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor.cs new file mode 100644 index 0000000..d907e84 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuiz.razor.cs @@ -0,0 +1,43 @@ +using Blazorise.DataGrid; +using Microsoft.AspNetCore.Components; +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Pages +{ + public partial class ValidQuiz + { + private Quiz[] quizzes; + private int totalQuizzes; + + [Inject] + public HttpClient Http { get; set; } + + [Inject] + public NavigationManager NavigationManager { get; set; } + + protected override async Task OnInitializedAsync() + { + quizzes = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-dataQuiz.json"); + } + + private void OnValidButton(Quiz quiz) + { + ValidateQuiz(quiz); + } + + private void ValidateQuiz(Quiz quiz) + { + Console.WriteLine($"Quiz {quiz.Id} validated!"); + } + + private void OnRejectButton(Quiz quiz) + { + RejectQuiz(quiz); + } + + private void RejectQuiz(Quiz quiz) + { + Console.WriteLine($"Quiz {quiz.Id} rejected!"); + } + } +} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor index da423b0..0f7606d 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor @@ -7,10 +7,10 @@ {

Chargement des citations...

} -else if (quotes.Count == 0) +@* else if (quotes.Count == 0) {

Aucune citation en attente de validation.

-} +} *@ else {

Citations en attente de validation :

@@ -21,16 +21,15 @@ else

ID : @quote.Id

Contenu : @quote.Content

Langue : @quote.Langue

-

Likes : @quote.Like

Personnage : @quote.Charac

Image : @quote.ImgPath

Source : @quote.TitleSrc

Date de source : @quote.DateSrc.ToShortDateString()

-

Utilisateur proposition : @quote.UserProposition

+

Utilisateur : @quote.UserProposition

- - + @* + *@
} } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor.cs index a42112a..95b04d5 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ValidQuote.razor.cs @@ -10,130 +10,18 @@ using System.Linq; namespace WF_WebAdmin.Pages { public partial class ValidQuote - { - // Chaîne de connexion à adapter - private const string connectionString = - "Host=localhost;Port=5432;Database=wikifantasy3;Username=postgres;Password=postgres"; + { + private Quote[] quotes; - private List quotes; + [Inject] + public HttpClient Http { get; set; } - protected override async Task OnInitializedAsync() - { - // On charge toutes les citations dont isValide = false - quotes = await LoadNotValidatedQuotesAsync(); - } - - /// - /// Charge toutes les citations non validées (isValide = false) - /// et mappe les colonnes vers ton modèle. - /// - private async Task> LoadNotValidatedQuotesAsync() - { - var result = new List(); + [Inject] + public NavigationManager NavigationManager { get; set; } - try - { - using var con = new NpgsqlConnection(connectionString); - await con.OpenAsync(); - - // Sélection des colonnes réellement présentes en DB - // + placeholders pour les autres - var sql = @" - SELECT - id_quote AS Id, - content AS Content, - likes AS ""Like"", - langue AS Langue, - -- Champs pas vraiment en DB : placeholders - '' AS Charac, - '' AS ImgPath, - '' AS TitleSrc, - now() AS DateSrc, - '' AS UserProposition - FROM quote - WHERE isValide = false - "; - - using var cmd = new NpgsqlCommand(sql, con); - using var reader = await cmd.ExecuteReaderAsync(); - - while (await reader.ReadAsync()) - { - var q = new Quote - { - Id = reader.GetInt32(reader.GetOrdinal("Id")), - Content = reader.GetString(reader.GetOrdinal("Content")), - Like = reader.GetInt32(reader.GetOrdinal("Like")), - Langue = reader.GetString(reader.GetOrdinal("Langue")), - // placeholders - Charac = reader.GetString(reader.GetOrdinal("Charac")), - ImgPath = reader.GetString(reader.GetOrdinal("ImgPath")), - TitleSrc = reader.GetString(reader.GetOrdinal("TitleSrc")), - DateSrc = reader.GetDateTime(reader.GetOrdinal("DateSrc")), - UserProposition = reader.GetString(reader.GetOrdinal("UserProposition")) - }; - result.Add(q); - } - } - catch (Exception ex) - { - Console.WriteLine($"[Erreur] LoadNotValidatedQuotesAsync : {ex.Message}"); - } - - return result; - } - - /// - /// Met à jour isValide = true pour la citation. - /// - private async Task ValiderQuote(int quoteId) - { - try - { - using var con = new NpgsqlConnection(connectionString); - await con.OpenAsync(); - - var sql = "UPDATE quote SET isValide = true WHERE id_quote = @Id"; - using var cmd = new NpgsqlCommand(sql, con); - cmd.Parameters.AddWithValue("Id", quoteId); - - int rowsAffected = await cmd.ExecuteNonQueryAsync(); - if (rowsAffected > 0) - { - // Supprime la quote de la liste pour l'enlever de l'affichage - quotes.RemoveAll(q => q.Id == quoteId); - } - } - catch (Exception ex) - { - Console.WriteLine($"[Erreur] ValiderQuote : {ex.Message}"); - } - } - - /// - /// Supprime complètement la citation de la base. - /// - private async Task RejeterQuote(int quoteId) + protected override async Task OnInitializedAsync() { - try - { - using var con = new NpgsqlConnection(connectionString); - await con.OpenAsync(); - - var sql = "DELETE FROM quote WHERE id_quote = @Id"; - using var cmd = new NpgsqlCommand(sql, con); - cmd.Parameters.AddWithValue("Id", quoteId); - - int rowsAffected = await cmd.ExecuteNonQueryAsync(); - if (rowsAffected > 0) - { - quotes.RemoveAll(q => q.Id == quoteId); - } - } - catch (Exception ex) - { - Console.WriteLine($"[Erreur] RejeterQuote : {ex.Message}"); - } + quotes = await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-dataQuote.json"); } } } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/_Layout.cshtml b/WF-WebAdmin/WF-WebAdmin/Pages/_Layout.cshtml index bc00141..8d65dee 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/_Layout.cshtml +++ b/WF-WebAdmin/WF-WebAdmin/Pages/_Layout.cshtml @@ -12,6 +12,7 @@ + @RenderBody() @@ -33,5 +34,6 @@ + diff --git a/WF-WebAdmin/WF-WebAdmin/Program.cs b/WF-WebAdmin/WF-WebAdmin/Program.cs index 5af7669..2a03f66 100644 --- a/WF-WebAdmin/WF-WebAdmin/Program.cs +++ b/WF-WebAdmin/WF-WebAdmin/Program.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using WF_WebAdmin.Data; using WF_WebAdmin.Service; +using WF_WebAdmin.Model; var builder = WebApplication.CreateBuilder(args); @@ -14,10 +15,12 @@ builder.Services.AddServerSideBlazor(); builder.Services.AddSingleton(); builder.Services.AddScoped(); builder.Services.AddHttpClient(); +builder.Services.AddScoped(); builder.Services .AddBlazorise() .AddBootstrapProviders() + .AddHttpClient() .AddFontAwesomeIcons(); var app = builder.Build(); diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuizService.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuizService.cs new file mode 100644 index 0000000..2a6c75f --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuizService.cs @@ -0,0 +1,25 @@ +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Service; + +public class QuizService +{ + public List GetQuizToConfirm() + { + var res = new List(); + + return res; + } + + public bool AddQuiz(Quiz quiz) + { + var res = false; + return res; + } + + public bool RemoveQuiz(Quiz quiz) + { + var res = false; + return res; + } +} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs new file mode 100644 index 0000000..6f9a9b8 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs @@ -0,0 +1,141 @@ +using WF_WebAdmin.Converter; +using WF_WebAdmin.Model; +using Npgsql; + +namespace WF_WebAdmin.Service +{ + public class QuoteServiceLocal: IQuoteService + { + private readonly string? _connectionString = "Host=localhost;Port=5432;Username=loguichard3;Password=Reglisse15.;Database=dbloguichard3"; + + + + + public async Task AddQuoteAsync(Quote quote) + { + QuoteExtension extension = new QuoteExtension(); + QuoteDTO quoteDTO = extension.QuoteToDTO(quote); + + // Utilisation de NpgsqlConnection pour PostgreSQL + using (var connection = new NpgsqlConnection(_connectionString)) + { + // Définir la requête SQL d'insertion + var commandText = "INSERT INTO Quote (content, langue, reason, id_source, id_caracter, id_user_verif, img_path) " + + "VALUES (@content, @langue, @reason, @source, @character, @user, @img_path)"; + + // Créer une commande Npgsql + var command = new NpgsqlCommand(commandText, connection); + + + /* + // Ajouter des paramètres à la commande + command.Parameters.AddWithValue("@content", quote.Content); + command.Parameters.AddWithValue("@langue", quote.Langue); + command.Parameters.AddWithValue("@reason", "À vérifier"); // Vous pouvez changer ça si nécessaire + command.Parameters.AddWithValue("@source", quote.Source); + command.Parameters.AddWithValue("@character", quote.Character); + command.Parameters.AddWithValue("@user", quote.User); // Assurez-vous que `quote.User` est correctement défini + command.Parameters.AddWithValue("@img_path", quote.ImgPath); + */ + + + try + { + // Ouvrir la connexion à la base de données + await connection.OpenAsync(); + + // Exécuter la commande d'insertion + await command.ExecuteNonQueryAsync(); + } + catch (Exception ex) + { + // Gérer les erreurs ici (par exemple, afficher ou enregistrer les erreurs) + Console.WriteLine($"Une erreur est survenue lors de l'ajout de la citation : {ex.Message}"); + } + finally + { + // Fermer la connexion (automatiquement géré avec `using`, mais ajouté pour explicitement montrer le processus) + await connection.CloseAsync(); + } + } + + // Retourner l'objet DTO pour que vous puissiez l'utiliser ailleurs dans votre application + return quoteDTO; + } + + + public Task RemoveQuote(Quote quote) + { + QuoteExtension extension = new QuoteExtension(); + QuoteDTO quoteDTO = extension.QuoteToDTO(quote); + + return Task.FromResult(quoteDTO); + } + + public Task validQuote(Quote quote) + { + QuoteExtension extension = new QuoteExtension(); + QuoteDTO quoteDTO = extension.QuoteToDTO(quote); + + return Task.FromResult(quoteDTO); + } + + public Task updateQuote(Quote quote) + { + QuoteExtension extension = new QuoteExtension(); + QuoteDTO quoteDTO = extension.QuoteToDTO(quote); + + return Task.FromResult(quoteDTO); + } + + + + + + + public Task addQuote(Quote quote) + { + throw new NotImplementedException(); + } + + public Task removeQuote(Quote quote) + { + throw new NotImplementedException(); + } + + public Task> getAllQuote() + { + throw new NotImplementedException(); + } + + public Task> getSomeQuote(int nb, int page) + { + throw new NotImplementedException(); + } + + public Task> reserchQuote(string reserch, List argument) + { + throw new NotImplementedException(); + } + + public Task> getAllQuoteInvalid() + { + throw new NotImplementedException(); + } + + public Task> getSomeQuoteInvalid(int nb, int page) + { + throw new NotImplementedException(); + } + + public Task getOnequote(int id) + { + throw new NotImplementedException(); + } + + public Task getNbQuote() + { + throw new NotImplementedException(); + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs index 6644168..36a4d21 100644 --- a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs @@ -1,4 +1,4 @@ -using System.Text.Json; +using System.Text.Json; using WF_WebAdmin.Model; namespace WF_WebAdmin.Service; @@ -32,7 +32,7 @@ namespace WF_WebAdmin.Service; } } - public async Task validQuote(Quote quote) + public async Task validQuote(Quote quote) { throw new NotImplementedException(); } @@ -83,7 +83,7 @@ namespace WF_WebAdmin.Service; { return q; } - return new Quote(); + return null; } public async Task> reserchQuote(string reserch, List argument) diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor b/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor index 2c7f47e..d62d291 100644 --- a/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor +++ b/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor @@ -1,18 +1,36 @@ -@inherits LayoutComponentBase - -WF-WebAdmin - -
- - -
-
- About -
-
- @Body -
-
-
+@using WF_WebAdmin.Model +@inherits LayoutComponentBase +@inject UserLogin uLogin + +WF-WebAdmin + + +
+ @if (uLogin.Name != null) + { + + } + +
+
+ @if (!string.IsNullOrEmpty(uLogin.Name)) + { + + @* *@ + } + else + { + + + } +
+
+ @Body +
+
+
+ + + diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor.cs b/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor.cs new file mode 100644 index 0000000..267376f --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Shared/MainLayout.razor.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Mvc; +using System; +using WF_WebAdmin.Model; + + +namespace WF_WebAdmin.Shared +{ + public partial class MainLayout + { + + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor index 5464a8c..28062bd 100644 --- a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor +++ b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor @@ -1,53 +1,61 @@ - - -
- +
+ + @code { + private bool collapseNavMenu = true; + + private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null; + + private void ToggleNavMenu() + { + collapseNavMenu = !collapseNavMenu; + } } -} + + diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/iconwf.svg b/WF-WebAdmin/WF-WebAdmin/Shared/iconwf.svg new file mode 100644 index 0000000..42908dc --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Shared/iconwf.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj b/WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj index e4eb494..a060d8e 100644 --- a/WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj +++ b/WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj @@ -1,4 +1,4 @@ - + net6.0 diff --git a/WF-WebAdmin/WF-WebAdmin/_Imports.razor b/WF-WebAdmin/WF-WebAdmin/_Imports.razor index f261bea..cbc1f08 100644 --- a/WF-WebAdmin/WF-WebAdmin/_Imports.razor +++ b/WF-WebAdmin/WF-WebAdmin/_Imports.razor @@ -9,3 +9,4 @@ @using WF_WebAdmin @using WF_WebAdmin.Shared @using Blazorise.DataGrid + diff --git a/WF-WebAdmin/WF-WebAdmin/appsettings.json b/WF-WebAdmin/WF-WebAdmin/appsettings.json index 4d56694..3ec194b 100644 --- a/WF-WebAdmin/WF-WebAdmin/appsettings.json +++ b/WF-WebAdmin/WF-WebAdmin/appsettings.json @@ -1,9 +1,12 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Host=localhost;Port=5432;Database=wikifantasy3;Username=postgres;Password=postgres" } - }, - "AllowedHosts": "*" } diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/check.png b/WF-WebAdmin/WF-WebAdmin/wwwroot/check.png new file mode 100644 index 0000000..c3fedbe Binary files /dev/null and b/WF-WebAdmin/WF-WebAdmin/wwwroot/check.png differ diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/cross.png b/WF-WebAdmin/WF-WebAdmin/wwwroot/cross.png new file mode 100644 index 0000000..c64f8bb Binary files /dev/null and b/WF-WebAdmin/WF-WebAdmin/wwwroot/cross.png differ diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css b/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css index 17da76e..0f2ae37 100644 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/css/site.css @@ -1,4 +1,5 @@ @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); +@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap'); html, body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; @@ -122,4 +123,130 @@ button { gap: 10px; width: 300px; text-align: center; +} + +table { + border-collapse: collapse; + width: 100%; +} + +td { + padding: 10px 20px; + border: none; +} + +.boutons { + display: flex; + justify-content: space-between; + gap: 10px; +} + +.boutons button { + border: none; + background-color: transparent; + padding: 5px; + cursor: pointer; +} + +.boutons button img { + width: 24px; + height: 24px; + object-fit: contain; +} + + +.buttonSubmitDiv { + text-align: center; +} + +h1 { + text-align: center; + font-size: 32px; + margin-top: 10%; + font-family: "Roboto", serif; +} + +p { + margin-bottom: 2%; + font-size: 20px; + font-family: "Roboto", serif; +} + +.login { + width: 35vw; + margin-left: 30.5vw; + margin-top: 3vh; + border-radius: 25px; + padding: 2vw; + background-color: #cfcfcf; +} + + +/*Page login*/ +.buttonSudmite { + border: none; + padding: 2%; + margin-top: 5%; + border-radius: 25px; + width: 50%; + font-size: 1.25em; + background-color: white; + font-family: "Roboto", serif; +} + +.connexion { + width: 94%; + height: 40px; + padding-left: 3%; + margin-left: 1%; + margin-top: -1%; + border-radius: 25px; + border: none; + font-size: 15px; +} + + + +.ErrorMsg { + color: red; +} + +table { + border-collapse: collapse; + width: 100%; +} + +td { + padding: 10px 20px; + border: none; +} + +.boutons { + display: flex; + justify-content: space-between; + gap: 10px; +} + +.boutons button { + border: none; + background-color: transparent; + padding: 5px; + cursor: pointer; +} + +.boutons button img { + width: 24px; + height: 24px; + object-fit: contain; +} + + +.imageProfil { + height: auto; + width: 30px; + border-radius: 45%; +} + +.buttonProfil{ + background-color:transparent; } \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataAdmin.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataAdmin.json new file mode 100644 index 0000000..ca8d360 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataAdmin.json @@ -0,0 +1,8 @@ +[ + { + "users": 1 + }, + { + "users": 4 + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCaracter.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCaracter.json new file mode 100644 index 0000000..4a79ed5 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCaracter.json @@ -0,0 +1,52 @@ +[ + { + "id_caracter":82, + "caracter": "The Wolf", + "id_img": 1 + }, + { + "id_caracter":50, + "caracter": "Sirius Black", + "id_img": 2 + }, + { + "id_caracter":77, + "caracter": "Boromir", + "id_img": 3 + }, + { + "id_caracter": 29, + "caracter": "Maître Oogway", + "id_img": 4 + }, + { + "id_caracter":7, + "caracter": "Drago Malefoy", + "id_img": 5 + }, + { + "id_caracter":44, + "caracter": "T’Challa / Black Panther", + "id_img": 6 + }, + { + "id_caracter":53, + "caracter": "Butch", + "id_img": 7 + }, + { + "id_caracter": 39, + "caracter": "Coco", + "id_img": 8 + }, + { + "id_caracter": 34, + "caracter": "John Coffey", + "id_img": 9 + }, + { + "id_caracter": 38, + "caracter": "Harold", + "id_img": 10 + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCommentaty.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCommentaty.json new file mode 100644 index 0000000..351ff35 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataCommentaty.json @@ -0,0 +1,9 @@ +[ + { + "id_comment": 1, + "quote": 1, + "users": 1, + "dateC":"2024-10-10", + "comment": "coucou" + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataDailyQuote.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataDailyQuote.json new file mode 100644 index 0000000..4b9acbe --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataDailyQuote.json @@ -0,0 +1,12 @@ +[ + { + "Id": "1", + "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.", + "Likes": 0, + "Langue": "fr", + "Charac": "Superman", + "TitleSrc": "SuperMan : le film", + "UserProposition": "joe", + "ImgPath": "https://tse4.mm.bing.net/th/id/OIP.fc5TQflh0cbxB1GUeOdk6gHaK8?w=123&h=180&c=7&r=0&o=5&pid=1.7" + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataFavorite.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataFavorite.json new file mode 100644 index 0000000..ca20726 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataFavorite.json @@ -0,0 +1,6 @@ +[ + { + "users":1, + "quote":1 + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataImage.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataImage.json new file mode 100644 index 0000000..29201e4 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataImage.json @@ -0,0 +1,82 @@ +[ + { + "id_img": 1, + "imgPath": "https://tse4.mm.bing.net/th/id/OIP.fc5TQflh0cbxB1GUeOdk6gHaK8?w=123&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 2, + "imgPath": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137&h=195&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 3, + "imgPath": "https://tse1.mm.bing.net/th/id/OIP._uHLsNbgnf1m1vK3ZWE2UAHaEo?w=217&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 4, + "imgPath": "https://tse4.mm.bing.net/th/id/OIP.QzDh_d2T5aADiDJ7uMFU6gHaHa?w=157&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 5, + "imgPath": "https://tse2.mm.bing.net/th/id/OIP.CthWIxuLm0a8THOguTDB_AAAAA?w=157&h=207&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 6, + "imgPath": "https://tse4.mm.bing.net/th/id/OIP.XNQPKwc1OUfvnSO9MsxDYgHaE7?w=202&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 7, + "imgPath": "https://tse1.mm.bing.net/th/id/OIP.luN_zVQJt2Kyf7H_kSrPyQHaJD?w=115&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 8, + "imgPath": "https://tse1.mm.bing.net/th/id/OIP.GPIbva8dEP6Kllx-sj5ysAHaK-?w=115&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 9, + "imgPath": "https://tse4.mm.bing.net/th/id/OIP.loqNhw71Vk_C-TiyWQJoKAHaKK?w=95&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 10, + "imgPath": "https://tse2.mm.bing.net/th/id/OIP._OiJHgI7cal4cWNHcCE9zAHaM2?w=115&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 11, + "imgPath": "https://tse2.mm.bing.net/th/id/OIP.B9RbuWnpmV-7fI8v-H0G8gHaEK?w=290&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 12, + "imgPath": "https://tse2.mm.bing.net/th/id/OIP.RrJkua2jY_o24eUG7wmk8QHaE-?w=232&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 13, + "imgPath": "https://tse3.mm.bing.net/th/id/OIP.-1Ds-2D5GPiu9uejDdmgNgHaH3?w=124&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 14, + "imgPath": "https://tse3.mm.bing.net/th/id/OIP.BeQYJEP1pQKzHDLGhTLBtgHaFj?w=243&h=182&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 15, + "imgPath": "https://tse3.mm.bing.net/th/id/OIP.lDzxwo1weGaA-hRMfV6bYwHaGp?w=194&h=174&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 16, + "imgPath": "https://tse2.mm.bing.net/th/id/OIP.3vXkEUJ9J8s-GsnBC6I3KAHaF0?w=185&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 17, + "imgPath": "https://tse4.mm.bing.net/th/id/OIP.omU-pPTNgHJEiTKJUpB1MAHaIw?w=114&h=180&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 18, + "imgPath": "https://tse2.mm.bing.net/th/id/OIP.Qoh2doQIigxyiOBuhgRx9gHaM7?w=115&h=186&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 19, + "imgPath": "https://tse3.mm.bing.net/th/id/OIP.hyDe8SvEEvDhmKfsQBqWEwHaJ8?w=194&h=261&c=7&r=0&o=5&pid=1.7" + }, + { + "id_img": 20, + "imgPath": "https://tse3.mm.bing.net/th/id/OIP.S4q6m2na1Rxkc7xZ1lcfKQHaJe?w=135&h=180&c=7&r=0&o=5&pid=1.7" + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataModifQuote.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataModifQuote.json deleted file mode 100644 index 20f7d2a..0000000 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataModifQuote.json +++ /dev/null @@ -1,90 +0,0 @@ -[ - { - "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": "Harry POTTER JE SUIS TON PERE", - "Charac": "Sirius Black", - "TitleSrc": "Harry Potter", - "Langue": "fr", - "UserProposition": "demo", - "DateSrc": "2001-01-01", - "Like": 20 - }, - { - "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", - "DateSrc": "2002-02-02", - "Like": 0, - "UserProposition": "exploit" - }, - { - "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": "Harry POTTER JE SUIS TON PERE", - "Charac": "Sirius Black", - "TitleSrc": "Harry Potter", - "Langue": "fr", - "UserProposition": "demo", - "DateSrc": "2001-01-01", - "Like": 20 - }, - { - "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", - "DateSrc": "2002-02-02", - "Like": 0, - "UserProposition": "exploit" - }, - { - "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": "Harry POTTER JE SUIS TON PERE", - "Charac": "Sirius Black", - "TitleSrc": "Harry Potter", - "Langue": "fr", - "UserProposition": "demo", - "DateSrc": "2001-01-01", - "Like": 20 - }, - { - "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", - "DateSrc": "2002-02-02", - "Like": 0, - "UserProposition": "exploit" - }, - { - "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": "Harry POTTER JE SUIS TON PERE", - "Charac": "Sirius Black", - "TitleSrc": "Harry Potter", - "Langue": "fr", - "UserProposition": "demo", - "DateSrc": "2001-01-01", - "Like": 20 - }, - { - "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", - "DateSrc": "2002-02-02", - "Like": 0, - "UserProposition": "exploit" - } -] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuestion.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuestion.json new file mode 100644 index 0000000..5fb52e8 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuestion.json @@ -0,0 +1,83 @@ +[ + { + "id_question": 1, + "texte": "May the Force be with you.", + "answerA": "Star Wars", + "answerB": "Star Trek", + "answerC": "The Matrix", + "answerD": "Blade Runner", + "cAnswer": "Star Wars" + }, + { + "id_question": 2, + "texte": "I m gonna make him an offer he can t refuse.", + "answerA": "The Godfather", + "answerB": "Goodfellas", + "answerC": "Scarface", + "answerD": "The Sopranos", + "cAnswer": "The Godfather" + }, + { + "id_question": 3, + "texte": "To infinity and beyond!", + "answerA": "Toy Story", + "answerB": "The Incredibles", + "answerC": "Finding Nemo", + "answerD": "Shrek", + "cAnswer": "Toy Story" + }, + { + "id_question": 4, + "texte": "All we have to decide is what to do with the time that is given to us.", + "answerA": "The Lord of the Rings", + "answerB": "Harry Potter", + "answerC": "The Hobbit", + "answerD": "Narnia", + "cAnswer": "The Lord of the Rings" + }, + { + "id_question": 5, + "texte": "I am your father.", + "answerA": "Star Wars", + "answerB": "Star Wars", + "answerC": "Star Trek", + "answerD": "Guardians of the Galaxy", + "cAnswer": "Star Wars" + }, + { + "id_question": 6, + "texte": "It is a trap!", + "answerA": "Star Wars", + "answerB": "Battlestar Galactica", + "answerC": "Star Trek", + "answerD": "The Matrix", + "cAnswer": "Star Wars" + }, + { + "id_question": 7, + "texte": "Winter is coming.", + "answerA": "Game of Thrones", + "answerB": "The Witcher", + "answerC": "Vikings", + "answerD": "The Mandalorian", + "cAnswer": "Game of Thrones" + }, + { + "id_question": 8, + "texte": "Elementary, my dear Watson.", + "answerA": "Sherlock Holmes", + "answerB": "Agatha Christie", + "answerC": "Poirot", + "answerD": "The Hound of the Baskervilles", + "cAnswer": "Sherlock Holmes" + }, + { + "id_question": 9, + "texte": "Here is looking at you, kid.", + "answerA": "Casablanca", + "answerB": "Gone with the Wind", + "answerC": "Citizen Kane", + "answerD": "The Maltese Falcon", + "cAnswer": "Casablanca" + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuiz.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuiz.json new file mode 100644 index 0000000..24eb012 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuiz.json @@ -0,0 +1,282 @@ +[ + { + "id": 1, + "question": "Voluptate nulla laborum pariatur excepteur consequat officia ea esse ut nisi amet non.", + "answerA": "sit ullamco", + "answerB": "deserunt reprehenderit", + "answerC": "cupidatat deserunt", + "answerD": "ullamco aliqua", + "cAnswer": "B", + "userProposition": "Lori Myers" + }, + { + "id": 2, + "question": "Ea elit esse minim aute aliquip cillum amet cupidatat fugiat exercitation.", + "answerA": "ullamco excepteur", + "answerB": "aliquip occaecat", + "answerC": "incididunt duis", + "answerD": "sunt dolor", + "cAnswer": "A", + "userProposition": "Louella Robinson" + }, + { + "id": 3, + "question": "Aute commodo est proident sunt nulla est cillum eiusmod est voluptate dolore sit aliqua incididunt.", + "answerA": "reprehenderit mollit", + "answerB": "laboris consectetur", + "answerC": "cillum deserunt", + "answerD": "deserunt fugiat", + "cAnswer": "B", + "userProposition": "Richmond Joyner" + }, + { + "id": 4, + "question": "Fugiat duis excepteur non amet tempor deserunt ut occaecat cupidatat eiusmod et amet enim.", + "answerA": "amet aute", + "answerB": "excepteur ad", + "answerC": "laboris veniam", + "answerD": "veniam in", + "cAnswer": "B", + "userProposition": "Brady Patrick" + }, + { + "id": 5, + "question": "Occaecat minim velit dolor est ad ut irure eu labore velit in dolore exercitation.", + "answerA": "eu aliqua", + "answerB": "labore ipsum", + "answerC": "labore reprehenderit", + "answerD": "anim excepteur", + "cAnswer": "C", + "userProposition": "Mavis Boone" + }, + { + "id": 6, + "question": "Non laboris adipisicing anim fugiat labore excepteur tempor elit in.", + "answerA": "in excepteur", + "answerB": "nostrud dolor", + "answerC": "nisi aliqua", + "answerD": "sint nisi", + "cAnswer": "C", + "userProposition": "Douglas Dejesus" + }, + { + "id": 7, + "question": "Lorem proident exercitation elit fugiat do amet aute labore consectetur pariatur consequat.", + "answerA": "eiusmod nulla", + "answerB": "eu id", + "answerC": "proident tempor", + "answerD": "amet proident", + "cAnswer": "A", + "userProposition": "Mia Peterson" + }, + { + "id": 8, + "question": "Incididunt magna commodo laborum do incididunt commodo proident non cillum magna elit irure voluptate.", + "answerA": "laborum fugiat", + "answerB": "laboris est", + "answerC": "in ea", + "answerD": "duis ullamco", + "cAnswer": "A", + "userProposition": "Juliet Fox" + }, + { + "id": 9, + "question": "Qui labore fugiat sint Lorem ut minim in ex dolor.", + "answerA": "et deserunt", + "answerB": "labore sit", + "answerC": "in eiusmod", + "answerD": "amet incididunt", + "cAnswer": "C", + "userProposition": "Earnestine Poole" + }, + { + "id": 10, + "question": "Voluptate pariatur ipsum magna sint Lorem adipisicing.", + "answerA": "sint velit", + "answerB": "non culpa", + "answerC": "nisi ut", + "answerD": "excepteur labore", + "cAnswer": "B", + "userProposition": "Alexis Cross" + }, + { + "id": 11, + "question": "In labore sunt est cupidatat cillum.", + "answerA": "ut ad", + "answerB": "non deserunt", + "answerC": "do officia", + "answerD": "ut nostrud", + "cAnswer": "C", + "userProposition": "Brooks Martinez" + }, + { + "id": 12, + "question": "Irure occaecat sit laborum nulla ea dolore et aliqua sunt Lorem enim esse.", + "answerA": "excepteur occaecat", + "answerB": "pariatur in", + "answerC": "reprehenderit excepteur", + "answerD": "laborum adipisicing", + "cAnswer": "D", + "userProposition": "Shields Roth" + }, + { + "id": 13, + "question": "Laboris sint in sit exercitation nisi id cillum ex ea culpa fugiat in cupidatat.", + "answerA": "labore mollit", + "answerB": "in veniam", + "answerC": "labore eiusmod", + "answerD": "consequat veniam", + "cAnswer": "B", + "userProposition": "Carmella Chase" + }, + { + "id": 14, + "question": "Proident dolor Lorem anim proident laborum sint minim sit laborum aliquip.", + "answerA": "velit exercitation", + "answerB": "voluptate esse", + "answerC": "occaecat cupidatat", + "answerD": "enim adipisicing", + "cAnswer": "D", + "userProposition": "Johns Solomon" + }, + { + "id": 15, + "question": "Do magna dolore enim laborum consequat reprehenderit nisi consequat nostrud.", + "answerA": "proident do", + "answerB": "labore minim", + "answerC": "in elit", + "answerD": "in irure", + "cAnswer": "A", + "userProposition": "Alana Moore" + }, + { + "id": 16, + "question": "Culpa anim id elit dolore veniam.", + "answerA": "ipsum nisi", + "answerB": "officia voluptate", + "answerC": "in excepteur", + "answerD": "ullamco non", + "cAnswer": "B", + "userProposition": "Russo Rios" + }, + { + "id": 17, + "question": "Ea est consectetur exercitation aute ut mollit pariatur irure aute adipisicing dolore.", + "answerA": "fugiat elit", + "answerB": "pariatur nulla", + "answerC": "exercitation ipsum", + "answerD": "exercitation laboris", + "cAnswer": "A", + "userProposition": "Bobbi Lara" + }, + { + "id": 18, + "question": "Laborum consectetur incididunt ad fugiat fugiat proident culpa mollit laborum.", + "answerA": "elit duis", + "answerB": "amet aute", + "answerC": "culpa nostrud", + "answerD": "do pariatur", + "cAnswer": "D", + "userProposition": "Lewis Mullins" + }, + { + "id": 19, + "question": "Culpa anim aliquip mollit non labore.", + "answerA": "labore incididunt", + "answerB": "laborum non", + "answerC": "sunt laborum", + "answerD": "est sunt", + "cAnswer": "B", + "userProposition": "Mccray Mccoy" + }, + { + "id": 20, + "question": "Ex exercitation deserunt aute cillum dolor.", + "answerA": "proident magna", + "answerB": "pariatur exercitation", + "answerC": "ipsum veniam", + "answerD": "culpa quis", + "cAnswer": "C", + "userProposition": "Moss Jefferson" + }, + { + "id": 21, + "question": "Do mollit aute dolore anim id non aliqua.", + "answerA": "ipsum aute", + "answerB": "irure ex", + "answerC": "ex duis", + "answerD": "ipsum cupidatat", + "cAnswer": "B", + "userProposition": "Roth Valdez" + }, + { + "id": 22, + "question": "Commodo sunt reprehenderit tempor sit ut ea Lorem esse minim elit et sunt sint qui.", + "answerA": "et do", + "answerB": "officia culpa", + "answerC": "et commodo", + "answerD": "irure tempor", + "cAnswer": "D", + "userProposition": "Adrienne Carpenter" + }, + { + "id": 23, + "question": "Excepteur cupidatat ut sit commodo magna elit.", + "answerA": "pariatur tempor", + "answerB": "proident non", + "answerC": "velit elit", + "answerD": "pariatur fugiat", + "cAnswer": "D", + "userProposition": "Mcknight Cain" + }, + { + "id": 24, + "question": "Laborum eu nisi consequat voluptate in laboris cillum in aute sint excepteur aliqua Lorem in.", + "answerA": "pariatur in", + "answerB": "voluptate qui", + "answerC": "et cillum", + "answerD": "adipisicing id", + "cAnswer": "D", + "userProposition": "Gay Barlow" + }, + { + "id": 25, + "question": "Laborum ullamco occaecat excepteur deserunt nostrud dolor.", + "answerA": "magna labore", + "answerB": "ullamco veniam", + "answerC": "reprehenderit irure", + "answerD": "magna dolore", + "cAnswer": "B", + "userProposition": "Hannah Battle" + }, + { + "id": 26, + "question": "Commodo in amet laboris Lorem et qui anim ea ullamco dolor dolor commodo.", + "answerA": "amet nulla", + "answerB": "laborum mollit", + "answerC": "amet in", + "answerD": "irure amet", + "cAnswer": "D", + "userProposition": "Dawson Mcpherson" + }, + { + "id": 27, + "question": "Veniam non consectetur sit cillum.", + "answerA": "aliqua cupidatat", + "answerB": "nostrud culpa", + "answerC": "anim ullamco", + "answerD": "adipisicing et", + "cAnswer": "A", + "userProposition": "Reeves Love" + }, + { + "id": 28, + "question": "Ullamco laboris voluptate nostrud commodo Lorem enim ad ipsum.", + "answerA": "id aute", + "answerB": "aliquip incididunt", + "answerC": "duis elit", + "answerD": "mollit ad", + "cAnswer": "B", + "userProposition": "Michael Holmes" + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuiz_Question.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuiz_Question.json new file mode 100644 index 0000000..327365d --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuiz_Question.json @@ -0,0 +1,38 @@ +[ + { + "quiz":1, + "question":1 + }, + { + "quiz":1, + "question":2 + }, + { + "quiz":1, + "question":3 + }, + { + "quiz":1, + "question":4 + }, + { + "quiz":2, + "question":5 + }, + { + "quiz":2, + "question":6 + }, + { + "quiz":2, + "question":7 + }, + { + "quiz":2, + "question":8 + }, + { + "quiz":2, + "question":9 + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json index 2b96570..39d4bd4 100644 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json @@ -1,62 +1,112 @@ [ { - "Id": 1, - "Content": "coucou", - "Charac": "moi", - "ImgPath": "img", - "TitleSrc": "G4", - "DateSrc": "2001-01-01", - "Like": 20, - "Langue": "fr" - }, - { - "Id": 2, - "Content": "boujour", - "Charac": "toi", - "ImgPath": "img", - "TitleSrc": "G4", - "DateSrc": "2002-02-02", - "Like": 0, - "Langue": "fr" - }, - { - "Id": 3, - "Content": "coucou", - "Charac": "moi", - "ImgPath": "img", - "TitleSrc": "G4", - "DateSrc": "2001-01-01", - "Like": 20, - "Langue": "fr" - }, - { - "Id": 4, - "Content": "boujour", - "Charac": "toi", - "ImgPath": "img", - "TitleSrc": "G4", - "DateSrc": "2002-02-02", - "Like": 0, - "Langue": "fr" - }, - { - "Id": 5, - "Content": "coucou", - "Charac": "moi", - "ImgPath": "img", - "TitleSrc": "G4", - "DateSrc": "2001-01-01", - "Like": 20, - "Langue": "fr" - }, - { - "Id": 6, - "Content": "boujour", - "Charac": "toi", - "ImgPath": "img", - "TitleSrc": "G4", - "DateSrc": "2002-02-02", - "Like": 0, - "Langue": "fr" + "id_quote": "1", + "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.", + "likes": 0, + "langue": "fr", + "isValide": true, + "reason": "insertion de test", + "id_caracter": 50, + "id_source": 38, + "id_user_verif": 1 + }, + { + "id_quote": "22", + "content": "Nous avons parié, mon père et moi. Je ne crois pas que tu tiendras dix minutes dans ce tournoi. Lui, il n’est pas d’accord, il croit que tu n’en tiendras pas cinq.", + "likes": 0, + "langue": "fr", + "isValide": true, + "reason": "insertion de test", + "id_caracter": 7, + "id_source": 58, + "id_user_verif": 1 + }, + { + "id_quote": "45", + "content": "Je vous aurais suivi mon frère, mon capitaine, mon roi.", + "likes": 0, + "langue": "fr", + "isValide": true, + "reason": "insertion de test", + "id_caracter": 77, + "id_source": 76, + "id_user_verif": 1 + }, + { + "id_quote": "90", + "content": "Si vous le voulez bien, on se taillera des pipes plus tard, les enfants.", + "likes": 0, + "langue": "fr", + "isValide": true, + "reason": "insertion de test", + "id_caracter": 82, + "id_source": 9, + "id_user_verif": 1 + }, + { + "id_quote": "91", + "content": "Je fais le mort dans la 5e.", + "likes": 0, + "langue": "fr", + "isValide": true, + "reason": "insertion de test", + "id_caracter": 53, + "id_source": 9, + "id_user_verif": 1 + }, + { + "id_quote": "110", + "content": "Il les a tuées avec leur amour. C’est comme ça tous les jours dans le monde entier.", + "likes": 0, + "langue": "fr", + "isValide": true, + "reason": "insertion de test", + "id_caracter": 34, + "id_source": 74, + "id_user_verif": 1 + }, + { + "id_quote": "118", + "content": "La vengeance est un déesse dévorante. Eux aussi en sont victimes… Je ne dois pas céder à son appel. La justice finira par triompher.", + "likes": 0, + "langue": "fr", + "isValide": false, + "reason": "insertion de test", + "id_caracter": 44, + "id_source": 30, + "id_user_verif": 1 + }, + { + "id_quote": "185", + "content": "Tu viens de me montrer au complet ?!", + "likes": 0, + "langue": "fr", + "isValide": false, + "reason": "insertion de test", + "id_caracter": 38, + "id_source": 10, + "id_user_verif": 1 + }, + { + "id_quote": "182", + "content": "Nouille ou pas nouille, tu te préoccupes trop de ce qui a été ou de ce qui sera.", + "likes": 0, + "langue": "fr", + "isValide": false, + "reason": "insertion de test", + "id_caracter": 29, + "id_source": 71, + "id_user_verif": 1 + }, + { + "id_quote": "175", + "content": "Arrête de faire ton Jean-Jacques !", + "likes": 0, + "langue": "fr", + "isValide": false, + "reason": "insertion de test", + "id_caracter": 39, + "id_source": 68, + "id_user_verif": 1 } ] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataRecord_Quiz.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataRecord_Quiz.json new file mode 100644 index 0000000..315a27e --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataRecord_Quiz.json @@ -0,0 +1,8 @@ +[ + { + "users":1, + "quiz":1, + "nbPoint":3, + "timeQ": 0 + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataSource.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataSource.json new file mode 100644 index 0000000..efc2ddb --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataSource.json @@ -0,0 +1,87 @@ +[ + { + "id_source": 1, + "title": "Cars", + "dateS": 2006 + }, + { + "id_source": 2, + "title": "Le Parrain, 3ème partie", + "dateS": 1972 + }, + { + "id_source": 3, + "title": "Hunger Games : la révolte - 1re partie", + "dateS": 2012 + }, + { + "id_source": 4, + "title": "Le hobbit : la désolation de Smaug", + "dateS": 2012 + }, + { + "id_source": 5, + "title": "Là-haut", + "dateS": 2009 + }, + { + "id_source": 6, + "title": "Raiponce", + "dateS": 2010 + }, + { + "id_source": 7, + "title": "Harry Potter et les reliques de la mort - 1re partie", + "dateS": 2001 + }, + { + "id_source": 8, + "title": "Le seigneur des anneaux : les deux tours", + "dateS": 2001 + }, + { + "id_source": 9, + "title": "Pulp Fiction", + "dateS": 1994 + }, + { + "id_source": 10, + "title": "Dragons", + "dateS": 2010 + }, + { + "id_source": 30, + "title": "Captain America : civil war", + "dateS": 2011 + }, + { + "id_source": 38, + "title": "Harry Potter et L’ordre du Phoenix", + "dateS": 2001 + }, + { + "id_source": 58, + "title": "Harry Potter et les reliques de la mort - 2e partie", + "dateS": 2001 + }, + { + "id_source": 68, + "title": "Coco", + "dateS": 2017 + }, + { + "id_source": 71, + "title": "Kung Fu Panda", + "dateS": 2008 + }, + { + "id_source": 74, + "title": "La Ligne Verte", + "dateS": 1999 + }, + { + "id_source": 76, + "title": "Le seigneur des anneaux : la communauté de l’anneau", + "dateS": 2001 + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUserLogin.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUserLogin.json new file mode 100644 index 0000000..751bd60 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUserLogin.json @@ -0,0 +1,16 @@ +[ + { + "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": "admin", + "IsAdmin": true, + "Mdp" : "admin" + }, + { + "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", + "IsAdmin": true, + "Mdp": "passwd" + } +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUsers.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUsers.json new file mode 100644 index 0000000..a6c7f98 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataUsers.json @@ -0,0 +1,175 @@ +[ + { + "Id": 1, + "Image": "https://tse4.mm.bing.net/th/id/OIP.fc5TQflh0cbxB1GUeOdk6gHaK8?w=123\u0026h=180\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "admin", + "Email": "admin@gmail.com", + "DateCreation": "2024-12-12T00:00:00", + "IsAdmin": true, + "Comments": [ + { + "Text": "Commentaire 1", + "DateCreation": "2024-12-12T00:00:00" + }, + { + "Text": "Commentaire 2", + "DateCreation": "2024-11-12T00:00:00" + } + ] + }, + { + "Id": 2, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "exploit2", + "Email": "exploit@gmail.com", + "DateCreation": "2024-11-12T00:00:00", + "IsAdmin": true, + "Comments": null + }, + { + "Id": 3, + "Image": "https://tse4.mm.bing.net/th/id/OIP.XNQPKwc1OUfvnSO9MsxDYgHaE7?w=202\u0026h=180\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "testeur", + "Email": "testeur@gmail.com", + "DateCreation": "2024-08-02T00:00:00", + "IsAdmin": false, + "Comments": [ + { + "Text": "Premier test effectu\u00E9, tout semble OK.", + "DateCreation": "2024-08-02T00:00:00" + } + ] + }, + { + "Id": 4, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "dev", + "Email": "dev@gmail.com", + "DateCreation": "2024-10-10T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 5, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "jean_doe", + "Email": "jean.doe@gmail.com", + "DateCreation": "2024-06-25T00:00:00", + "IsAdmin": false, + "Comments": [ + { + "Text": "Utilisateur tr\u00E8s actif, peut \u00EAtre un peu trop intrusif.", + "DateCreation": "2024-06-25T00:00:00" + } + ] + }, + { + "Id": 6, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "jane_smith", + "Email": "jane.smith@gmail.com", + "DateCreation": "2024-07-15T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 7, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "admin_joe", + "Email": "admin.joe@gmail.com", + "DateCreation": "2024-05-30T00:00:00", + "IsAdmin": true, + "Comments": null + }, + { + "Id": 8, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "dev_anna", + "Email": "dev.anna@gmail.com", + "DateCreation": "2024-09-05T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 9, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "support_mark", + "Email": "support.mark@gmail.com", + "DateCreation": "2024-11-20T00:00:00", + "IsAdmin": false, + "Comments": [ + { + "Text": "Support rapide et efficace, mais manquant un peu de d\u00E9tails.", + "DateCreation": "2024-11-20T00:00:00" + } + ] + }, + { + "Id": 10, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "dev_susan", + "Email": "dev.susan@gmail.com", + "DateCreation": "2024-08-12T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 11, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "designer_steve", + "Email": "designer.steve@gmail.com", + "DateCreation": "2024-07-01T00:00:00", + "IsAdmin": false, + "Comments": [ + { + "Text": "Le design doit \u00EAtre retravaill\u00E9 pour plus de clart\u00E9.", + "DateCreation": "2024-07-01T00:00:00" + } + ] + }, + { + "Id": 12, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "admin_lucas", + "Email": "admin.lucas@gmail.com", + "DateCreation": "2024-09-22T00:00:00", + "IsAdmin": true, + "Comments": null + }, + { + "Id": 13, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "manager_anna", + "Email": "manager.anna@gmail.com", + "DateCreation": "2024-05-01T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 14, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "developer_mike", + "Email": "developer.mike@gmail.com", + "DateCreation": "2024-11-02T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 15, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "test_user_01", + "Email": "test.user01@gmail.com", + "DateCreation": "2024-06-10T00:00:00", + "IsAdmin": false, + "Comments": null + }, + { + "Id": 16, + "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", + "Name": "admin_kate", + "Email": "admin.kate@gmail.com", + "DateCreation": "2024-04-16T00:00:00", + "IsAdmin": true, + "Comments": null + } +] \ 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 deleted file mode 100644 index e004ed9..0000000 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataValidQuote.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "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