-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separated out formatted roster into its own partial view and moved it…
… to the top of the session details page
- Loading branch information
1 parent
5f89c34
commit 7ba58ca
Showing
4 changed files
with
145 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
@model pickuphockey.Models.Session | ||
<style> | ||
.team-container-wrapper { | ||
display: flex; | ||
justify-content: center; | ||
margin-bottom: 5px; | ||
flex-wrap: wrap; | ||
} | ||
.team-container { | ||
flex: 1 0 400px; | ||
padding: 20px; | ||
border-radius: 25px; | ||
margin: 10px; | ||
} | ||
.team-name { | ||
font-size: 48px; | ||
font-weight: bold; | ||
text-align: center; | ||
margin-bottom: 10px; | ||
font-family: "Roboto Condensed", sans-serif; | ||
} | ||
.player-list { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
grid-gap: 10px; | ||
} | ||
.player-item { | ||
padding: 10px 15px; | ||
border-radius: 5px; | ||
font-family: "Roboto Condensed", sans-serif; | ||
font-size: 22px; | ||
} | ||
.light-team { | ||
background-color: #f0f0f0; | ||
color: #333; | ||
} | ||
.light-team .player-item { | ||
background-color: #e0e0e0; | ||
} | ||
.dark-team { | ||
background-color: #333; | ||
color: #fff; | ||
} | ||
.dark-team .player-item { | ||
background-color: #444; | ||
} | ||
.logo { | ||
display: block; | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: 180px; | ||
padding: 10px; | ||
border-radius: 25px; | ||
} | ||
</style> | ||
<script> | ||
function AddLight(name, pos) { | ||
const lightTeamList = document.getElementById("light-list"); | ||
const listItem = document.createElement("div"); | ||
listItem.className = "player-item"; | ||
listItem.textContent = name + ((pos.length > 0) ? ', ' + pos : ''); | ||
lightTeamList.appendChild(listItem); | ||
} | ||
function AddDark(name, pos) { | ||
const darkTeamList = document.getElementById("dark-list"); | ||
const listItem = document.createElement("div"); | ||
listItem.className = "player-item"; | ||
listItem.textContent = name + ((pos.length > 0) ? ', ' + pos : ''); | ||
darkTeamList.appendChild(listItem); | ||
} | ||
</script> | ||
@if (Model.RegularSetId != null) | ||
{ | ||
<div class="team-container-wrapper"> | ||
<div class="team-container light-team"> | ||
<h1 class="team-name">Rockets</h1> | ||
<img src="~/Content/Rockets_Logo.jpg" class="logo" /> | ||
<div id="light-list" class="player-list"></div> | ||
</div> | ||
|
||
<div class="team-container dark-team"> | ||
<h1 class="team-name">Beauties</h1> | ||
<img src="~/Content/Beauties_Logo.jpg" class="logo" /> | ||
<div id="dark-list" , class="player-list"></div> | ||
</div> | ||
</div> | ||
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) | ||
{ | ||
<script> | ||
var playerName = "@Html.DisplayFor(modelItem => item.User.FirstName) @Html.DisplayFor(modelItem => item.User.LastName)"; | ||
var playerPosition = "@Html.DisplayFor(modelItem => item.PositionPreference)" | ||
|
||
AddLight(playerName, playerPosition); | ||
</script> | ||
} | ||
} | ||
foreach (var item in Model.LightSubs) | ||
{ | ||
if (!item.ReSellingOrSold) | ||
{ | ||
<script> | ||
var playerName = "@Html.DisplayFor(modelItem => item.BuyerUser.FirstName) @Html.DisplayFor(modelItem => item.BuyerUser.LastName)"; | ||
|
||
AddLight(playerName, ''); | ||
</script> | ||
} | ||
} | ||
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) | ||
{ | ||
<script> | ||
var playerName = "@Html.DisplayFor(modelItem => item.User.FirstName) @Html.DisplayFor(modelItem => item.User.LastName)"; | ||
var playerPosition = "@Html.DisplayFor(modelItem => item.PositionPreference)" | ||
|
||
AddDark(playerName, playerPosition); | ||
</script> | ||
} | ||
} | ||
foreach (var item in Model.DarkSubs) | ||
{ | ||
if (!item.ReSellingOrSold) | ||
{ | ||
<script> | ||
var playerName = "@Html.DisplayFor(modelItem => item.BuyerUser.FirstName) @Html.DisplayFor(modelItem => item.BuyerUser.LastName)"; | ||
|
||
AddDark(playerName, ''); | ||
</script> | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters