fixup icons font path

This commit is contained in:
RaidMax 2022-04-20 08:39:16 -05:00
parent 20b8f0b99a
commit 21b0a7998d
5 changed files with 10 additions and 8 deletions

View File

@ -54,6 +54,7 @@ steps:
Write-Host 'Build Configuration is $(buildConfiguration), Release Type is $(releaseType)' Write-Host 'Build Configuration is $(buildConfiguration), Release Type is $(releaseType)'
md -Force lib\open-iconic\font\css 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 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 failOnStderr: true
workingDirectory: '$(Build.Repository.LocalPath)\WebfrontCore\wwwroot' workingDirectory: '$(Build.Repository.LocalPath)\WebfrontCore\wwwroot'

View File

@ -60,7 +60,7 @@ namespace WebfrontCore.Controllers
ViewBag.Title = Localization["WEBFRONT_TITLE_SCOREBOARD"]; ViewBag.Title = Localization["WEBFRONT_TITLE_SCOREBOARD"];
ViewBag.SelectedServerId = string.IsNullOrEmpty(serverId) ? Manager.GetServers().FirstOrDefault()?.ToString() : serverId; 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")] [HttpGet("[controller]/{id}/scoreboard")]
@ -79,7 +79,7 @@ namespace WebfrontCore.Controllers
} }
private static IEnumerable<ScoreboardInfo> ProjectScoreboard(IEnumerable<Server> servers, string order, private static IEnumerable<ScoreboardInfo> ProjectScoreboard(IEnumerable<Server> servers, string order,
bool down, bool includeDetails = true) bool down)
{ {
return servers.Select((server, index) => new ScoreboardInfo return servers.Select((server, index) => new ScoreboardInfo
{ {
@ -88,7 +88,7 @@ namespace WebfrontCore.Controllers
MapName = server.CurrentMap.ToString(), MapName = server.CurrentMap.ToString(),
ServerName = server.Hostname, ServerName = server.Hostname,
ServerId = server.ToString(), ServerId = server.ToString(),
ClientInfo = index == 0 && !includeDetails || includeDetails ? server.GetClientsAsList().Select(client => ClientInfo = server.GetClientsAsList().Select(client =>
new new
{ {
stats = client.GetAdditionalProperty<EFClientStatistics>(StatManager.CLIENT_STATS_KEY), stats = client.GetAdditionalProperty<EFClientStatistics>(StatManager.CLIENT_STATS_KEY),
@ -107,7 +107,7 @@ namespace WebfrontCore.Controllers
ZScore = clientData.stats?.ZScore == null || clientData.stats.ZScore == 0 ? null : clientData.stats.ZScore, ZScore = clientData.stats?.ZScore == null || clientData.stats.ZScore == 0 ? null : clientData.stats.ZScore,
Team = clientData.client.Team Team = clientData.client.Team
}) })
.ToList() : new List<ClientScoreboardInfo>() .ToList()
}).ToList(); }).ToList();
} }
} }

View File

@ -1,12 +1,15 @@
@using WebfrontCore.ViewModels @using WebfrontCore.ViewModels
@model IEnumerable<WebfrontCore.ViewModels.ScoreboardInfo> @model IEnumerable<WebfrontCore.ViewModels.ScoreboardInfo>
@{
var selectedServer = Model?.FirstOrDefault(server => server.ServerId == ViewBag.SelectedServerId) ?? Model?.First();
}
<div class="content mt-20 row"> <div class="content mt-20 row">
<div class="col-12 col-lg-9 col-xl-10"> <div class="col-12 col-lg-9 col-xl-10">
@if (Model is not null) @if (Model is not null)
{ {
<div class=" scoreboard-container" data-server-id="@ViewBag.SelectedServerId"> <div class=" scoreboard-container" data-server-id="@ViewBag.SelectedServerId">
@await Html.PartialAsync("_Scoreboard", Model.FirstOrDefault(server => server.ServerId == ViewBag.SelectedServerId) ?? Model.First()) <partial name="_Scoreboard" for="@selectedServer"/>
</div> </div>
} }
</div> </div>

View File

@ -78,6 +78,6 @@
</ProjectExtensions> </ProjectExtensions>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent"> <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="if $(ConfigurationName) == Debug ( &#xD;&#xA;powershell -Command wget https://raw.githubusercontent.com/iconic/open-iconic/master/font/css/open-iconic-bootstrap.scss -o $(ProjectDir)wwwroot\lib\open-iconic\font\css\open-iconic-bootstrap.scss&#xD;&#xA;echo d | xcopy /f /y $(ProjectDir)wwwroot\lib\open-iconic\font\fonts $(ProjectDir)wwwroot\font\&#xD;&#xA;)" /> <Exec Command="if $(ConfigurationName) == Debug ( &#xA;powershell -Command wget https://raw.githubusercontent.com/iconic/open-iconic/master/font/css/open-iconic-bootstrap.scss -o $(ProjectDir)wwwroot\lib\open-iconic\font\css\open-iconic-bootstrap.scss&#xA;echo d | xcopy /f /y $(ProjectDir)wwwroot\lib\open-iconic\font\fonts $(ProjectDir)wwwroot\font\&#xA;powershell -Command &quot;((Get-Content -path $(ProjectDir)wwwroot\lib\open-iconic\font\css\open-iconic-bootstrap.scss -Raw) -replace '../fonts/','/fonts/') | Set-Content -Path $(ProjectDir)wwwroot\lib\open-iconic\font\css\open-iconic-bootstrap.scss&quot;&#xA;)" />
</Target> </Target>
</Project> </Project>

View File

@ -1,7 +1,5 @@
@import 'profile.scss'; @import 'profile.scss';
$icon-font-path: '/font/' !default;
:root { :root {
--blue-color: #007ACC; --blue-color: #007ACC;