IW4M-Admin/WebfrontCore/Views/Server/Scoreboard.cshtml
2022-04-20 08:39:16 -05:00

36 lines
1.2 KiB
Plaintext

@using WebfrontCore.ViewModels
@model IEnumerable<WebfrontCore.ViewModels.ScoreboardInfo>
@{
var selectedServer = Model?.FirstOrDefault(server => server.ServerId == ViewBag.SelectedServerId) ?? Model?.First();
}
<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">
<partial name="_Scoreboard" for="@selectedServer"/>
</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>
}