#185 formulaire admin Artiste et style.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
namespace Webzine.WebApplication.Areas.Administration.Controllers;
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using Webzine.Business.Contracts;
|
||||
using Webzine.Business.Contracts.Dto;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Webzine.Repository.Contracts;
|
||||
|
||||
[Area("Administration")]
|
||||
public class DashboardController : Controller
|
||||
@@ -31,7 +31,7 @@ public class DashboardController : Controller
|
||||
/// <returns>La vue Index du tableau de bord.</returns>
|
||||
public IActionResult Index()
|
||||
{
|
||||
DashboardDTO data = dashboardService.GetDashboardData();
|
||||
DashboardDTO data = this.dashboardService.GetDashboardData();
|
||||
|
||||
return this.View(data);
|
||||
}
|
||||
|
||||
@@ -10,12 +10,15 @@
|
||||
/// <summary>
|
||||
/// Nom de l'artiste.
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Required(ErrorMessage = "Le nom de l'auteur est obligatoire.")]
|
||||
[StringLength(50, ErrorMessage = "Le nom ne doit pas dépasser 50 caractères.")]
|
||||
public string Nom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Biographie de l'artiste.
|
||||
/// </summary>
|
||||
/// </summary>*
|
||||
[Required(ErrorMessage = "La biographie ne peux pas etre vide.")]
|
||||
|
||||
public string Biographie { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,15 @@
|
||||
/// <summary>
|
||||
/// Nom de l'artiste.
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Required(ErrorMessage = "Le nom de l'auteur est obligatoire.")]
|
||||
[StringLength(50, ErrorMessage = "Le nom ne doit pas dépasser 50 caractères.")]
|
||||
|
||||
public string Nom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Biographie de l'artiste.
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "Le contenu de la biographie ne peut pas être vide.")]
|
||||
public string Biographie { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace Webzine.WebApplication.Areas.Administration.ViewModels.Style
|
||||
/// <summary>
|
||||
/// Obtient ou définit le libellé du style.
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Required(ErrorMessage = "Le libelle du style est obligatoire.")]
|
||||
public string Libelle { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ namespace Webzine.WebApplication.Areas.Administration.ViewModels.Style
|
||||
/// <summary>
|
||||
/// Obtient ou definit le libelle du style.
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Required(ErrorMessage = "Le libelle du style est obligatoire.")]
|
||||
public string Libelle { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,8 @@
|
||||
<label class="col-md-3 col-form-label">Nom de l'artiste<span class="text-danger">*</span></label>
|
||||
<div class="col-md-9">
|
||||
<input asp-for="Nom" class="form-control" />
|
||||
<span asp-validation-for="Nom" class="text-danger"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,6 +21,8 @@
|
||||
<label class="col-md-3 col-form-label">Biographie</label>
|
||||
<div class="col-md-9">
|
||||
<textarea asp-for="Biographie" class="form-control" rows="5"></textarea>
|
||||
<span asp-validation-for="Biographie" class="text-danger"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<label class="col-md-3 col-form-label">Nom de l'artiste<span class="text-danger">*</span></label>
|
||||
<div class="col-md-9">
|
||||
<input asp-for="Nom" class="form-control" />
|
||||
<span asp-validation-for="Nom" class="text-danger"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +16,10 @@
|
||||
<label class="col-md-3 col-form-label">Biographie</label>
|
||||
<div class="col-md-9">
|
||||
<textarea asp-for="Biographie" class="form-control" rows="5"></textarea>
|
||||
<span asp-validation-for="Biographie" class="text-danger"></span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- BOUTONS -->
|
||||
|
||||
@@ -39,7 +39,6 @@ namespace Webzine.WebApplication.Controllers
|
||||
/// </summary>
|
||||
/// <param name="id">Identifiant du titre.</param>
|
||||
/// <returns>Vue des details ou 404 si introuvable.</returns>
|
||||
|
||||
public IActionResult Index(int id)
|
||||
{
|
||||
this.logger.LogInformation("Demande d'affichage du detail pour le titre ID {Id}.", id);
|
||||
|
||||
@@ -23,9 +23,7 @@ public static class RouteConfiguration
|
||||
pattern: "artiste/{nom}",
|
||||
defaults: new { controller = "Artiste", action = "Index" });
|
||||
|
||||
|
||||
// ----------- ADMIN -----------
|
||||
|
||||
var adminRoutes = new Dictionary<string, string>
|
||||
{
|
||||
{ "artistes", "Artiste" }, { "commentaires", "Commentaire" }, { "styles", "Style" }, { "titres", "Titre" },
|
||||
@@ -39,9 +37,7 @@ public static class RouteConfiguration
|
||||
defaults: new { area = "Administration", controller = route.Value, action = "Index" });
|
||||
}
|
||||
|
||||
|
||||
// --- AUTRE PROUTES ---
|
||||
|
||||
endpoints.MapControllerRoute(
|
||||
name: "areas",
|
||||
pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
Reference in New Issue
Block a user