diff --git a/.vscode/mcp.json b/.vscode/mcp.json new file mode 100644 index 00000000..7ca6ed4b --- /dev/null +++ b/.vscode/mcp.json @@ -0,0 +1,11 @@ +{ + "servers": { + "openclaw": { + "type": "stdio", + "command": "/home/paul/.nvm/versions/node/v22.23.0/bin/node", + "args": [ + "/home/paul/Workspace/tools/openclaw-mcp-server.js" + ] + } + } +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 0a4785b9..65938a22 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -26,5 +26,16 @@ "cSpell.language": "fr,en", "makefile.configureOnOpen": false, "search.useGlobalIgnoreFiles": true, - "search.useParentIgnoreFiles": true + "search.useParentIgnoreFiles": true, + "chat.mcp.serverSampling": { + "yavsc/.vscode/mcp.json: openclaw": { + "allowedModels": [ + "copilot/auto", + "copilotcli/claude-haiku-4.5", + "copilotcli/gpt-4.1", + "copilotcli/gpt-5-mini", + "copilotcli/mai-code-1-flash-picker" + ] + } + } } diff --git a/src/Yavsc.Org.Tests/Controllers/CommandFormsControllerTests.cs b/src/Yavsc.Org.Tests/Controllers/CommandFormsControllerTests.cs new file mode 100644 index 00000000..f32893c7 --- /dev/null +++ b/src/Yavsc.Org.Tests/Controllers/CommandFormsControllerTests.cs @@ -0,0 +1,38 @@ +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Testing; +using Xunit; + +namespace Yavsc.Org.Tests.Controllers; + +public class CommandFormsControllerTests : IClassFixture +{ + private readonly TestWebApplicationFactory _factory; + + public CommandFormsControllerTests(TestWebApplicationFactory factory) + { + _factory = factory; + } + + private HttpClient CreateAdminClient() + { + var http = _factory.CreateClient(new WebApplicationFactoryClientOptions + { + HandleCookies = true, + }); + http.DefaultRequestHeaders.Add(TestAuthPolicyProvider.HeaderName, TestAuthPolicyProvider.AdminRole); + return http; + } + + [Fact] + public async Task Create_GET_returns_200_for_admin() + { + var http = CreateAdminClient(); + var response = await http.GetAsync("/CommandForms/Create", TestContext.Current.CancellationToken); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var body = await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); + Assert.Contains("Create", body); + } +} diff --git a/src/Yavsc.Org/Controllers/Contracting/CommandFormsController.cs b/src/Yavsc.Org/Controllers/Contracting/CommandFormsController.cs index 4428105e..05c98138 100644 --- a/src/Yavsc.Org/Controllers/Contracting/CommandFormsController.cs +++ b/src/Yavsc.Org/Controllers/Contracting/CommandFormsController.cs @@ -50,7 +50,7 @@ namespace Yavsc.Controllers private void SetViewBag(CommandForm commandForm = null) { ViewBag.ActivityCode = new SelectList(_context.Activities, "Code", "Name", commandForm?.ActivityCode); - ViewBag.ActionName = _context.CommandForm.Select(c => new SelectListItem { Value = c.Id.ToString(), Text = c.Title, Selected = commandForm.Id == c.Id }); + ViewBag.ActionName = new SelectList(_context.CommandForm, nameof(CommandForm.Id), nameof(CommandForm.Title), commandForm?.Id); } // POST: CommandForms/Create [HttpPost] diff --git a/src/Yavsc.Org/Resources/Views/CommandForms/Index.resx b/src/Yavsc.Org/Resources/Views/CommandForms/Index.resx new file mode 100644 index 00000000..403a235d --- /dev/null +++ b/src/Yavsc.Org/Resources/Views/CommandForms/Index.resx @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Formulaires de commandes + diff --git a/src/Yavsc.Org/Views/Administration/Role.cshtml b/src/Yavsc.Org/Views/Administration/Role.cshtml index 68a5710f..e541f75a 100644 --- a/src/Yavsc.Org/Views/Administration/Role.cshtml +++ b/src/Yavsc.Org/Views/Administration/Role.cshtml @@ -21,7 +21,19 @@ @foreach (var user in Model.Users) { - avatar + @if (user.UserId==User.GetUserId()) { + You + } + @if (SiteSettings.Value.Admin.EMail == user.Email) { + Admin + } + @if (SiteSettings.Value.Owner.EMail == user.Email) { + Owner + } + @if (!String.IsNullOrWhiteSpace(user.Avatar)) + { + avatar + } @user.UserName <@(user.Email)> diff --git a/src/Yavsc.Org/Views/CommandForms/Index.cshtml b/src/Yavsc.Org/Views/CommandForms/Index.cshtml index ede4b71d..975f131f 100644 --- a/src/Yavsc.Org/Views/CommandForms/Index.cshtml +++ b/src/Yavsc.Org/Views/CommandForms/Index.cshtml @@ -1,10 +1,10 @@ @model IEnumerable @{ - ViewBag.Title = "Index"; + ViewBag.Title = Localizer["CommandForms"]; } -

Index

+

@ViewBag.Title

Create New @@ -22,7 +22,7 @@ - + @foreach (var item in Model) { diff --git a/src/Yavsc.Org/Views/Shared/_Layout.cshtml b/src/Yavsc.Org/Views/Shared/_Layout.cshtml index 98548d8d..d32f7daa 100644 --- a/src/Yavsc.Org/Views/Shared/_Layout.cshtml +++ b/src/Yavsc.Org/Views/Shared/_Layout.cshtml @@ -14,6 +14,7 @@ + @ViewBag.Title - Yavsc @await RenderSectionAsync("header", false) diff --git a/src/Yavsc.Org/wwwroot/css/site.css b/src/Yavsc.Org/wwwroot/css/site.css index e69de29b..bafc2d57 100644 --- a/src/Yavsc.Org/wwwroot/css/site.css +++ b/src/Yavsc.Org/wwwroot/css/site.css @@ -0,0 +1,4 @@ +.user-icon { + max-width: 1.5em; + max-height: 1.5em; +} diff --git a/src/Yavsc.Org/wwwroot/css/site.scss b/src/Yavsc.Org/wwwroot/css/site.scss index e69de29b..1bf7a4d3 100644 --- a/src/Yavsc.Org/wwwroot/css/site.scss +++ b/src/Yavsc.Org/wwwroot/css/site.scss @@ -0,0 +1,4 @@ +user-icon { + max-width: 1.5em; + max-height: 1.5em; +}