From 3cd71ed915fb63f28620923317557180cb9f74b8 Mon Sep 17 00:00:00 2001 From: Peter Drier Date: Wed, 15 Apr 2026 04:25:20 +0200 Subject: [PATCH 1/2] Show shift signups on profile to coordinators (#493) Volunteer coordinators viewing another human's profile page now see the ShiftSignups component, so they can review and manage that human's signups without navigating to the admin view. Reuses the same gate as the existing no-show history block (coordinator of any team or a privileged signup approver). Co-Authored-By: Claude Opus 4.6 (1M context) --- src/Humans.Web/Controllers/ProfileController.cs | 4 +++- src/Humans.Web/Models/ProfileViewModel.cs | 6 ++++++ src/Humans.Web/Views/Profile/Index.cshtml | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Humans.Web/Controllers/ProfileController.cs b/src/Humans.Web/Controllers/ProfileController.cs index b64341201..7c18a808e 100644 --- a/src/Humans.Web/Controllers/ProfileController.cs +++ b/src/Humans.Web/Controllers/ProfileController.cs @@ -1009,10 +1009,11 @@ public async Task ViewProfile(Guid id, CancellationToken ct) // Load no-show history for coordinators/NoInfoAdmin/Admin viewing other profiles List? noShowHistory = null; + var viewerCanViewShiftHistory = false; if (!isOwnProfile) { var viewerIsCoordinator = (await _shiftMgmt.GetCoordinatorTeamIdsAsync(viewer.Id)).Count > 0; - var viewerCanViewShiftHistory = viewerIsCoordinator || ShiftRoleChecks.IsPrivilegedSignupApprover(User); + viewerCanViewShiftHistory = viewerIsCoordinator || ShiftRoleChecks.IsPrivilegedSignupApprover(User); if (viewerCanViewShiftHistory) { @@ -1047,6 +1048,7 @@ public async Task ViewProfile(Guid id, CancellationToken ct) IsOwnProfile = isOwnProfile, IsApproved = profile.IsApproved, NoShowHistory = noShowHistory, + CanViewShiftSignups = viewerCanViewShiftHistory, }; return View("Index", viewModel); diff --git a/src/Humans.Web/Models/ProfileViewModel.cs b/src/Humans.Web/Models/ProfileViewModel.cs index 91a49b7d9..82d79b3b7 100644 --- a/src/Humans.Web/Models/ProfileViewModel.cs +++ b/src/Humans.Web/Models/ProfileViewModel.cs @@ -313,6 +313,12 @@ public string? FormattedBirthday /// public List? NoShowHistory { get; set; } + /// + /// Whether the viewer can see the shift signups section (coordinators, signup approvers, admins). + /// Uses the same gate as NoShowHistory. Only meaningful when IsOwnProfile is false. + /// + public bool CanViewShiftSignups { get; set; } + /// /// Languages for editing (owner only). /// diff --git a/src/Humans.Web/Views/Profile/Index.cshtml b/src/Humans.Web/Views/Profile/Index.cshtml index b2315114a..eb2ef5835 100644 --- a/src/Humans.Web/Views/Profile/Index.cshtml +++ b/src/Humans.Web/Views/Profile/Index.cshtml @@ -66,6 +66,11 @@ } + @if (!Model.IsOwnProfile && Model.CanViewShiftSignups) + { + + } + @if (Model.NoShowHistory != null && Model.NoShowHistory.Count > 0) {
From a891681cca859b9dec5abd477c171c14520ec79f Mon Sep 17 00:00:00 2001 From: Peter Drier Date: Wed, 15 Apr 2026 04:28:04 +0200 Subject: [PATCH 2/2] Add CSP nonce to inline scripts on Profile/Edit (#495) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The eight inline - } - - - - -