From de973a7ef6c565517e8ffb26066de0784ef9fdb3 Mon Sep 17 00:00:00 2001 From: Jenna Netland Date: Sat, 16 Mar 2019 16:24:17 -0700 Subject: [PATCH 1/8] launch settings --- ServerCore/Properties/launchSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ServerCore/Properties/launchSettings.json b/ServerCore/Properties/launchSettings.json index 58ff0369..b8754ee6 100644 --- a/ServerCore/Properties/launchSettings.json +++ b/ServerCore/Properties/launchSettings.json @@ -14,7 +14,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } - },\ + }, "ServerCore": { "commandName": "Project", "launchBrowser": true, From fa52f2881763e72d0ee2112b518e771bdb8c23a6 Mon Sep 17 00:00:00 2001 From: Jenna Netland Date: Wed, 20 Mar 2019 21:45:59 -0700 Subject: [PATCH 2/8] Updated details page with clearer instructions --- ServerCore/Pages/Teams/Details.cshtml | 96 +++++++++++++++++++++------ 1 file changed, 74 insertions(+), 22 deletions(-) diff --git a/ServerCore/Pages/Teams/Details.cshtml b/ServerCore/Pages/Teams/Details.cshtml index 10698115..bec922ae 100644 --- a/ServerCore/Pages/Teams/Details.cshtml +++ b/ServerCore/Pages/Teams/Details.cshtml @@ -40,55 +40,93 @@
-

Details

-
+

Team details

+
+
- @Html.DisplayNameFor(model => model.Team.Name) + Team name
@Html.DisplayFor(model => model.Team.Name)
+
- @Html.DisplayNameFor(model => model.Team.RoomID) + Team room
- @Html.DisplayFor(model => model.Team.RoomID) -
-
- @Html.DisplayNameFor(model => model.Team.CustomRoom) -
-
- @Html.DisplayFor(model => model.Team.CustomRoom) + @if (Model.Team.CustomRoom == null) + { +
(none - please enter this before the start of the event)
+ } + else + { + @Html.DisplayFor(model => model.Team.CustomRoom) + }
- @Html.DisplayNameFor(model => model.Team.PrimaryContactEmail) + Primary phone number
- @Html.DisplayFor(model => model.Team.PrimaryContactEmail) + @if (Model.Team.PrimaryPhoneNumber == null) + { +
(none - please enter this before the start of the event)
+ } + else + { + @Html.DisplayFor(model => model.Team.PrimaryPhoneNumber) + }
- @Html.DisplayNameFor(model => model.Team.PrimaryPhoneNumber) + Secondary phone number (optional)
- @Html.DisplayFor(model => model.Team.PrimaryPhoneNumber) + @if (Model.Team.SecondaryPhoneNumber == null) + { +
(none)
+ } + else + { + @Html.DisplayFor(model => model.Team.SecondaryPhoneNumber) + }
- @Html.DisplayNameFor(model => model.Team.SecondaryPhoneNumber) + Primary contact e-mail (optional)
- @Html.DisplayFor(model => model.Team.SecondaryPhoneNumber) + @if (Model.Team.PrimaryContactEmail == null) + { +
(none)
+ } + else + { + @Html.DisplayFor(model => model.Team.PrimaryContactEmail) + }
- @Html.DisplayNameFor(model => model.Team.IsLookingForTeammates) + Allow anonymous applications
- @Html.DisplayFor(model => model.Team.IsLookingForTeammates) + @if (Model.Team.IsLookingForTeammates) + { +
Yes (this team shows up on the list of teams that anyone can apply to)
+ } + else + { +
No (only people who are sent an application link directly will be able to apply)
+ }
-

Members (@(Model.Members.Count))

+

Current members (@(Model.Members.Count))

@{ bool canAdd = Model.EventRole == ModelBases.EventRole.admin; } @if (!Model.Event.IsTeamMembershipChangeActive) @@ -172,10 +210,24 @@ @if (canAdd) { +

Invite teammates

+

Copy the link below and send it to teammates to give them a direct link to request to join this team. After they request to join the team you can accept them into the team using the table below.

+ Team application link (copy me and email me!) +
+
+ @if (Model.Team.IsLookingForTeammates) + { +

Note: Your team is currently marked as looking for anonymous teammates. You may get applications from people who you did not send the link to. To change this, edit your team details here.

+ + } + else + { +

Note: Your team is currently marked as not looking for anonymous teammates. Sending this link is the only way people will find your team. To change this, edit your team details here.

+ } + -

Pending requests (@(Model.Users.Count))

+

Pending requests (@Model.Users.Count)

- Application link (copy me and email me!) @if (Model.EventRole == ModelBases.EventRole.admin) { | Add a different user From c362924283e85f1d73b2e90c749d475bca71c8d2 Mon Sep 17 00:00:00 2001 From: Jenna Netland Date: Wed, 20 Mar 2019 21:49:49 -0700 Subject: [PATCH 3/8] Moves the error banner to replace the bottom two member sections --- ServerCore/Pages/Teams/Details.cshtml | 47 +++++++++++++-------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/ServerCore/Pages/Teams/Details.cshtml b/ServerCore/Pages/Teams/Details.cshtml index bec922ae..10f23cff 100644 --- a/ServerCore/Pages/Teams/Details.cshtml +++ b/ServerCore/Pages/Teams/Details.cshtml @@ -50,13 +50,13 @@ @Html.DisplayFor(model => model.Team.Name) +
+ @Html.DisplayNameFor(model => model.Team.RoomID) +
+
+ @Html.DisplayFor(model => model.Team.RoomID) +
+ -->
Team room
@@ -129,23 +129,6 @@

Current members (@(Model.Members.Count))

@{ bool canAdd = Model.EventRole == ModelBases.EventRole.admin; } - @if (!Model.Event.IsTeamMembershipChangeActive) - { - - } - else if (Model.Members.Count >= Model.Event.MaxTeamSize) - { - - } - else - { - canAdd = true; - } -
@@ -208,6 +191,22 @@ }
+ @if (!Model.Event.IsTeamMembershipChangeActive) + { + + } + else if (Model.Members.Count >= Model.Event.MaxTeamSize) + { + + } + else + { + canAdd = true; + } @if (canAdd) {

Invite teammates

From eb22b3e9d667cb983e626c60c4da00e709bda7b0 Mon Sep 17 00:00:00 2001 From: Jenna Netland Date: Wed, 20 Mar 2019 22:03:49 -0700 Subject: [PATCH 4/8] Updates to create/edit/delete to match property names / display in the details page --- ServerCore/Pages/Teams/Create.cshtml | 23 +++++---- ServerCore/Pages/Teams/Delete.cshtml | 74 +++++++++++++++++++++------- ServerCore/Pages/Teams/Edit.cshtml | 24 ++++----- 3 files changed, 83 insertions(+), 38 deletions(-) diff --git a/ServerCore/Pages/Teams/Create.cshtml b/ServerCore/Pages/Teams/Create.cshtml index 25bac863..5e3761b3 100644 --- a/ServerCore/Pages/Teams/Create.cshtml +++ b/ServerCore/Pages/Teams/Create.cshtml @@ -30,37 +30,40 @@ else
- +
+
- +
- - - -
-
- +
- +
- + + + +
+
+ +

Checking this box will cause your team to show up in the list of teams that players who are looking for a team can request to join. If you want to manually invite your teammates instead, do not check this box. You will have the opportunity to approve all requests on the website.

diff --git a/ServerCore/Pages/Teams/Delete.cshtml b/ServerCore/Pages/Teams/Delete.cshtml index 16b7f794..e8c16caf 100644 --- a/ServerCore/Pages/Teams/Delete.cshtml +++ b/ServerCore/Pages/Teams/Delete.cshtml @@ -14,49 +14,89 @@ Cancel
-

Are you sure you want to delete this?

+

Are you sure you want to delete your team?

-

Team


-
+
+
- @Html.DisplayNameFor(model => model.Team.Name) + Team name
@Html.DisplayFor(model => model.Team.Name)
+
- @Html.DisplayNameFor(model => model.Team.RoomID) + Team room
- @Html.DisplayFor(model => model.Team.RoomID) + @if (Model.Team.CustomRoom == null) + { +
(none - please enter this before the start of the event)
+ } + else + { + @Html.DisplayFor(model => model.Team.CustomRoom) + }
- @Html.DisplayNameFor(model => model.Team.CustomRoom) + Primary phone number
- @Html.DisplayFor(model => model.Team.CustomRoom) + @if (Model.Team.PrimaryPhoneNumber == null) + { +
(none - please enter this before the start of the event)
+ } + else + { + @Html.DisplayFor(model => model.Team.PrimaryPhoneNumber) + }
- @Html.DisplayNameFor(model => model.Team.PrimaryContactEmail) + Secondary phone number (optional)
- @Html.DisplayFor(model => model.Team.PrimaryContactEmail) + @if (Model.Team.SecondaryPhoneNumber == null) + { +
(none)
+ } + else + { + @Html.DisplayFor(model => model.Team.SecondaryPhoneNumber) + }
- @Html.DisplayNameFor(model => model.Team.PrimaryPhoneNumber) + Primary contact e-mail (optional)
- @Html.DisplayFor(model => model.Team.PrimaryPhoneNumber) + @if (Model.Team.PrimaryContactEmail == null) + { +
(none)
+ } + else + { + @Html.DisplayFor(model => model.Team.PrimaryContactEmail) + }
- @Html.DisplayNameFor(model => model.Team.SecondaryPhoneNumber) + Allow anonymous applications
- @Html.DisplayFor(model => model.Team.SecondaryPhoneNumber) -
-
- @Html.DisplayFor(model => model.Team.IsLookingForTeammates) + @if (Model.Team.IsLookingForTeammates) + { +
Yes (this team shows up on the list of teams that anyone can apply to)
+ } + else + { +
No (only people who are sent an application link directly will be able to apply)
+ }
diff --git a/ServerCore/Pages/Teams/Edit.cshtml b/ServerCore/Pages/Teams/Edit.cshtml index 5244dd46..903f6152 100644 --- a/ServerCore/Pages/Teams/Edit.cshtml +++ b/ServerCore/Pages/Teams/Edit.cshtml @@ -14,7 +14,6 @@ Cancel
-

Team


@@ -22,37 +21,40 @@
- +
+
- +
- - - -
-
- +
- +
- + + + +
+
+ +

Checking this box will cause your team to show up in the list of teams that players who are looking for a team can request to join. If you want to manually invite your teammates instead, do not check this box. You will have the opportunity to approve all requests on the website.

From 442609bf350739c056c403aa50fef546879d9e79 Mon Sep 17 00:00:00 2001 From: Jenna Netland Date: Wed, 20 Mar 2019 22:15:21 -0700 Subject: [PATCH 5/8] Updates to apply/list page --- ServerCore/Pages/Teams/Apply.cshtml | 7 ++++--- ServerCore/Pages/Teams/List.cshtml | 18 +++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ServerCore/Pages/Teams/Apply.cshtml b/ServerCore/Pages/Teams/Apply.cshtml index 0a2af620..37e21243 100644 --- a/ServerCore/Pages/Teams/Apply.cshtml +++ b/ServerCore/Pages/Teams/Apply.cshtml @@ -8,17 +8,18 @@ //Needs route data - ViewData["PlayRoute"] = "/Teams/Apply"; } -

Apply to a team

+

Request sent!


- You have applied to @{@Model.Team.Name}. Once they accept you, you will be on the team (make sure to contact somebody on the team and ask them to add you!). If you've previously requested to join to another team, that request has been removed. + You have applied to @{@Model.Team.Name}. If they accept you, you will be on the team (If you know someone on the team, make sure to contact somebody on the team and ask them to add you!). If you've previously requested to join to another team, that request has been removed.
@section Scripts { diff --git a/ServerCore/Pages/Teams/List.cshtml b/ServerCore/Pages/Teams/List.cshtml index 83d3f04e..d1dd063d 100644 --- a/ServerCore/Pages/Teams/List.cshtml +++ b/ServerCore/Pages/Teams/List.cshtml @@ -16,25 +16,25 @@ Registration will be open soon.
} - else if (DateTime.UtcNow > Model.Event.TeamRegistrationBegin) + else if (DateTime.UtcNow > Model.Event.TeamRegistrationEnd) {

Registration closed

- You are not part of a team for this event, and unfortuantely we're no longer accepting new teams into the event. :( + You are not part of a team for this event, and unfortuantely we're no longer accepting new teams into the event. You can still request to join an existing team.
} else if (Model.Teams.Count >= Model.Event.MaxNumberOfTeams) {

Registration full

- You are not part of a team for this event, and unfortuantely we're no longer accepting new teams into the event. :( + You are not part of a team for this event, and unfortuantely we're no longer accepting new teams into the event. You can still request to join an existing team.
} else {

Register for @Model.Event.Name

- You are not yet part of a team for this event. Create a new team or request to join one below! + You are not yet part of a team for this event. Create a new team or request to join one below. You can request to join one team at a time - check back to see if you've been accepted to a team or to change which team you've applied to.
Create a new team } @@ -46,14 +46,14 @@ - @Html.DisplayNameFor(model => model.Teams.FirstOrDefault().Key.Name) + Team name - Size + Current team size @if (Model.EventRole == ModelBases.EventRole.play && !Model.UserOnTeam && Model.Event.IsTeamMembershipChangeActive) { - Join + Request to join } @@ -72,11 +72,11 @@ @if (item.Key == Model.AppliedTeam) { - Applied + Request pending } else { - Join + Request to join } } From 443a5ce7957b9e0531616eba1365872132d1f678 Mon Sep 17 00:00:00 2001 From: Jenna Netland Date: Wed, 20 Mar 2019 22:32:57 -0700 Subject: [PATCH 6/8] Only teams looking for members show up in the 'Register' list --- ServerCore/Pages/Teams/Index.cshtml.cs | 2 +- ServerCore/Pages/Teams/List.cshtml.cs | 2 +- ServerCore/Pages/Teams/TeamListBase.cs | 36 ++++++++++++++++++-------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/ServerCore/Pages/Teams/Index.cshtml.cs b/ServerCore/Pages/Teams/Index.cshtml.cs index e6bd7f07..28ad8939 100644 --- a/ServerCore/Pages/Teams/Index.cshtml.cs +++ b/ServerCore/Pages/Teams/Index.cshtml.cs @@ -15,7 +15,7 @@ public IndexModel(PuzzleServerContext serverContext, UserManager u public async Task OnGetAsync() { - await LoadTeamDataAsync(); + await LoadTeamDataAsync(false); return Page(); } } diff --git a/ServerCore/Pages/Teams/List.cshtml.cs b/ServerCore/Pages/Teams/List.cshtml.cs index cdbd92e0..88a7d041 100644 --- a/ServerCore/Pages/Teams/List.cshtml.cs +++ b/ServerCore/Pages/Teams/List.cshtml.cs @@ -46,7 +46,7 @@ public async Task OnGetAsync() select application.Team; AppliedTeam = await applications.FirstOrDefaultAsync(); - await LoadTeamDataAsync(); + await LoadTeamDataAsync(true); return Page(); } diff --git a/ServerCore/Pages/Teams/TeamListBase.cs b/ServerCore/Pages/Teams/TeamListBase.cs index f1cba9b2..e95fa86e 100644 --- a/ServerCore/Pages/Teams/TeamListBase.cs +++ b/ServerCore/Pages/Teams/TeamListBase.cs @@ -24,18 +24,32 @@ public TeamListBase(PuzzleServerContext serverContext, UserManager /// public int PlayerCount { get; set; } - protected async Task LoadTeamDataAsync() + protected async Task LoadTeamDataAsync(bool onlyIncludeTeamsLookingForMembers) { - List allTeams = await (from team in _context.Teams - where team.Event == Event - select team).ToListAsync(); - - Teams = await (from team in _context.Teams - where team.Event == Event - join teamMember in _context.TeamMembers on team equals teamMember.Team - group teamMember by teamMember.Team into teamCounts - select new { Team = teamCounts.Key, Count = teamCounts.Count() }).ToDictionaryAsync(x => x.Team, x => x.Count); - + List allTeams = null; + if (onlyIncludeTeamsLookingForMembers) { + allTeams = await(from team in _context.Teams + where team.Event == Event + where team.IsLookingForTeammates == true + select team).ToListAsync(); + Teams = await (from team in _context.Teams + where team.Event == Event + where team.IsLookingForTeammates == true + join teamMember in _context.TeamMembers on team equals teamMember.Team + group teamMember by teamMember.Team into teamCounts + select new { Team = teamCounts.Key, Count = teamCounts.Count() }).ToDictionaryAsync(x => x.Team, x => x.Count); + } + else { + allTeams = await (from team in _context.Teams + where team.Event == Event + select team).ToListAsync(); + Teams = await (from team in _context.Teams + where team.Event == Event + join teamMember in _context.TeamMembers on team equals teamMember.Team + group teamMember by teamMember.Team into teamCounts + select new { Team = teamCounts.Key, Count = teamCounts.Count() }).ToDictionaryAsync(x => x.Team, x => x.Count); + } + foreach (Team team in allTeams) { if (!Teams.ContainsKey(team)) From 9eb42dfb1d414415f4f004ef757b84c40ed8be3c Mon Sep 17 00:00:00 2001 From: Jenna Netland Date: Wed, 20 Mar 2019 23:17:15 -0700 Subject: [PATCH 7/8] PR fixes --- ServerCore/Pages/Teams/Delete.cshtml | 8 +++--- ServerCore/Pages/Teams/Index.cshtml.cs | 2 +- ServerCore/Pages/Teams/List.cshtml | 12 +++++++++ ServerCore/Pages/Teams/List.cshtml.cs | 2 +- ServerCore/Pages/Teams/TeamListBase.cs | 34 ++++++++------------------ 5 files changed, 28 insertions(+), 30 deletions(-) diff --git a/ServerCore/Pages/Teams/Delete.cshtml b/ServerCore/Pages/Teams/Delete.cshtml index e8c16caf..5473fa45 100644 --- a/ServerCore/Pages/Teams/Delete.cshtml +++ b/ServerCore/Pages/Teams/Delete.cshtml @@ -39,7 +39,7 @@
@if (Model.Team.CustomRoom == null) { -
(none - please enter this before the start of the event)
+
(none)
} else { @@ -52,7 +52,7 @@
@if (Model.Team.PrimaryPhoneNumber == null) { -
(none - please enter this before the start of the event)
+
(none)
} else { @@ -60,7 +60,7 @@ }
- Secondary phone number (optional) + Secondary phone number
@if (Model.Team.SecondaryPhoneNumber == null) @@ -73,7 +73,7 @@ }
- Primary contact e-mail (optional) + Primary contact e-mail
@if (Model.Team.PrimaryContactEmail == null) diff --git a/ServerCore/Pages/Teams/Index.cshtml.cs b/ServerCore/Pages/Teams/Index.cshtml.cs index 28ad8939..e6bd7f07 100644 --- a/ServerCore/Pages/Teams/Index.cshtml.cs +++ b/ServerCore/Pages/Teams/Index.cshtml.cs @@ -15,7 +15,7 @@ public IndexModel(PuzzleServerContext serverContext, UserManager u public async Task OnGetAsync() { - await LoadTeamDataAsync(false); + await LoadTeamDataAsync(); return Page(); } } diff --git a/ServerCore/Pages/Teams/List.cshtml b/ServerCore/Pages/Teams/List.cshtml index d1dd063d..db704bf3 100644 --- a/ServerCore/Pages/Teams/List.cshtml +++ b/ServerCore/Pages/Teams/List.cshtml @@ -30,6 +30,13 @@ You are not part of a team for this event, and unfortuantely we're no longer accepting new teams into the event. You can still request to join an existing team.
} + else if (!Model.Event.IsTeamMembershipChangeActive) + { +

Registration closed.

+
+ The deadline for creating or joining teams for this event has passed. We hope to see you next time! +
+ } else {

Register for @Model.Event.Name

@@ -60,6 +67,11 @@ @foreach (var item in Model.Teams) { + if (!item.Key.IsLookingForTeammates) + { + continue; + } + @Html.DisplayFor(modelItem => item.Key.Name) diff --git a/ServerCore/Pages/Teams/List.cshtml.cs b/ServerCore/Pages/Teams/List.cshtml.cs index 88a7d041..cdbd92e0 100644 --- a/ServerCore/Pages/Teams/List.cshtml.cs +++ b/ServerCore/Pages/Teams/List.cshtml.cs @@ -46,7 +46,7 @@ public async Task OnGetAsync() select application.Team; AppliedTeam = await applications.FirstOrDefaultAsync(); - await LoadTeamDataAsync(true); + await LoadTeamDataAsync(); return Page(); } diff --git a/ServerCore/Pages/Teams/TeamListBase.cs b/ServerCore/Pages/Teams/TeamListBase.cs index e95fa86e..828d8bcb 100644 --- a/ServerCore/Pages/Teams/TeamListBase.cs +++ b/ServerCore/Pages/Teams/TeamListBase.cs @@ -24,32 +24,18 @@ public TeamListBase(PuzzleServerContext serverContext, UserManager /// public int PlayerCount { get; set; } - protected async Task LoadTeamDataAsync(bool onlyIncludeTeamsLookingForMembers) + protected async Task LoadTeamDataAsync() { List allTeams = null; - if (onlyIncludeTeamsLookingForMembers) { - allTeams = await(from team in _context.Teams - where team.Event == Event - where team.IsLookingForTeammates == true - select team).ToListAsync(); - Teams = await (from team in _context.Teams - where team.Event == Event - where team.IsLookingForTeammates == true - join teamMember in _context.TeamMembers on team equals teamMember.Team - group teamMember by teamMember.Team into teamCounts - select new { Team = teamCounts.Key, Count = teamCounts.Count() }).ToDictionaryAsync(x => x.Team, x => x.Count); - } - else { - allTeams = await (from team in _context.Teams - where team.Event == Event - select team).ToListAsync(); - Teams = await (from team in _context.Teams - where team.Event == Event - join teamMember in _context.TeamMembers on team equals teamMember.Team - group teamMember by teamMember.Team into teamCounts - select new { Team = teamCounts.Key, Count = teamCounts.Count() }).ToDictionaryAsync(x => x.Team, x => x.Count); - } - + allTeams = await (from team in _context.Teams + where team.Event == Event + select team).ToListAsync(); + Teams = await (from team in _context.Teams + where team.Event == Event + join teamMember in _context.TeamMembers on team equals teamMember.Team + group teamMember by teamMember.Team into teamCounts + select new { Team = teamCounts.Key, Count = teamCounts.Count() }).ToDictionaryAsync(x => x.Team, x => x.Count); + foreach (Team team in allTeams) { if (!Teams.ContainsKey(team)) From 09981627b6f0a60843b61bd3ebd1b7530e1debc1 Mon Sep 17 00:00:00 2001 From: Jenna Netland Date: Wed, 20 Mar 2019 23:21:20 -0700 Subject: [PATCH 8/8] Fixing nit :) --- ServerCore/Pages/Teams/TeamListBase.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ServerCore/Pages/Teams/TeamListBase.cs b/ServerCore/Pages/Teams/TeamListBase.cs index 828d8bcb..d1bb6dbd 100644 --- a/ServerCore/Pages/Teams/TeamListBase.cs +++ b/ServerCore/Pages/Teams/TeamListBase.cs @@ -26,8 +26,7 @@ public TeamListBase(PuzzleServerContext serverContext, UserManager protected async Task LoadTeamDataAsync() { - List allTeams = null; - allTeams = await (from team in _context.Teams + List allTeams = await (from team in _context.Teams where team.Event == Event select team).ToListAsync(); Teams = await (from team in _context.Teams