-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5 Create a first version of team ranking view.
- Loading branch information
Adrian Fürschuß
committed
Nov 23, 2016
1 parent
cef90c4
commit bb640e5
Showing
2 changed files
with
73 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
@model Wuzlstats.ViewModels.Teams.IndexViewModel | ||
|
||
@if (Model.Recent) | ||
{ | ||
<p class="help-block"> | ||
These are the teams of the last @Model.Days days. All of them.<br />This is pretty sweet, but it gets better: There's also | ||
<a href="@Url.Action("Index", "Teams", new { sort = Model.ActiveFilter, recent = false })">this very same statistic, but for all of the time</a>. All of it. Holy crap! | ||
</p> | ||
} | ||
else | ||
{ | ||
<p class="help-block"> | ||
These are all the players. Ever.<br />No one will be forgotten. Shame and fame will last till the very end of days, or at least until a database crash with no backups. <br /> | ||
There's the same statistic, <a href="@Url.Action("Index", "Teams", new { sort = Model.ActiveFilter, recent = true })">but only for the last @Model.Days days</a>, too. | ||
</p> | ||
} | ||
|
||
<div class="input-group"> | ||
Order By | ||
<div class="btn-group"> | ||
<a href="@Url.Action("Index", "Teams", new { recent = Model.Recent })" class="btn btn-default btn-sm @(string.IsNullOrEmpty(Model.ActiveFilter) ? "active" : "")">Last played</a> | ||
<a href="@Url.Action("Index", "Teams", new { sort = "best", recent = Model.Recent })" class="btn btn-default btn-sm @(Model.ActiveFilter == "best" ? "active" : "")">Best</a> | ||
<a href="@Url.Action("Index", "Teams", new { sort = "worst", recent = Model.Recent })" class="btn btn-default btn-sm @(Model.ActiveFilter == "worst" ? "active" : "")">Worst</a> | ||
<a href="@Url.Action("Index", "Teams", new { sort = "activity", recent = Model.Recent })" class="btn btn-default btn-sm @(Model.ActiveFilter == "activity" ? "active" : "")">Most active</a> | ||
</div> | ||
</div> | ||
|
||
<table class="table table-striped ranking teams"> | ||
<thead> | ||
<tr> | ||
<th></th> | ||
<th>Team</th> | ||
<th>Score</th> | ||
<th>Last game</th> | ||
<th>Count</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@{var rank = 1; } | ||
@foreach (var team in Model.Teams) | ||
{ | ||
<tr> | ||
<td> | ||
@(rank++) | ||
</td> | ||
<td> | ||
@Html.Partial("_Player", team.Player1) | ||
@Html.Partial("_Player", team.Player2) | ||
</td> | ||
<td> | ||
<div class="player-score"> | ||
<span class="ranking-wins">@team.Wins<span class="glyphicon glyphicon-thumbs-up"></span></span> | ||
<span class="ranking-losses">@team.Losses<span class="glyphicon glyphicon-thumbs-down"></span></span> | ||
</div> | ||
</td> | ||
<td> | ||
@team.LastGamePlayedOn.ToShortDateString() | ||
</td> | ||
<td> | ||
@team.GamesCount | ||
</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> |
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,8 @@ | ||
@model Wuzlstats.ViewModels.Teams.PlayerViewModel | ||
|
||
<div class="player"> | ||
<a href="@Url.Action("Index", "Player", new { id = Model.Id })"> | ||
<img src="data:image/png;base64,@Model.Image" alt="@Model.Name" class="ranking-image" /> | ||
</a> | ||
<div class="player-name">@Model.Name</div> | ||
</div> |