From 7ba58ca017d785efd935add6560a012f90ac2585 Mon Sep 17 00:00:00 2001 From: Brett Morrison Date: Sun, 7 Apr 2024 15:54:14 -0700 Subject: [PATCH] Separated out formatted roster into its own partial view and moved it to the top of the session details page --- pickuphockey/Views/Sessions/Details.cshtml | 2 +- .../Views/Shared/_RosterFormatted.cshtml | 143 ++++++++++++++++++ .../Views/Shared/_RosterPartial.cshtml | 116 -------------- pickuphockey/pickuphockey.csproj | 1 + 4 files changed, 145 insertions(+), 117 deletions(-) create mode 100644 pickuphockey/Views/Shared/_RosterFormatted.cshtml diff --git a/pickuphockey/Views/Sessions/Details.cshtml b/pickuphockey/Views/Sessions/Details.cshtml index 9970132..6f33c2e 100644 --- a/pickuphockey/Views/Sessions/Details.cshtml +++ b/pickuphockey/Views/Sessions/Details.cshtml @@ -25,10 +25,10 @@ { @TempData["Message"] } -
@Html.Partial("_UnmarkedReceivedPartial", Model) @Html.Partial("_UnmarkedSentPartial", Model) @Html.Partial("_EmergencyInfoPartial", Model.User) + @Html.Partial("_RosterFormatted", Model) @if (!Model.IsPast) {
diff --git a/pickuphockey/Views/Shared/_RosterFormatted.cshtml b/pickuphockey/Views/Shared/_RosterFormatted.cshtml new file mode 100644 index 0000000..efcfaff --- /dev/null +++ b/pickuphockey/Views/Shared/_RosterFormatted.cshtml @@ -0,0 +1,143 @@ +@model pickuphockey.Models.Session + + +@if (Model.RegularSetId != null) +{ +
+
+

Rockets

+ +
+
+ +
+

Beauties

+ +
+
+
+ foreach (var item in Model.Regulars.Where(r => r.TeamAssignment == pickuphockey.Models.TeamAssignment.Light).OrderByDescending(r => r.PositionPreference).ThenBy(u => u.User.FirstName)) + { + if (!item.SellingOrSoldSpot) + { + + } + } + foreach (var item in Model.LightSubs) + { + if (!item.ReSellingOrSold) + { + + } + } + foreach (var item in Model.Regulars.Where(r => r.TeamAssignment == pickuphockey.Models.TeamAssignment.Dark).OrderByDescending(r => r.PositionPreference).ThenBy(u => u.User.FirstName)) + { + if (!item.SellingOrSoldSpot) + { + + } + } + foreach (var item in Model.DarkSubs) + { + if (!item.ReSellingOrSold) + { + + } + } +} diff --git a/pickuphockey/Views/Shared/_RosterPartial.cshtml b/pickuphockey/Views/Shared/_RosterPartial.cshtml index 5a49b8d..e93b8d0 100644 --- a/pickuphockey/Views/Shared/_RosterPartial.cshtml +++ b/pickuphockey/Views/Shared/_RosterPartial.cshtml @@ -3,38 +3,8 @@ var isAdmin = User.IsInRole("Admin"); var isSubAdmin = User.IsInRole("SubAdmin"); } - @if (Model.RegularSetId != null) { -
-
-

Rockets

- -
-
- -
-

Beauties

- -
-
-

Roster - @Model.RegularSet.Description

@@ -64,12 +34,6 @@ var rating = string.Format("{0:0.0}", item.User.Rating); (@Html.DisplayFor(modelItem => rating))}, @Html.DisplayFor(modelItem => item.PositionPreference) -
} } @@ -94,11 +58,6 @@ var rating = string.Format("{0:0.0}", item.BuyerUser.Rating); (@Html.DisplayFor(modelItem => rating)) } -
} } @@ -125,12 +84,6 @@ var rating = string.Format("{0:0.0}", item.User.Rating); (@Html.DisplayFor(modelItem => rating))}, @Html.DisplayFor(modelItem => item.PositionPreference) -
} } @@ -155,11 +108,6 @@ var rating = string.Format("{0:0.0}", item.BuyerUser.Rating); (@Html.DisplayFor(modelItem => rating)) } -
} } @@ -174,67 +122,3 @@ }
} - - diff --git a/pickuphockey/pickuphockey.csproj b/pickuphockey/pickuphockey.csproj index 354e7a8..26e8984 100644 --- a/pickuphockey/pickuphockey.csproj +++ b/pickuphockey/pickuphockey.csproj @@ -756,6 +756,7 @@ +