From 1054deaebf1c27bb9125532cea1fa478addc75f0 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 4 Jun 2026 19:18:28 +0100 Subject: [PATCH] Fixes the contact page --- .vscode/launch.json | 8 +++++++- .vscode/tasks.json | 5 ++--- src/Yavsc.Org/Views/Home/Contact.cshtml | 13 +++---------- .../Shared/DisplayTemplates/PostalAddress.cshtml | 8 +++++++- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index ec5bcb28..0acda146 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,11 +4,17 @@ // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "C#: Yavsc.Org Debug", + "type": "dotnet", + "request": "launch", + "projectPath": "${workspaceFolder}/src/Yavsc.Org/Yavsc.Org.csproj" + }, { "name": "Yavsc.Org", "type": "coreclr", "request": "launch", - "preLaunchTask": "build", + "preLaunchTask": "build-web", "program": "${workspaceFolder}/src/Yavsc.Org/bin/Debug/net10.0/Yavsc.Org.dll", "args": [], "cwd": "${workspaceFolder}/src/Yavsc.Org", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 90a0e0a5..c384ec79 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -19,12 +19,11 @@ "command": "dotnet", "args": ["build"], "options": { - "cwd": "src/Yavsc" + "cwd": "src/Yavsc.Org" }, "group": { "kind": "build" - }, - "isBackground": true + } }, { "label": "build-webapi", diff --git a/src/Yavsc.Org/Views/Home/Contact.cshtml b/src/Yavsc.Org/Views/Home/Contact.cshtml index d4b940f3..d7ae2fa7 100755 --- a/src/Yavsc.Org/Views/Home/Contact.cshtml +++ b/src/Yavsc.Org/Views/Home/Contact.cshtml @@ -1,17 +1,10 @@ @using Microsoft.IdentityModel.Protocols.Configuration @model SiteSettings -@{ - ViewBag.Title = "Contact"; - if (Model.Owner==null) - throw new InvalidConfigurationException("no owner"); -} +

Contact

-

@ViewBag.Title

-

@ViewBag.Message

+

@Model.Owner.Name

-

-@Model.Owner.Name
-@Html.DisplayFor(m=>m.Owner.PostalAddress)

+@Html.DisplayFor(m=>m.Owner.PostalAddress)
Support: @(Model.Admin.Name)<@(Model.Admin.EMail)>
diff --git a/src/Yavsc.Org/Views/Shared/DisplayTemplates/PostalAddress.cshtml b/src/Yavsc.Org/Views/Shared/DisplayTemplates/PostalAddress.cshtml index 30aa772a..ce718267 100644 --- a/src/Yavsc.Org/Views/Shared/DisplayTemplates/PostalAddress.cshtml +++ b/src/Yavsc.Org/Views/Shared/DisplayTemplates/PostalAddress.cshtml @@ -1,8 +1,14 @@ @model PostalAddress - +@if (Model==null) +{ + ⚠ Pas d'adresse postale renseignée ⚠ +} +else {
@Model.Street1
@Model.Street2
@Model.PostalCode, @Model.City
@Model.Province @Model.State @Model.Country
+} +