Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team registration improvements #323

Merged
merged 11 commits into from
Mar 21, 2019
7 changes: 4 additions & 3 deletions ServerCore/Pages/Teams/Apply.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@
//Needs route data - ViewData["PlayRoute"] = "/Teams/Apply";
}

<h2>Apply to a team</h2>
<h2>Request sent!</h2>

<hr />
<div class="row">
<div class="col-md-4">
You have applied to <strong>@{@Model.Team.Name}</strong>. 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 <strong>@{@Model.Team.Name}</strong>. 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.
</div>
</div>

<div>
<a asp-page="List">Back to List</a>
<br/>
<a asp-page="List">Back to team list</a>
</div>

@section Scripts {
Expand Down
23 changes: 13 additions & 10 deletions ServerCore/Pages/Teams/Create.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,40 @@ else
<form method="post">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Team.Name" class="control-label"></label>
<label asp-for="Team.Name" class="control-label">Team name</label>
<input asp-for="Team.Name" class="form-control" />
<span asp-validation-for="Team.Name" class="text-danger"></span>
</div>
<!-- TODO: Conditionally show/hide based on event property (not needed for PuzzleHunt)
<div class="form-group">
<label asp-for="Team.RoomID" class="control-label"></label>
<input asp-for="Team.RoomID" class="form-control" />
<span asp-validation-for="Team.RoomID" class="text-danger"></span>
</div>
-->
<div class="form-group">
<label asp-for="Team.CustomRoom" class="control-label"></label>
<label asp-for="Team.CustomRoom" class="control-label">Team room</label>
<input asp-for="Team.CustomRoom" class="form-control" />
<span asp-validation-for="Team.CustomRoom" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Team.PrimaryContactEmail" class="control-label"></label>
<input asp-for="Team.PrimaryContactEmail" class="form-control" />
<span asp-validation-for="Team.PrimaryContactEmail" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Team.PrimaryPhoneNumber" class="control-label"></label>
<label asp-for="Team.PrimaryPhoneNumber" class="control-label">Primary phone number</label>
<input asp-for="Team.PrimaryPhoneNumber" class="form-control" />
<span asp-validation-for="Team.PrimaryPhoneNumber" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Team.SecondaryPhoneNumber" class="control-label"></label>
<label asp-for="Team.SecondaryPhoneNumber" class="control-label">Secondary phone number (optional)</label>
<input asp-for="Team.SecondaryPhoneNumber" class="form-control" />
<span asp-validation-for="Team.SecondaryPhoneNumber" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Team.IsLookingForTeammates" class="control-label"></label>
<label asp-for="Team.PrimaryContactEmail" class="control-label">Primary contact e-mail (optional)</label>
<input asp-for="Team.PrimaryContactEmail" class="form-control" />
<span asp-validation-for="Team.PrimaryContactEmail" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Team.IsLookingForTeammates" class="control-label">Allow anonymous applications</label>
<p>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.</p>
<input asp-for="Team.IsLookingForTeammates" class="form-control" />
<span asp-validation-for="Team.IsLookingForTeammates" class="text-danger"></span>
</div>
Expand Down
74 changes: 57 additions & 17 deletions ServerCore/Pages/Teams/Delete.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,89 @@
<a asp-page="./Details" asp-route-teamId="@Model.Team.ID">Cancel</a>
</div>

<h3>Are you sure you want to delete this?</h3>
<h3>Are you sure you want to delete your team?</h3>
<div>
<h4>Team</h4>
<hr />
<dl class="dl-horizontal">
<dl>
<!-- class="dl-horizontal"> -->
<dt>
@Html.DisplayNameFor(model => model.Team.Name)
Team name
</dt>
<dd>
@Html.DisplayFor(model => model.Team.Name)
</dd>
<!-- TODO: Conditionally show/hide based on event property (not needed for PuzzleHunt)
<dt>
@Html.DisplayNameFor(model => model.Team.RoomID)
</dt>
<dd>
@Html.DisplayFor(model => model.Team.RoomID)
</dd>
-->
<dt>
@Html.DisplayNameFor(model => model.Team.RoomID)
Team room
</dt>
<dd>
@Html.DisplayFor(model => model.Team.RoomID)
@if (Model.Team.CustomRoom == null)
{
<div>(none)</div>
}
else
{
@Html.DisplayFor(model => model.Team.CustomRoom)
}
</dd>
<dt>
@Html.DisplayNameFor(model => model.Team.CustomRoom)
Primary phone number
</dt>
<dd>
@Html.DisplayFor(model => model.Team.CustomRoom)
@if (Model.Team.PrimaryPhoneNumber == null)
{
<div>(none)</div>
}
else
{
@Html.DisplayFor(model => model.Team.PrimaryPhoneNumber)
}
</dd>
<dt>
@Html.DisplayNameFor(model => model.Team.PrimaryContactEmail)
Secondary phone number
</dt>
<dd>
@Html.DisplayFor(model => model.Team.PrimaryContactEmail)
@if (Model.Team.SecondaryPhoneNumber == null)
{
<div>(none)</div>
}
else
{
@Html.DisplayFor(model => model.Team.SecondaryPhoneNumber)
}
</dd>
<dt>
@Html.DisplayNameFor(model => model.Team.PrimaryPhoneNumber)
Primary contact e-mail
</dt>
<dd>
@Html.DisplayFor(model => model.Team.PrimaryPhoneNumber)
@if (Model.Team.PrimaryContactEmail == null)
{
<div>(none)</div>
}
else
{
@Html.DisplayFor(model => model.Team.PrimaryContactEmail)
}
</dd>
<dt>
@Html.DisplayNameFor(model => model.Team.SecondaryPhoneNumber)
Allow anonymous applications
</dt>
<dd>
@Html.DisplayFor(model => model.Team.SecondaryPhoneNumber)
</dd>
<dd>
@Html.DisplayFor(model => model.Team.IsLookingForTeammates)
@if (Model.Team.IsLookingForTeammates)
{
<div>Yes (this team shows up on the list of teams that anyone can apply to)</div>
}
else
{
<div>No (only people who are sent an application link directly will be able to apply)</div>
}
</dd>
</dl>

Expand Down
117 changes: 84 additions & 33 deletions ServerCore/Pages/Teams/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -40,74 +40,95 @@

<div class="row">
<div class="column">
<h3>Details</h3>
<dl class="dl-horizontal">
<h3>Team details</h3>
<dl>
<!-- class="dl-horizontal"> -->
<dt>
@Html.DisplayNameFor(model => model.Team.Name)
Team name
</dt>
<dd>
@Html.DisplayFor(model => model.Team.Name)
</dd>
<!-- TODO: Conditionally show/hide based on event property (not needed for PuzzleHunt)
<dt>
@Html.DisplayNameFor(model => model.Team.RoomID)
</dt>
<dd>
@Html.DisplayFor(model => model.Team.RoomID)
</dd>
-->
<dt>
@Html.DisplayNameFor(model => model.Team.CustomRoom)
Team room
</dt>
<dd>
@Html.DisplayFor(model => model.Team.CustomRoom)
@if (Model.Team.CustomRoom == null)
{
<div>(none - please enter this before the start of the event)</div>
}
else
{
@Html.DisplayFor(model => model.Team.CustomRoom)
}
</dd>
<dt>
@Html.DisplayNameFor(model => model.Team.PrimaryContactEmail)
Primary phone number
</dt>
<dd>
@Html.DisplayFor(model => model.Team.PrimaryContactEmail)
@if (Model.Team.PrimaryPhoneNumber == null)
{
<div>(none - please enter this before the start of the event)</div>
}
else
{
@Html.DisplayFor(model => model.Team.PrimaryPhoneNumber)
}
</dd>
<dt>
@Html.DisplayNameFor(model => model.Team.PrimaryPhoneNumber)
Secondary phone number (optional)
</dt>
<dd>
@Html.DisplayFor(model => model.Team.PrimaryPhoneNumber)
@if (Model.Team.SecondaryPhoneNumber == null)
{
<div>(none)</div>
}
else
{
@Html.DisplayFor(model => model.Team.SecondaryPhoneNumber)
}
</dd>
<dt>
@Html.DisplayNameFor(model => model.Team.SecondaryPhoneNumber)
Primary contact e-mail (optional)
</dt>
<dd>
@Html.DisplayFor(model => model.Team.SecondaryPhoneNumber)
@if (Model.Team.PrimaryContactEmail == null)
{
<div>(none)</div>
}
else
{
@Html.DisplayFor(model => model.Team.PrimaryContactEmail)
}
</dd>
<dt>
@Html.DisplayNameFor(model => model.Team.IsLookingForTeammates)
Allow anonymous applications
</dt>
<dd>
@Html.DisplayFor(model => model.Team.IsLookingForTeammates)
@if (Model.Team.IsLookingForTeammates)
{
<div>Yes (this team shows up on the list of teams that anyone can apply to)</div>
}
else
{
<div>No (only people who are sent an application link directly will be able to apply)</div>
}
</dd>
</dl>
</div>
<div class="column">
<div>
<h3>Members (@(Model.Members.Count))</h3>
<h3>Current members (@(Model.Members.Count))</h3>
@{ bool canAdd = Model.EventRole == ModelBases.EventRole.admin; }

@if (!Model.Event.IsTeamMembershipChangeActive)
{
<div class="alert alert-danger" role="alert">
This event is not currently open for membership changes.
</div>
}
else if (Model.Members.Count >= Model.Event.MaxTeamSize)
{
<div class="alert alert-danger" role="alert">
This team is full.
</div>
}
else
{
canAdd = true;
}

</div>
<table class="table">
<thead>
Expand Down Expand Up @@ -170,12 +191,42 @@
}
</tbody>
</table>
@if (!Model.Event.IsTeamMembershipChangeActive)
{
<div class="alert alert-danger" role="alert">
This event is not currently open for membership changes.
</div>
}
else if (Model.Members.Count >= Model.Event.MaxTeamSize)
{
<div class="alert alert-danger" role="alert">
This team is full.
</div>
}
else
{
canAdd = true;
}
@if (canAdd)
{
<h3>Invite teammates</h3>
<p>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.</p>
<a asp-page="./Apply" asp-route-eventRole="play" asp-route-teamId="@Model.Team.ID">Team application link (copy me and email me!)</a>
<br />
<br />
@if (Model.Team.IsLookingForTeammates)
{
<p>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 <a asp-page="./Edit" asp-route-teamId="@Model.Team.ID"> here</a>.</p>

}
else
{
<p>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 <a asp-page="./Edit" asp-route-teamId="@Model.Team.ID"> here</a>.</p>
}


<h3>Pending requests (@(Model.Users.Count))</h3>
<h3>Pending requests (@Model.Users.Count)</h3>
<div>
<a asp-page="./Apply" asp-route-eventRole="play" asp-route-teamId="@Model.Team.ID">Application link (copy me and email me!)</a>
@if (Model.EventRole == ModelBases.EventRole.admin)
{
<a asp-page="./AddMember" asp-route-teamId="@Model.Team.ID"> | Add a different user</a>
Expand Down
Loading