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)'
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'

View File

@ -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<ScoreboardInfo> ProjectScoreboard(IEnumerable<Server> 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<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,
Team = clientData.client.Team
})
.ToList() : new List<ClientScoreboardInfo>()
.ToList()
}).ToList();
}
}

View File

@ -1,12 +1,15 @@
@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">
@await Html.PartialAsync("_Scoreboard", Model.FirstOrDefault(server => server.ServerId == ViewBag.SelectedServerId) ?? Model.First())
<partial name="_Scoreboard" for="@selectedServer"/>
</div>
}
</div>

View File

@ -78,6 +78,6 @@
</ProjectExtensions>
<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>
</Project>

View File

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