IW4M-Admin/WebfrontCore/Views/Server/Scoreboard.cshtml
2022-04-19 18:43:58 -05:00

33 lines
1.2 KiB
Plaintext

@using WebfrontCore.ViewModels
@model IEnumerable<WebfrontCore.ViewModels.ScoreboardInfo>
<div class="content mt-20 row">
<div class="col-12 col-lg-9 col-xl-10">
@if (Model is not null)
{
<div class=" scoreboard-container" data-server-id="@ViewBag.SelectedServerId">
@await Html.PartialAsync("_Scoreboard", Model.FirstOrDefault(server => server.ServerId == ViewBag.SelectedServerId) ?? Model.First())
</div>
}
</div>
@{
var menuItems = new SideContextMenuItems
{
MenuTitle = "Server", Items = Model.Select(server => new SideContextMenuItem
{
IsLink = true,
Reference = Url.Action("Scoreboard", "Server", new { serverId = server.ServerId }),
Title = server.ServerName.StripColors(),
IsActive = ViewBag.SelectedServerId == server.ServerId
}).ToList()
};
}
<partial name="_SideContextMenu" for="@menuItems"></partial>
</div>
@section scripts {
<environment include="Development">
<script type="text/javascript" src="~/js/scoreboard.js" defer="defer"></script>
</environment>
}