From 21b0a7998d9271c041f005416cae3bdba83073cb Mon Sep 17 00:00:00 2001 From: RaidMax Date: Wed, 20 Apr 2022 08:39:16 -0500 Subject: [PATCH] fixup icons font path --- DeploymentFiles/deployment-pipeline.yml | 1 + WebfrontCore/Controllers/ServerController.cs | 8 ++++---- WebfrontCore/Views/Server/Scoreboard.cshtml | 5 ++++- WebfrontCore/WebfrontCore.csproj | 2 +- WebfrontCore/wwwroot/css/src/main.scss | 2 -- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/DeploymentFiles/deployment-pipeline.yml b/DeploymentFiles/deployment-pipeline.yml index f144aeca2..2586caa10 100644 --- a/DeploymentFiles/deployment-pipeline.yml +++ b/DeploymentFiles/deployment-pipeline.yml @@ -54,6 +54,7 @@ steps: Write-Host 'Build Configuration is $(buildConfiguration), Release Type is $(releaseType)' md -Force lib\open-iconic\font\css wget https://raw.githubusercontent.com/iconic/open-iconic/master/font/css/open-iconic-bootstrap.scss -o lib\open-iconic\font\css\open-iconic-bootstrap.scss + ((Get-Content -path lib\open-iconic\font\css\open-iconic-bootstrap.scss -Raw) -replace '../fonts/','/fonts/') | Set-Content -Path lib\open-iconic\font\css\open-iconic-bootstrap.scss failOnStderr: true workingDirectory: '$(Build.Repository.LocalPath)\WebfrontCore\wwwroot' diff --git a/WebfrontCore/Controllers/ServerController.cs b/WebfrontCore/Controllers/ServerController.cs index 0f1532e52..f0ce6656e 100644 --- a/WebfrontCore/Controllers/ServerController.cs +++ b/WebfrontCore/Controllers/ServerController.cs @@ -60,7 +60,7 @@ namespace WebfrontCore.Controllers ViewBag.Title = Localization["WEBFRONT_TITLE_SCOREBOARD"]; ViewBag.SelectedServerId = string.IsNullOrEmpty(serverId) ? Manager.GetServers().FirstOrDefault()?.ToString() : serverId; - return View(ProjectScoreboard(Manager.GetServers(), null, true, false)); + return View(ProjectScoreboard(Manager.GetServers(), null, true)); } [HttpGet("[controller]/{id}/scoreboard")] @@ -79,7 +79,7 @@ namespace WebfrontCore.Controllers } private static IEnumerable ProjectScoreboard(IEnumerable servers, string order, - bool down, bool includeDetails = true) + bool down) { return servers.Select((server, index) => new ScoreboardInfo { @@ -88,7 +88,7 @@ namespace WebfrontCore.Controllers MapName = server.CurrentMap.ToString(), ServerName = server.Hostname, ServerId = server.ToString(), - ClientInfo = index == 0 && !includeDetails || includeDetails ? server.GetClientsAsList().Select(client => + ClientInfo = server.GetClientsAsList().Select(client => new { stats = client.GetAdditionalProperty(StatManager.CLIENT_STATS_KEY), @@ -107,7 +107,7 @@ namespace WebfrontCore.Controllers ZScore = clientData.stats?.ZScore == null || clientData.stats.ZScore == 0 ? null : clientData.stats.ZScore, Team = clientData.client.Team }) - .ToList() : new List() + .ToList() }).ToList(); } } diff --git a/WebfrontCore/Views/Server/Scoreboard.cshtml b/WebfrontCore/Views/Server/Scoreboard.cshtml index 7fa0e23c0..c1bbf6463 100644 --- a/WebfrontCore/Views/Server/Scoreboard.cshtml +++ b/WebfrontCore/Views/Server/Scoreboard.cshtml @@ -1,12 +1,15 @@ @using WebfrontCore.ViewModels @model IEnumerable +@{ + var selectedServer = Model?.FirstOrDefault(server => server.ServerId == ViewBag.SelectedServerId) ?? Model?.First(); +}
@if (Model is not null) {
- @await Html.PartialAsync("_Scoreboard", Model.FirstOrDefault(server => server.ServerId == ViewBag.SelectedServerId) ?? Model.First()) +
}
diff --git a/WebfrontCore/WebfrontCore.csproj b/WebfrontCore/WebfrontCore.csproj index 7631cbf33..5a6c1056a 100644 --- a/WebfrontCore/WebfrontCore.csproj +++ b/WebfrontCore/WebfrontCore.csproj @@ -78,6 +78,6 @@ - + diff --git a/WebfrontCore/wwwroot/css/src/main.scss b/WebfrontCore/wwwroot/css/src/main.scss index 1438d6f2a..a96349cae 100644 --- a/WebfrontCore/wwwroot/css/src/main.scss +++ b/WebfrontCore/wwwroot/css/src/main.scss @@ -1,7 +1,5 @@ @import 'profile.scss'; -$icon-font-path: '/font/' !default; - :root { --blue-color: #007ACC;