cs2-web/Pages/Leaderboard.cshtml
Kamal Tufekcic 2d966b8198 initial commit
2026-07-05 12:14:39 +03:00

62 lines
2.3 KiB
Text

@page "/leaderboard"
@using CsWeb.Services
@model LeaderboardModel
@{
ViewData["Title"] = "Leaderboard";
var t = Model.Top;
var d = t?.Data;
}
<h1>Leaderboard</h1>
@if (t is null || d is null)
{
<div class="notice err">Leaderboards are unavailable right now (no server reachable).</div>
}
else
{
@if (!t.Online)
{
<div class="notice">Servers are offline — showing the last known standings (@Fmt.Age(t)).</div>
}
<div class="cols">
<section>
<h2>Progression</h2>
<div class="tablewrap">
<table>
<tr><th>#</th><th>Player</th><th class="num">Prestige</th><th class="num">Level</th></tr>
@foreach (var (r, i) in d.Levels.Select((r, i) => (r, i)))
{
<tr><td class="num">@(i + 1)</td><td>@r.Name</td><td class="num">@r.Prestige</td><td class="num">@r.Level</td></tr>
}
</table>
</div>
</section>
<section>
<h2>Deepest survival wave</h2>
<div class="tablewrap">
<table>
<tr><th>#</th><th>Player</th><th class="num">Wave</th></tr>
@foreach (var (r, i) in d.Waves.Select((r, i) => (r, i)))
{
<tr><td class="num">@(i + 1)</td><td>@r.Name</td><td class="num">@r.BestWave</td></tr>
}
@if (d.Waves.Count == 0) { <tr><td colspan="3" class="muted">No cleared waves recorded yet.</td></tr> }
</table>
</div>
</section>
<section>
<h2>Fastest Gun Game</h2>
<div class="tablewrap">
<table>
<tr><th>#</th><th>Player</th><th class="num">Time</th></tr>
@foreach (var (r, i) in d.GgTimes.Select((r, i) => (r, i)))
{
<tr><td class="num">@(i + 1)</td><td>@r.Name</td><td class="num">@Fmt.RunTime(r.BestMs)</td></tr>
}
@if (d.GgTimes.Count == 0) { <tr><td colspan="3" class="muted">No full ladder runs recorded yet.</td></tr> }
</table>
</div>
</section>
</div>
<p class="muted small">The clock starts at your first damage dealt or taken after joining — reconnecting doesn't reset it.</p>
}