fixes and renaming

This commit is contained in:
Paul Schneider 2026-06-30 23:32:05 +01:00
commit 0965caaf40
8 changed files with 29 additions and 28 deletions

View file

@ -11,7 +11,7 @@ namespace Yavsc.Controllers
public GeneralSettingsController(ApplicationDbContext context) public GeneralSettingsController(ApplicationDbContext context)
{ {
_context = context; _context = context;
} }
// GET: GeneralSettings // GET: GeneralSettings
@ -28,7 +28,7 @@ namespace Yavsc.Controllers
return NotFound(); return NotFound();
} }
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id); MusicLoverSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
if (generalSettings == null) if (generalSettings == null)
{ {
return NotFound(); return NotFound();
@ -46,7 +46,7 @@ namespace Yavsc.Controllers
// POST: GeneralSettings/Create // POST: GeneralSettings/Create
[HttpPost] [HttpPost]
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
public async Task<IActionResult> Create(GeneralSettings generalSettings) public async Task<IActionResult> Create(MusicLoverSettings generalSettings)
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
@ -65,7 +65,7 @@ namespace Yavsc.Controllers
return NotFound(); return NotFound();
} }
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id); MusicLoverSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
if (generalSettings == null) if (generalSettings == null)
{ {
return NotFound(); return NotFound();
@ -76,7 +76,7 @@ namespace Yavsc.Controllers
// POST: GeneralSettings/Edit/5 // POST: GeneralSettings/Edit/5
[HttpPost] [HttpPost]
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(GeneralSettings generalSettings) public async Task<IActionResult> Edit(MusicLoverSettings generalSettings)
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
@ -96,7 +96,7 @@ namespace Yavsc.Controllers
return NotFound(); return NotFound();
} }
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id); MusicLoverSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
if (generalSettings == null) if (generalSettings == null)
{ {
return NotFound(); return NotFound();
@ -110,7 +110,7 @@ namespace Yavsc.Controllers
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(string id) public async Task<IActionResult> DeleteConfirmed(string id)
{ {
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id); MusicLoverSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
_context.GeneralSettings.Remove(generalSettings); _context.GeneralSettings.Remove(generalSettings);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
return RedirectToAction("Index"); return RedirectToAction("Index");

View file

@ -20,7 +20,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="Name" class="col-md-2 control-label"> <label asp-for="Name" class="col-md-2 control-label">
Name"]</label> Name</label>
<div class="col-md-10"> <div class="col-md-10">
<input asp-for="Name" class="form-control" /> <input asp-for="Name" class="form-control" />
<span asp-validation-for="Name" class="text-danger" ></span> <span asp-validation-for="Name" class="text-danger" ></span>
@ -28,7 +28,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="Parent" class="col-md-2 control-label"> <label asp-for="Parent" class="col-md-2 control-label">
Parent"]</label> Parent</label>
<div class="col-md-10"> <div class="col-md-10">
<select asp-for="ParentCode" asp-items=@ViewBag.ParentCode class="form-control" > <select asp-for="ParentCode" asp-items=@ViewBag.ParentCode class="form-control" >
</select> </select>
@ -37,7 +37,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="Description" class="col-md-2 control-label"> <label asp-for="Description" class="col-md-2 control-label">
Description"]</label> Description</label>
<div class="col-md-10"> <div class="col-md-10">
<input asp-for="Description" class="form-control" /> <input asp-for="Description" class="form-control" />
<span asp-validation-for="Description" class="text-danger" ></span> <span asp-validation-for="Description" class="text-danger" ></span>
@ -45,7 +45,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="Photo" class="col-md-2 control-label"> <label asp-for="Photo" class="col-md-2 control-label">
Photo"] Photo
</label> </label>
<div class="col-md-10"> <div class="col-md-10">
<input asp-for="Photo" class="form-control" /> <input asp-for="Photo" class="form-control" />
@ -54,7 +54,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="SettingsClassName" class="col-md-2 control-label"> <label asp-for="SettingsClassName" class="col-md-2 control-label">
SettingsClass"] SettingsClass
</label> </label>
<div class="col-md-10"> <div class="col-md-10">
<select asp-for="SettingsClassName" class="form-control" asp-items="@ViewBag.SettingsClassName"> <select asp-for="SettingsClassName" class="form-control" asp-items="@ViewBag.SettingsClassName">
@ -62,12 +62,12 @@
<span asp-validation-for="SettingsClassName" class="text-danger" ></span> <span asp-validation-for="SettingsClassName" class="text-danger" ></span>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-md-offset-2 col-md-10"> <div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create"]" class="btn btn-default" /> <input type="submit" value="Create" class="btn btn-default" />
</div> </div>
</div> </div>
</div> </div>

View file

@ -19,7 +19,7 @@
<span asp-validation-for="Name" class="text-danger" ></span> <span asp-validation-for="Name" class="text-danger" ></span>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="Parent" class="col-md-2 control-label"></label> <label asp-for="Parent" class="col-md-2 control-label"></label>
<div class="col-md-10"> <div class="col-md-10">
@ -54,13 +54,14 @@
<span asp-validation-for="SettingsClassName" class="text-danger" ></span> <span asp-validation-for="SettingsClassName" class="text-danger" ></span>
</div> </div>
</div> </div>
<div class="form-group">
<label asp-for="Hidden" class="col-md-2 control-label"></label> <div class="form-check">
<div class="col-md-10"> <input class="form-check-input" type="checkbox" asp-for="Hidden" id="Hidden">
<input asp-for="Hidden" class="form-control" /> <label class="form-check-label" for="Hidden">
<span asp-validation-for="Hidden" class="text-danger"></span> Hidden activity
</div> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label asp-for="Rate" class="col-md-2 control-label"></label> <label asp-for="Rate" class="col-md-2 control-label"></label>
<div class="col-md-10"> <div class="col-md-10">

View file

@ -1,4 +1,4 @@
@model Yavsc.Models.Musical.Profiles.GeneralSettings @model Yavsc.Models.Musical.Profiles.MusicLoverSettings
@{ @{
ViewBag.Title = "Delete"; ViewBag.Title = "Delete";
@ -12,7 +12,7 @@
<hr /> <hr />
<dl class="dl-horizontal"> <dl class="dl-horizontal">
</dl> </dl>
<form asp-action="Delete"> <form asp-action="Delete">
<div class="form-actions no-color"> <div class="form-actions no-color">
<input type="submit" value="Delete" class="btn btn-primary" /> | <input type="submit" value="Delete" class="btn btn-primary" /> |

View file

@ -1,4 +1,4 @@
@model Yavsc.Models.Musical.Profiles.GeneralSettings @model Yavsc.Models.Musical.Profiles.MusicLoverSettings
@{ @{
ViewBag.Title = "Edit"; ViewBag.Title = "Edit";

View file

@ -1,4 +1,4 @@
@model Yavsc.Models.Musical.Profiles.GeneralSettings @model Yavsc.Models.Musical.Profiles.MusicLoverSettings
@{ @{
ViewBag.Title = "Details"; ViewBag.Title = "Details";
@ -19,7 +19,7 @@
else { else {
<p> <p>
Aucun profile renseigné"] Aucun profile renseigné"]
<a asp-action="Create" class="btn btn-success">Renseigner ce paramêtrage"]</a> <a asp-action="Create" class="btn btn-success">Renseigner ce paramêtrage"]</a>
</p> </p>
} }
</div> </div>

View file

@ -279,7 +279,7 @@ namespace Yavsc.Models
public DbSet<FormationSettings> FormationSettings { get; set; } public DbSet<FormationSettings> FormationSettings { get; set; }
[ActivitySettings] [ActivitySettings]
public DbSet<GeneralSettings> GeneralSettings { get; set; } public DbSet<MusicLoverSettings> GeneralSettings { get; set; }
public DbSet<CoWorking> CoWorking { get; set; } public DbSet<CoWorking> CoWorking { get; set; }
private void AddTimestamps(string userId) private void AddTimestamps(string userId)

View file

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
namespace Yavsc.Models.Musical.Profiles namespace Yavsc.Models.Musical.Profiles
{ {
public class GeneralSettings : IUserSettings public class MusicLoverSettings : IUserSettings
{ {
public virtual List<MusicalPreference> SoundColor { get; set; } public virtual List<MusicalPreference> SoundColor { get; set; }
[Key] [Key]