IW4M-Admin/WebfrontCore/Views/Server/Scoreboard.cshtml

39 lines
1.4 KiB
Plaintext
Raw Normal View History

2022-04-19 19:43:58 -04:00
@using WebfrontCore.ViewModels
@model IEnumerable<WebfrontCore.ViewModels.ScoreboardInfo>
2022-04-20 09:39:16 -04:00
@{
var selectedServer = Model?.FirstOrDefault(server => server.ServerId == ViewBag.SelectedServerId) ?? Model?.First();
}
2022-01-22 13:49:12 -05:00
2022-04-19 19:43:58 -04:00
<div class="content mt-20 row">
<div class="col-12 col-lg-9">
2022-04-19 19:43:58 -04:00
@if (Model is not null)
{
2022-07-05 13:42:17 -04:00
<div class="scoreboard-container" data-server-id="@ViewBag.SelectedServerId">
2022-04-20 09:39:16 -04:00
<partial name="_Scoreboard" for="@selectedServer"/>
2022-04-19 19:43:58 -04:00
</div>
}
</div>
@{
var menuItems = new SideContextMenuItems
{
2022-07-05 13:02:43 -04:00
MenuTitle = ViewBag.Localization["WEBFRONT_CONTEXT_MENU_GLOBAL_SERVER"],
Items = Model.Select(server => new SideContextMenuItem
2022-04-19 19:43:58 -04:00
{
IsLink = true,
Reference = Url.Action("Scoreboard", "Server", new { serverId = server.ServerId }),
Title = server.ServerName.StripColors(),
IsActive = ViewBag.SelectedServerId == server.ServerId,
IsCollapse = true,
Meta = server.GameCode.ToString()
2022-04-19 19:43:58 -04:00
}).ToList()
};
2022-01-22 13:49:12 -05:00
}
2022-04-19 19:43:58 -04:00
<partial name="_SideContextMenu" for="@menuItems"></partial>
2022-01-22 13:49:12 -05:00
</div>
@section scripts {
<environment include="Development">
<script type="text/javascript" src="~/js/scoreboard.js" defer="defer"></script>
</environment>
}