update webfront translation strings

This commit is contained in:
RaidMax 2022-07-05 12:02:43 -05:00
parent a6c0a94f6c
commit 2fca68a7ea
38 changed files with 178 additions and 127 deletions

View File

@ -24,7 +24,7 @@ namespace WebfrontCore.Controllers
{ {
if (clientId == 0 || string.IsNullOrEmpty(password)) if (clientId == 0 || string.IsNullOrEmpty(password))
{ {
return Unauthorized("Invalid credentials"); return Unauthorized(Localization["WEBFRONT_ACTION_LOGIN_ERROR"]);
} }
try try
@ -73,16 +73,16 @@ namespace WebfrontCore.Controllers
: HttpContext.Connection.RemoteIpAddress?.ToString() : HttpContext.Connection.RemoteIpAddress?.ToString()
}); });
return Ok($"Welcome {privilegedClient.Name}. You are now logged in"); return Ok(Localization["WEBFRONT_ACTION_LOGIN_SUCCESS"].FormatExt(privilegedClient.CleanedName));
} }
} }
catch (Exception) catch (Exception)
{ {
return Unauthorized("Could not validate credentials"); return Unauthorized(Localization["WEBFRONT_ACTION_LOGIN_ERROR"]);
} }
return Unauthorized("Invalid credentials"); return Unauthorized(Localization["WEBFRONT_ACTION_LOGIN_ERROR"]);
} }
[HttpGet] [HttpGet]

View File

@ -78,7 +78,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = Localization["WEBFRONT_ACTION_BAN_NAME"], ActionButtonLabel = Localization["WEBFRONT_ACTION_BAN_NAME"],
Name = "Ban", Name = Localization["WEBFRONT_ACTION_BAN_NAME"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -152,7 +152,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = Localization["WEBFRONT_ACTION_UNBAN_NAME"], ActionButtonLabel = Localization["WEBFRONT_ACTION_UNBAN_NAME"],
Name = "Unban", Name = Localization["WEBFRONT_ACTION_UNBAN_NAME"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -193,7 +193,7 @@ namespace WebfrontCore.Controllers
var login = new ActionInfo var login = new ActionInfo
{ {
ActionButtonLabel = Localization["WEBFRONT_ACTION_LOGIN_NAME"], ActionButtonLabel = Localization["WEBFRONT_ACTION_LOGIN_NAME"],
Name = "Login", Name = Localization["WEBFRONT_ACTION_LOGIN_NAME"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -226,7 +226,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = Localization["WEBFRONT_ACTION_LABEL_EDIT"], ActionButtonLabel = Localization["WEBFRONT_ACTION_LABEL_EDIT"],
Name = "Edit", Name = Localization["WEBFRONT_ACTION_LABEL_EDIT"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -291,7 +291,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = Localization["WEBFRONT_ACTION_LABEL_SUBMIT_MESSAGE"], ActionButtonLabel = Localization["WEBFRONT_ACTION_LABEL_SUBMIT_MESSAGE"],
Name = "Chat", Name = Localization["WEBFRONT_ACTION_LABEL_SUBMIT_MESSAGE"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -367,7 +367,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = Localization["WEBFRONT_ACTION_FLAG_NAME"], ActionButtonLabel = Localization["WEBFRONT_ACTION_FLAG_NAME"],
Name = "Flag", Name = Localization["WEBFRONT_ACTION_FLAG_NAME"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -406,7 +406,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = Localization["WEBFRONT_ACTION_UNFLAG_NAME"], ActionButtonLabel = Localization["WEBFRONT_ACTION_UNFLAG_NAME"],
Name = "Unflag", Name = Localization["WEBFRONT_ACTION_UNFLAG_NAME"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -438,7 +438,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = Localization["WEBFRONT_ACTION_KICK_NAME"], ActionButtonLabel = Localization["WEBFRONT_ACTION_KICK_NAME"],
Name = "Kick", Name = Localization["WEBFRONT_ACTION_KICK_NAME"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -488,7 +488,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = "Dismiss", ActionButtonLabel = "Dismiss",
Name = "Dismiss Alert?", Name = Localization["WEBFRONT_ACTION_DISMISS_ALERT_SINGLE"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -512,7 +512,7 @@ namespace WebfrontCore.Controllers
{ {
new CommandResponseInfo new CommandResponseInfo
{ {
Response = "Alert dismissed" Response = Localization["WEBFRONT_ACTION_DISMISS_ALERT_SINGLE_RESPONSE"]
} }
}); });
} }
@ -522,7 +522,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = "Dismiss", ActionButtonLabel = "Dismiss",
Name = "Dismiss All Alerts?", Name = Localization["WEBFRONT_ACTION_DISMISS_ALERT_MANY"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()
@ -546,7 +546,7 @@ namespace WebfrontCore.Controllers
{ {
new CommandResponseInfo new CommandResponseInfo
{ {
Response = "Alerts dismissed" Response = Localization["WEBFRONT_ACTION_DISMISS_ALERT_MANY_RESPONSE"]
} }
}); });
} }
@ -556,7 +556,7 @@ namespace WebfrontCore.Controllers
var info = new ActionInfo var info = new ActionInfo
{ {
ActionButtonLabel = "Send", ActionButtonLabel = "Send",
Name = "Compose Message", Name = Localization["WEBFRONT_ACTION_OFFLINE_MESSAGE_BUTTON_COMPOSE"],
Inputs = new List<InputInfo> Inputs = new List<InputInfo>
{ {
new() new()

View File

@ -56,7 +56,7 @@ namespace WebfrontCore.Controllers
ViewBag.ClientIP = request.ClientIP; ViewBag.ClientIP = request.ClientIP;
ViewBag.ClientGuid = request.ClientGuid; ViewBag.ClientGuid = request.ClientGuid;
ViewBag.Title = "Ban Management"; ViewBag.Title = Localization["WEBFRONT_NAV_TITLE_BAN_MANAGEMENT"];
return View(results.Results); return View(results.Results);
} }

View File

@ -146,12 +146,8 @@ namespace WebfrontCore.Controllers
clientDto.Meta.AddRange(Authorized ? meta : meta.Where(m => !m.IsSensitive)); clientDto.Meta.AddRange(Authorized ? meta : meta.Where(m => !m.IsSensitive));
var strippedName = clientDto.Name.StripColors(); var strippedName = clientDto.Name.StripColors();
ViewBag.Title = strippedName.Substring(strippedName.Length - 1).ToLower()[0] == 's' ViewBag.Title = $"{strippedName} | {Localization["WEBFRONT_CLIENT_PROFILE_TITLE"]}";
? strippedName + "'" ViewBag.Description = Localization["WEBFRONT_PROFILE_DESCRIPTION"].FormatExt(strippedName);
: strippedName + "'s";
ViewBag.Title += " " + Localization["WEBFRONT_CLIENT_PROFILE_TITLE"];
ViewBag.Description = $"Client information for {strippedName}";
ViewBag.Keywords = $"IW4MAdmin, client, profile, {strippedName}";
ViewBag.UseNewStats = _config?.EnableAdvancedMetrics ?? true; ViewBag.UseNewStats = _config?.EnableAdvancedMetrics ?? true;
return View("Profile/Index", clientDto); return View("Profile/Index", clientDto);

View File

@ -100,7 +100,7 @@ namespace WebfrontCore.Controllers
new CommandResponseInfo new CommandResponseInfo
{ {
ClientId = client.ClientId, ClientId = client.ClientId,
Response = Utilities.CurrentLocalization.LocalizationIndex["COMMADS_RESTART_SUCCESS"] Response = Utilities.CurrentLocalization.LocalizationIndex["COMMANDS_RESTART_SUCCESS"]
} }
}; };
} }

View File

@ -86,7 +86,7 @@ public class BanInfoResourceQueryHelper : IResourceQueryHelper<BanInfoRequest, B
OffenderName = penalty.Penalty.Offender.CurrentAlias.Name, OffenderName = penalty.Penalty.Offender.CurrentAlias.Name,
Offense = string.IsNullOrEmpty(penalty.Penalty.AutomatedOffense) Offense = string.IsNullOrEmpty(penalty.Penalty.AutomatedOffense)
? penalty.Penalty.Offense ? penalty.Penalty.Offense
: "Anticheat Detection", : Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_BAN_INFO_AC_DETECTION"],
LinkId = penalty.Penalty.Offender.AliasLinkId, LinkId = penalty.Penalty.Offender.AliasLinkId,
penalty.Penalty.OffenderId, penalty.Penalty.OffenderId,
penalty.Penalty.PunisherId, penalty.Penalty.PunisherId,
@ -113,7 +113,7 @@ public class BanInfoResourceQueryHelper : IResourceQueryHelper<BanInfoRequest, B
OffenderName = penalty.Offender.CurrentAlias.Name, OffenderName = penalty.Offender.CurrentAlias.Name,
Offense = string.IsNullOrEmpty(penalty.AutomatedOffense) Offense = string.IsNullOrEmpty(penalty.AutomatedOffense)
? penalty.Offense ? penalty.Offense
: "Anticheat Detection", : Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_BAN_INFO_AC_DETECTION"],
LinkId = penalty.Offender.AliasLinkId, LinkId = penalty.Offender.AliasLinkId,
penalty.OffenderId, penalty.OffenderId,
penalty.PunisherId, penalty.PunisherId,

View File

@ -61,6 +61,6 @@
} }
<div class="ml-auto"> <div class="ml-auto">
<button type="submit" class="btn btn-primary">@Model.ActionButtonLabel</button> <button type="submit" class="btn btn-primary">@Model.ActionButtonLabel</button>
<a href="#" class="btn mr-5 ml-5" role="button" onclick="halfmoon.toggleModal('actionModal');">Close</a> <a href="#" class="btn mr-5 ml-5" role="button" onclick="halfmoon.toggleModal('actionModal');">@ViewBag.Localization["WEBFRONT_ACTION_MODAL_BUTTON_CLOSE"]</a>
</div> </div>
</form> </form>

View File

@ -9,7 +9,7 @@
<form method="get" class="mt-10"> <form method="get" class="mt-10">
<div class="d-flex flex-column flex-md-row"> <div class="d-flex flex-column flex-md-row">
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control bg-dark-dm bg-light-ex-lm" id="clientNameInput" name="clientName" value="@ViewBag.ClientName" placeholder="Client Name"> <input type="text" class="form-control bg-dark-dm bg-light-ex-lm" id="clientNameInput" name="clientName" value="@ViewBag.ClientName" placeholder="@ViewBag.Localization["WEBFRONT_BAN_MGMT_FORM_NAME"]">
<div class="input-group-append"> <div class="input-group-append">
<button class="btn bg-dark-dm bg-light-ex-lm" type="submit"> <button class="btn bg-dark-dm bg-light-ex-lm" type="submit">
<i class="oi oi-magnifying-glass"></i> <i class="oi oi-magnifying-glass"></i>
@ -18,7 +18,7 @@
</div> </div>
<div class="input-group mr-md-5 ml-md-10 mt-10 mb-5 mt-md-0 mb-md-0"> <div class="input-group mr-md-5 ml-md-10 mt-10 mb-5 mt-md-0 mb-md-0">
<input type="text" class="form-control bg-dark-dm bg-light-ex-lm" id="clientGuidInput" name="clientGuid" value="@ViewBag.ClientGuid" placeholder="Client GUID"> <input type="text" class="form-control bg-dark-dm bg-light-ex-lm" id="clientGuidInput" name="clientGuid" value="@ViewBag.ClientGuid" placeholder="@ViewBag.Localization["WEBFRONT_BAN_MGMT_FORM_GUID"]">
<div class="input-group-append"> <div class="input-group-append">
<button class="btn bg-dark-dm bg-light-ex-lm" type="submit"> <button class="btn bg-dark-dm bg-light-ex-lm" type="submit">
<i class="oi oi-magnifying-glass"></i> <i class="oi oi-magnifying-glass"></i>
@ -26,7 +26,7 @@
</div> </div>
</div> </div>
<div class="input-group mr-md-10 ml-md-5 mb-10 mt-5 mt-md-0 mb-md-0"> <div class="input-group mr-md-10 ml-md-5 mb-10 mt-5 mt-md-0 mb-md-0">
<input type="text" class="form-control bg-dark-dm bg-light-ex-lm" id="clientIPInput" name="clientIP" value="@ViewBag.ClientIP" placeholder="Client IP"> <input type="text" class="form-control bg-dark-dm bg-light-ex-lm" id="clientIPInput" name="clientIP" value="@ViewBag.ClientIP" placeholder="@ViewBag.Localization["WEBFRONT_BAN_MGMT_FORM_IP"]">
<div class="input-group-append"> <div class="input-group-append">
<button class="btn bg-dark-dm bg-light-ex-lm" type="submit"> <button class="btn bg-dark-dm bg-light-ex-lm" type="submit">
<i class="oi oi-magnifying-glass"></i> <i class="oi oi-magnifying-glass"></i>
@ -34,7 +34,7 @@
</div> </div>
</div> </div>
<div class="input-group"> <div class="input-group">
<input type="number" class="form-control bg-dark-dm bg-light-ex-lm" id="clientIdInput" name="clientId" value="@ViewBag.ClientId" placeholder="Client Id"> <input type="number" class="form-control bg-dark-dm bg-light-ex-lm" id="clientIdInput" name="clientId" value="@ViewBag.ClientId" placeholder="@ViewBag.Localization["WEBFRONT_BAN_MGMT_FORM_ID"]">
<div class="input-group-append"> <div class="input-group-append">
<button class="btn bg-dark-dm bg-light-ex-lm" type="submit"> <button class="btn bg-dark-dm bg-light-ex-lm" type="submit">
<i class="oi oi-magnifying-glass"></i> <i class="oi oi-magnifying-glass"></i>

View File

@ -27,13 +27,13 @@
{ {
<div class="text-muted font-weight-light">@ban.AttachedPenalty.Offense.CapClientName(30)</div> <div class="text-muted font-weight-light">@ban.AttachedPenalty.Offense.CapClientName(30)</div>
<div class="text-danger font-weight-light">@ban.AttachedPenalty.DateTime.ToStandardFormat()</div> <div class="text-danger font-weight-light">@ban.AttachedPenalty.DateTime.ToStandardFormat()</div>
<div class="btn profile-action w-100" data-action="unban" data-action-id="@ban.ClientId">Unban</div> <div class="btn profile-action w-100" data-action="unban" data-action-id="@ban.ClientId">@ViewBag.Localization["WEBFRONT_BAN_MGMT_ACTION_UNBAN"]</div>
} }
else else
{ {
<div class="align-self-end text-muted font-weight-light"> <div class="align-self-end text-muted font-weight-light">
<span class="oi oi-warning font-size-12"></span> <span class="oi oi-warning font-size-12"></span>
<span>Link-Only Ban</span> <span>@ViewBag.Localization["WEBFRONT_BAN_MGMT_LINK_ONLY"]</span>
</div> </div>
} }
</div> </div>
@ -43,7 +43,7 @@
@foreach (var associatedEntity in ban.AssociatedPenalties) @foreach (var associatedEntity in ban.AssociatedPenalties)
{ {
<div class="d-flex flex-wrap flex-column w-full w-md-200 p-10"> <div class="d-flex flex-wrap flex-column w-full w-md-200 p-10">
<div data-toggle="tooltip" data-title="Linked via shared IP" class="d-flex"> <div data-toggle="tooltip" data-title="@ViewBag.Localization["WEBFRONT_BAN_MGMT_TOOLTIP_LINKED"]" class="d-flex">
<i class="oi oi-link-intact align-self-center"></i> <i class="oi oi-link-intact align-self-center"></i>
<div class="text-truncate ml-5 mr-5"> <div class="text-truncate ml-5 mr-5">
<a asp-controller="Client" asp-action="Profile" asp-route-id="@associatedEntity.OffenderInfo.ClientId" class="font-size-18 no-decoration">@associatedEntity.OffenderInfo.ClientName</a> <a asp-controller="Client" asp-action="Profile" asp-route-id="@associatedEntity.OffenderInfo.ClientId" class="font-size-18 no-decoration">@associatedEntity.OffenderInfo.ClientName</a>
@ -62,7 +62,7 @@
<br/> <br/>
<div class="text-muted font-weight-light">@associatedEntity.Offense.CapClientName(30)</div> <div class="text-muted font-weight-light">@associatedEntity.Offense.CapClientName(30)</div>
<div class="text-danger font-weight-light">@associatedEntity.DateTime.ToStandardFormat()</div> <div class="text-danger font-weight-light">@associatedEntity.DateTime.ToStandardFormat()</div>
<div class="btn profile-action mt-10 w-100" data-action="unban" data-action-id="@associatedEntity.OffenderInfo.ClientId">Unban</div> <div class="btn profile-action mt-10 w-100" data-action="unban" data-action-id="@associatedEntity.OffenderInfo.ClientId">@ViewBag.Localization["WEBFRONT_BAN_MGMT_ACTION_UNBAN"]</div>
</div> </div>
} }
</div> </div>

View File

@ -34,7 +34,7 @@
@info.NewValue @info.NewValue
</td> </td>
<td class="text-right"> <td class="text-right">
@info.When.ToString() @info.When.ToStandardFormat()
</td> </td>
</tr> </tr>
@ -65,7 +65,7 @@
} }
<div class="mt-5 mb-5"> @info.Data</div> <div class="mt-5 mb-5"> @info.Data</div>
<div class="mt-5 mb-5">@info.NewValue</div> <div class="mt-5 mb-5">@info.NewValue</div>
<div class="mt-5 mb-5">@info.When.ToString()</div> <div class="mt-5 mb-5">@info.When</div>
</td> </td>
</tr> </tr>
} }

View File

@ -5,8 +5,31 @@
<!-- desktop --> <!-- desktop -->
<div class="content mt-0"> <div class="content mt-0">
<h2 class="content-title mt-20 mb-0">Search Results</h2> <h2 class="content-title mt-20 mb-0">@ViewBag.Localization["WEBFRONT_SEARCH_RESULTS_TITLE"]</h2>
<div class="text-muted mb-15"><span class="badge">@ViewBag.SearchTerm</span> returned <span class="text-primary">@ViewBag.ResultCount</span> matche(s)</div> <div class="text-muted mb-15">
@foreach (var match in Utilities.SplitTranslationTokens("WEBFRONT_SEARCH_RESULTS_SUBTITLE_FORMAT"))
{
if (match.IsInterpolation)
{
if (match.MatchValue == "searchTerm")
{
<span class="badge">
@ViewBag.SearchTerm
</span>
}
else if (match.MatchValue == "searchCount")
{
<span class="text-primary">@ViewBag.ResultCount</span>
}
}
else
{
<span>@match.MatchValue</span>
}
}
</div>
<table class="table d-none d-md-table"> <table class="table d-none d-md-table">
<thead> <thead>

View File

@ -9,7 +9,7 @@
else else
{ {
<h2 class="content-title mt-20 mb-0">Search Results</h2> <h2 class="content-title mt-20 mb-0">@ViewBag.Localization["WEBFRONT_SEARCH_RESULTS_TITLE"]</h2>
<div class="text-muted mb-15">@Html.Raw(Utilities.FormatExt(ViewBag.Localization["WEBFRONT_STATS_MESSAGES_FOUND"], $"<span class=\"badge\">{Model.TotalResultCount.ToString("N0")}</span>"))</div> <div class="text-muted mb-15">@Html.Raw(Utilities.FormatExt(ViewBag.Localization["WEBFRONT_STATS_MESSAGES_FOUND"], $"<span class=\"badge\">{Model.TotalResultCount.ToString("N0")}</span>"))</div>
<table class="table bg-dark-dm bg-light-lm rounded" style="table-layout: fixed"> <table class="table bg-dark-dm bg-light-lm rounded" style="table-layout: fixed">

View File

@ -54,7 +54,6 @@
<color-code value="@(message.ServerName ?? "--")"></color-code> <color-code value="@(message.ServerName ?? "--")"></color-code>
</div> </div>
<div>@message.When</div> <div>@message.When</div>
</td> </td>
</tr> </tr>
} }

View File

@ -10,7 +10,7 @@
<tr class="level-bgcolor-@((int)key)"> <tr class="level-bgcolor-@((int)key)">
<th class="text-light">@key.ToLocalizedLevelName()</th> <th class="text-light">@key.ToLocalizedLevelName()</th>
<th>Game</th> <th>Game</th>
<th class="text-right font-weight-bold">Last Connected</th> <th class="text-right font-weight-bold">@ViewBag.Localization["WEBFRONT_SEARCH_LAST_CONNECTED"]</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -25,7 +25,7 @@
<td> <td>
@if (client.IsMasked) @if (client.IsMasked)
{ {
<span data-toggle="tooltip" data-title="Client is masked"> <span data-toggle="tooltip" data-title="@ViewBag.Localization["WEBFRONT_PRIVILEGED_TOOLTIP_MASKED"]">
<span class="oi oi-shield mr-5 font-size-12"></span> <span class="oi oi-shield mr-5 font-size-12"></span>
</span> </span>
} }
@ -46,5 +46,4 @@
</tbody> </tbody>
</table> </table>
} }
</div> </div>

View File

@ -58,7 +58,7 @@
</has-permission> </has-permission>
} }
<h2 class="content-title mb-0">Player Profile</h2> <h2 class="content-title mb-0">@ViewBag.Localization["WEBFRONT_PROFILE_TITLE"]</h2>
<div class="font-size-12 text-muted">@ViewBag.Localization[$"GAME_{Model.Game}"]</div> <div class="font-size-12 text-muted">@ViewBag.Localization[$"GAME_{Model.Game}"]</div>
<div id="profile_wrapper" class="mb-10 mt-10"> <div id="profile_wrapper" class="mb-10 mt-10">
@ -66,7 +66,7 @@
<!-- online status indicator --> <!-- online status indicator -->
@if (Model.Online) @if (Model.Online)
{ {
<div class="bg-success rounded-circle position-absolute status-indicator z-20 mt-10 ml-10" data-toggle="tooltip" data-placement="bottom" data-title="Client is online"></div> <div class="bg-success rounded-circle position-absolute status-indicator z-20 mt-10 ml-10" data-toggle="tooltip" data-placement="bottom" data-title="@ViewBag.Localization["WEBFRONT_PROFILE_TOOLTIP_ONLINE"]"></div>
<div class="bg-success rounded-circle position-absolute status-indicator with-ripple z-10 mt-10 ml-10"></div> <div class="bg-success rounded-circle position-absolute status-indicator with-ripple z-10 mt-10 ml-10"></div>
} }
@ -105,7 +105,7 @@
@if (Model.Aliases.Count > 15) @if (Model.Aliases.Count > 15)
{ {
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<span class="dropdown-item bg-dark-dm bg-light-lm">...and @(Model.Aliases.Count - 15) more</span> <span class="dropdown-item bg-dark-dm bg-light-lm">@((ViewBag.Localization["WEBFRONT_PROFILE_ALIAS_COUNT_MORE_FORMAT"] as string).FormatExt(Model.Aliases.Count - 15))</span>
} }
</div> </div>
</div> </div>
@ -126,7 +126,7 @@
<div class="text-muted" data-toggle="dropdown" id="altGuidFormatsDropdown" aria-haspopup="true" aria-expanded="false">@Model.NetworkId.ToString("X")</div> <div class="text-muted" data-toggle="dropdown" id="altGuidFormatsDropdown" aria-haspopup="true" aria-expanded="false">@Model.NetworkId.ToString("X")</div>
<div class="dropdown-menu" aria-labelledby="altGuidFormatsDropdown"> <div class="dropdown-menu" aria-labelledby="altGuidFormatsDropdown">
<div class="p-10 font-size-12"> <div class="p-10 font-size-12">
<div class="">Alternative Formats</div> <div class="">@ViewBag.Localization["WEBFRONT_PROFILE_POPOVER_ALTERNATIVE_GUID"]</div>
<div class="dropdown-divider mt-5 mb-5"></div> <div class="dropdown-divider mt-5 mb-5"></div>
<div class="text-muted font-weight-lighter">@((ulong)Model.NetworkId)</div> <div class="text-muted font-weight-lighter">@((ulong)Model.NetworkId)</div>
</div> </div>
@ -164,7 +164,7 @@
@if (Model.IPs.Count > 15) @if (Model.IPs.Count > 15)
{ {
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<span class="dropdown-item bg-dark-dm bg-light-lm">...and @(Model.IPs.Count - 15) more</span> <span class="dropdown-item bg-dark-dm bg-light-lm">@((ViewBag.Localization["WEBFRONT_PROFILE_ALIAS_COUNT_MORE_FORMAT"] as string).FormatExt(Model.Aliases.Count - 15))</span>
} }
</div> </div>
</div> </div>
@ -252,18 +252,18 @@
@{ @{
var menuItems = new SideContextMenuItems var menuItems = new SideContextMenuItems
{ {
MenuTitle = "Actions", MenuTitle = ViewBag.Localization["WEBFRONT_PROFILE_CONTEXT_MENU_TITLE"]
}; };
if (Model.Online) if (Model.Online)
{ {
menuItems.Items.Add(new SideContextMenuItem menuItems.Items.Add(new SideContextMenuItem
{ {
Title = "Join Game", Title = ViewBag.Localization["WEBFRONT_PROFILE_CONTEXT_MENU_ACTION_JOIN"],
IsLink = true, IsLink = true,
IsButton = true, IsButton = true,
Reference = Model.ConnectProtocolUrl, Reference = Model.ConnectProtocolUrl,
Tooltip = $"Playing on {Model.CurrentServerName.StripColors()}", Tooltip = (ViewBag.Localization["WEBFRONT_PROFILE_CONTEXT_MENU_TOOLTIP_JOIN"] as string).FormatExt(Model.CurrentServerName.StripColors()),
Icon = "oi-play-circle" Icon = "oi-play-circle"
}); });
} }
@ -272,7 +272,7 @@
{ {
menuItems.Items.Add(new SideContextMenuItem menuItems.Items.Add(new SideContextMenuItem
{ {
Title = "Change Level", Title = ViewBag.Localization["WEBFRONT_PROFILE_CONTEXT_MENU_ACTION_LEVEL"],
IsButton = true, IsButton = true,
Reference = "edit", Reference = "edit",
Icon = "oi-cog", Icon = "oi-cog",
@ -284,7 +284,7 @@
{ {
menuItems.Items.Add(new SideContextMenuItem menuItems.Items.Add(new SideContextMenuItem
{ {
Title = "Message", Title = ViewBag.Localization["WEBFRONT_PROFILE_CONTEXT_MENU_ACTION_MESSAGE"],
IsButton = true, IsButton = true,
Reference = "OfflineMessage", Reference = "OfflineMessage",
Icon = "oi oi-envelope-closed", Icon = "oi oi-envelope-closed",
@ -294,7 +294,7 @@
menuItems.Items.Add(new SideContextMenuItem menuItems.Items.Add(new SideContextMenuItem
{ {
Title = "View Stats", Title = ViewBag.Localization["WEBFRONT_PROFILE_CONTEXT_MENU_ACTION_STATS"],
IsButton = true, IsButton = true,
IsLink = true, IsLink = true,
Reference = Url.Action("Advanced", "ClientStatistics", new { id = Model.ClientId }), Reference = Url.Action("Advanced", "ClientStatistics", new { id = Model.ClientId }),
@ -305,7 +305,7 @@
{ {
menuItems.Items.Add(new SideContextMenuItem menuItems.Items.Add(new SideContextMenuItem
{ {
Title = isFlagged ? "Unflag" : "Flag", Title = isFlagged ? ViewBag.Localization["WEBFRONT_ACTION_UNFLAG_NAME"] : ViewBag.Localization["WEBFRONT_ACTION_FLAG_NAME"],
IsButton = true, IsButton = true,
Reference = isFlagged ? "unflag" : "flag", Reference = isFlagged ? "unflag" : "flag",
Icon = "oi-flag", Icon = "oi-flag",
@ -317,7 +317,7 @@
{ {
menuItems.Items.Add(new SideContextMenuItem menuItems.Items.Add(new SideContextMenuItem
{ {
Title = "Kick", Title = ViewBag.Localization["WEBFRONT_ACTION_KICK_NAME"],
IsButton = true, IsButton = true,
Reference = "kick", Reference = "kick",
Icon = "oi-circle-x", Icon = "oi-circle-x",
@ -329,7 +329,7 @@
{ {
menuItems.Items.Add(new SideContextMenuItem menuItems.Items.Add(new SideContextMenuItem
{ {
Title = "Ban", Title = ViewBag.Localization["WEBFRONT_ACTION_BAN_NAME"],
IsButton = true, IsButton = true,
Reference = "ban", Reference = "ban",
Icon = "oi-lock-unlocked", Icon = "oi-lock-unlocked",
@ -341,7 +341,7 @@
{ {
menuItems.Items.Add(new SideContextMenuItem menuItems.Items.Add(new SideContextMenuItem
{ {
Title = "Unban", Title = ViewBag.Localization["WEBFRONT_ACTION_UNBAN_NAME"],
IsButton = true, IsButton = true,
Reference = "unban", Reference = "unban",
Icon = "oi-lock-locked", Icon = "oi-lock-locked",

View File

@ -18,7 +18,7 @@
@{var results = Utilities.SplitTranslationTokens(meta.meta.Key);} @{var results = Utilities.SplitTranslationTokens(meta.meta.Key);}
@if (results.Any(_result => _result.IsInterpolation)) @if (results.Any(result => result.IsInterpolation))
{ {
foreach (var result in results) foreach (var result in results)
{ {

View File

@ -7,7 +7,7 @@
} }
<span class="client-message" data-serverid="@Model.ServerId" data-when="@Model.When.ToFileTimeUtc()"> <span class="client-message" data-serverid="@Model.ServerId" data-when="@Model.When.ToFileTimeUtc()">
<span data-title="View Context" data-toggle="tooltip" data-placement="right"> <span data-title="@ViewBag.Localization["WEBFRONT_META_TOOLTIP_CONTEXT"]" data-toggle="tooltip" data-placement="right">
<span class="oi oi-chevron-right align-middle client-message-prefix" style="font-size: 0.75rem; margin-top: -0.256rem"></span> <span class="oi oi-chevron-right align-middle client-message-prefix" style="font-size: 0.75rem; margin-top: -0.256rem"></span>
</span> </span>
<span class="text-muted @(Model.IsQuickMessage ? "font-weight-bold" : "")"> <span class="text-muted @(Model.IsQuickMessage ? "font-weight-bold" : "")">

View File

@ -10,7 +10,7 @@
@model Stats.Dtos.AdvancedStatsInfo @model Stats.Dtos.AdvancedStatsInfo
@{ @{
ViewBag.Title = "Advanced Client Statistics"; ViewBag.Title = ViewBag.Localization["WEBFRONT_ADV_STATS_TITLE"];
ViewBag.Description = Model.ClientName.StripColors(); ViewBag.Description = Model.ClientName.StripColors();
const string headshotKey = "MOD_HEAD_SHOT"; const string headshotKey = "MOD_HEAD_SHOT";
@ -233,7 +233,7 @@
<div class="content row mt-20"> <div class="content row mt-20">
<!-- main content --> <!-- main content -->
<div class="col-12 col-lg-9 mt-0"> <div class="col-12 col-lg-9 mt-0">
<h2 class="content-title mb-0">Player Stats</h2> <h2 class="content-title mb-0">@ViewBag.Title</h2>
<span class="text-muted"> <span class="text-muted">
<color-code value="@(Model.Servers.FirstOrDefault(server => server.Endpoint == Model.ServerEndpoint)?.Name ?? ViewBag.Localization["WEBFRONT_STATS_INDEX_ALL_SERVERS"])"></color-code> <color-code value="@(Model.Servers.FirstOrDefault(server => server.Endpoint == Model.ServerEndpoint)?.Name ?? ViewBag.Localization["WEBFRONT_STATS_INDEX_ALL_SERVERS"])"></color-code>
</span> </span>
@ -263,6 +263,7 @@
{ {
<div class="h5 mb-0">@ViewBag.Localization["WEBFRONT_ADV_STATS_EXPIRED"]</div> <div class="h5 mb-0">@ViewBag.Localization["WEBFRONT_ADV_STATS_EXPIRED"]</div>
} }
if (Model.ServerId != null) if (Model.ServerId != null)
{ {
<div class="h5 mb-0">@Html.Raw((ViewBag.Localization["WEBFRONT_ADV_STATS_PERFORMANCE"] as string).FormatExt($"<span class=\"text-primary\">{performance.ToNumericalString()}</span>"))</div> <div class="h5 mb-0">@Html.Raw((ViewBag.Localization["WEBFRONT_ADV_STATS_PERFORMANCE"] as string).FormatExt($"<span class=\"text-primary\">{performance.ToNumericalString()}</span>"))</div>
@ -375,7 +376,8 @@
@{ @{
var menuItems = new SideContextMenuItems var menuItems = new SideContextMenuItems
{ {
MenuTitle = "Game", Items = Model.Servers.Select(server => new SideContextMenuItem MenuTitle = ViewBag.Localization["WEBFRONT_CONTEXT_MENU_GLOBAL_GAME"],
Items = Model.Servers.Select(server => new SideContextMenuItem
{ {
IsLink = true, IsLink = true,
Reference = Url.Action("Advanced", "ClientStatistics", new { serverId = server.Endpoint }), Reference = Url.Action("Advanced", "ClientStatistics", new { serverId = server.Endpoint }),

View File

@ -12,7 +12,7 @@
<i class="oi oi-timer align-self-center mb-10" style="font-size: 6rem;"></i> <i class="oi oi-timer align-self-center mb-10" style="font-size: 6rem;"></i>
<div class="p-15"> <div class="p-15">
<h2 class="content-title mb-0">@Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_STATS_TEXT_NOQUALIFY"]</h2> <h2 class="content-title mb-0">@Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_STATS_TEXT_NOQUALIFY"]</h2>
<span class="text-muted">Check back after some more time has passed</span> <span class="text-muted">@ViewBag.Localization["WEBFRONT_TOP_PLAYERS_NOQUALIFY_SUBTITLE"]</span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -3,7 +3,7 @@
<div class="content mt-20 row"> <div class="content mt-20 row">
<div class="col-12 col-lg-9 mt-0"> <div class="col-12 col-lg-9 mt-0">
<h2 class="content-title mb-0">Top Players</h2> <h2 class="content-title mb-0">@ViewBag.Localization["WEBFRONT_TOP_PLAYERS_TITLE"]</h2>
<span class="text-muted"> <span class="text-muted">
<color-code value="@(Model.FirstOrDefault(m => m.Endpoint == ViewBag.SelectedServerId)?.Name ?? ViewBag.Localization["WEBFRONT_STATS_INDEX_ALL_SERVERS"])"></color-code> <color-code value="@(Model.FirstOrDefault(m => m.Endpoint == ViewBag.SelectedServerId)?.Name ?? ViewBag.Localization["WEBFRONT_STATS_INDEX_ALL_SERVERS"])"></color-code>
&mdash; <span class="text-primary">@ViewBag.TotalRankedClients.ToString("#,##0")</span> Ranked Players &mdash; <span class="text-primary">@ViewBag.TotalRankedClients.ToString("#,##0")</span> Ranked Players
@ -21,7 +21,8 @@
@{ @{
var menuItems = new SideContextMenuItems var menuItems = new SideContextMenuItems
{ {
MenuTitle = "Game", Items = Model.Select(server => new SideContextMenuItem MenuTitle = ViewBag.Localization["WEBFRONT_CONTEXT_MENU_GLOBAL_GAME"],
Items = Model.Select(server => new SideContextMenuItem
{ {
IsLink = true, IsLink = true,
Reference = Url.Action("TopPlayers", "Stats", new { serverId = server.Endpoint }), Reference = Url.Action("TopPlayers", "Stats", new { serverId = server.Endpoint }),

View File

@ -25,7 +25,7 @@
</div> </div>
<div class="edit-file d-none flex-column" id="edit_file_@FormatHtmlId(file.FileName)" data-file-name="@file.FileName"> <div class="edit-file d-none flex-column" id="edit_file_@FormatHtmlId(file.FileName)" data-file-name="@file.FileName">
<pre class="mt-0 font-size-12 flex-fill border-bottom" spellcheck="false"><code class="code language-json editable" contenteditable="true" id="edit_file_code_@FormatHtmlId(file.FileName)">@file.FileContent</code></pre> <pre class="mt-0 font-size-12 flex-fill border-bottom" spellcheck="false"><code class="code language-json editable" contenteditable="true" id="edit_file_code_@FormatHtmlId(file.FileName)">@file.FileContent</code></pre>
<button type="button" class="btn btn-primary m-15 mt-0 align-self-start file-save-button" data-file-name="@file.FileName">Save</button> <button type="button" class="btn btn-primary m-15 mt-0 align-self-start file-save-button" data-file-name="@file.FileName">@ViewBag.Localization["WEBFRONT_CONFIGURATION_BUTTON_SAVE"]</button>
</div> </div>
</div> </div>
} }

View File

@ -39,12 +39,12 @@
<div class="card m-0 rounded"> <div class="card m-0 rounded">
<div class="input-group mb-10"> <div class="input-group mb-10">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text">Server</span> <span class="input-group-text">@ViewBag.Localization["WEBFRONT_CONSOLE_FORM_SERVER"]</span>
</div> </div>
@Html.DropDownList("Server", Model.Select(s => new SelectListItem { Text = s.Name.StripColors(), Value = s.ID.ToString() }).ToList(), new { @class = "form-control", id = "console_server_select" }) @Html.DropDownList("Server", Model.Select(s => new SelectListItem { Text = s.Name.StripColors(), Value = s.ID.ToString() }).ToList(), new { @class = "form-control", id = "console_server_select" })
</div> </div>
<div class="input-group"> <div class="input-group">
<input id="console_command_value" class="form-control" placeholder="Enter command..." type="text" required="required"/> <input id="console_command_value" class="form-control" placeholder="@ViewBag.Localization["WEBFRONT_CONSOLE_FORM_PLACEHOLDER_COMMAND"]" type="text" required="required"/>
<div class="input-group-append"> <div class="input-group-append">
<button id="console_command_button" class="btn btn-primary"> <button id="console_command_button" class="btn btn-primary">
@Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_CONSOLE_EXECUTE"] @Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_CONSOLE_EXECUTE"]

View File

@ -5,7 +5,7 @@
<div class="content mt-20"> <div class="content mt-20">
@foreach (var (pluginName, commandList) in Model) @foreach (var (pluginName, commandList) in Model)
{ {
<h2 class="content-title mb-lg-20 mt-20 ">@(pluginName == "Native" ? "Command List" : pluginName)</h2> <h2 class="content-title mb-lg-20 mt-20 ">@(pluginName == "Native" ? ViewBag.Localization["WEBFRONT_HELP_COMMANDS_NATIVE_TITLE"] : pluginName)</h2>
<table class="table rounded"> <table class="table rounded">
<thead> <thead>

View File

@ -12,7 +12,7 @@
} }
<div class="content mt-20 row"> <div class="content mt-20 row">
<div class="col-12 col-lg-9"> <div class="col-12 col-lg-9">
<h2 class="content-title mb-0">Server Overview</h2> <h2 class="content-title mb-0">@ViewBag.Localization["WEBFRONT_SERVERS_TITLE"]</h2>
@if (Model.Game.HasValue) @if (Model.Game.HasValue)
{ {
<span class="text-muted">@loc[$"GAME_{Model.Game.Value}"]</span> <span class="text-muted">@loc[$"GAME_{Model.Game.Value}"]</span>
@ -35,7 +35,8 @@
@{ @{
var menuItems = new SideContextMenuItems var menuItems = new SideContextMenuItems
{ {
MenuTitle = "Game", Items = Model.ActiveServerGames.Select(game => new SideContextMenuItem MenuTitle = ViewBag.Localization["WEBFRONT_CONTEXT_MENU_GLOBAL_GAME"],
Items = Model.ActiveServerGames.Select(game => new SideContextMenuItem
{ {
IsLink = true, IsLink = true,
Reference = Url.Action("Index", "Home", new { game }), Reference = Url.Action("Index", "Home", new { game }),

View File

@ -14,7 +14,7 @@
<div class="content mt-20 row"> <div class="content mt-20 row">
<div class="col-12 col-lg-9"> <div class="col-12 col-lg-9">
<h2 class="content-title mb-0">Live Radar</h2> <h2 class="content-title mb-0">@ViewBag.Localization["WEBFRONT_LIVE_RADAR_TITLE"]</h2>
<div class="text-muted mb-15"> <div class="text-muted mb-15">
<color-code value="@((Model.FirstOrDefault(server => server.Endpoint == ViewBag.SelectedServerId) ?? Model.First()).Name)"></color-code> <color-code value="@((Model.FirstOrDefault(server => server.Endpoint == ViewBag.SelectedServerId) ?? Model.First()).Name)"></color-code>
</div> </div>
@ -36,7 +36,8 @@
@{ @{
var menuItems = new SideContextMenuItems var menuItems = new SideContextMenuItems
{ {
MenuTitle = "Game", Items = Model.Select(server => new SideContextMenuItem MenuTitle = ViewBag.Localization["WEBFRONT_CONTEXT_MENU_GLOBAL_GAME"],
Items = Model.Select(server => new SideContextMenuItem
{ {
IsLink = true, IsLink = true,
// ReSharper disable Mvc.ActionNotResolved // ReSharper disable Mvc.ActionNotResolved

View File

@ -16,7 +16,8 @@
@{ @{
var menuItems = new SideContextMenuItems var menuItems = new SideContextMenuItems
{ {
MenuTitle = "Server", Items = Model.Select(server => new SideContextMenuItem MenuTitle = ViewBag.Localization["WEBFRONT_CONTEXT_MENU_GLOBAL_SERVER"],
Items = Model.Select(server => new SideContextMenuItem
{ {
IsLink = true, IsLink = true,
Reference = Url.Action("Scoreboard", "Server", new { serverId = server.ServerId }), Reference = Url.Action("Scoreboard", "Server", new { serverId = server.ServerId }),

View File

@ -3,7 +3,20 @@
Layout = null; Layout = null;
} }
<div class="mb-15 text-center font-weight-lighter">New clients connected in the last <span class="text-primary">24</span> hours</div> <div class="mb-15 text-center font-weight-lighter">
@foreach (var match in Utilities.SplitTranslationTokens("WEBFRONT_MODAL_RECENT_CLIENTS_SUBTITLE"))
{
if (match.IsInterpolation && match.MatchValue == "time")
{
<span class="text-primary">24</span>
}
else
{
<span>@match.MatchValue</span>
}
}
</div>
<div id="recentClientContainer"> <div id="recentClientContainer">
<partial name="~/Views/Shared/Components/Client/_RecentClients.cshtml" for="@Model"/> <partial name="~/Views/Shared/Components/Client/_RecentClients.cshtml" for="@Model"/>

View File

@ -58,7 +58,18 @@
<div class="profile-meta-entry loader-data-time" data-time="@meta.When.ToFileTimeUtc()" onclick="$('#metaContextDateToggle@(meta.When.ToFileTimeUtc())').show()"> <div class="profile-meta-entry loader-data-time" data-time="@meta.When.ToFileTimeUtc()" onclick="$('#metaContextDateToggle@(meta.When.ToFileTimeUtc())').show()">
<partial name="~/Views/Client/Profile/Meta/_@(meta.GetType().Name).cshtml" model="meta"/> <partial name="~/Views/Client/Profile/Meta/_@(meta.GetType().Name).cshtml" model="meta"/>
<div style="display:none" id="metaContextDateToggle@(meta.When.ToFileTimeUtc())"> <div style="display:none" id="metaContextDateToggle@(meta.When.ToFileTimeUtc())">
Event occured at <span class="text-light">@meta.When.ToStandardFormat()</span> @foreach (var match in Utilities.SplitTranslationTokens("WEBFRONT_META_TIME_CONTEXT"))
{
if (match.IsInterpolation && match.MatchValue == "event")
{
<span class="text-light">@meta.When.ToStandardFormat()</span>
}
else
{
<span>@match.MatchValue</span>
}
}
</div> </div>
</div> </div>
} }

View File

@ -5,7 +5,7 @@
Layout = null; Layout = null;
} }
<div class="dropdown with-arrow" data-toggle="dropdown" id="alert-toggle" aria-haspopup="true" aria-expanded="false"> <div class="dropdown with-arrow" data-toggle="dropdown" id="alert-toggle" aria-haspopup="true" aria-expanded="false">
<div data-toggle="tooltip" data-title="@(Model.Any() ? "View Alerts" : "No Alerts")" data-placement="bottom"> <div data-toggle="tooltip" data-title="@(Model.Any() ? ViewBag.Localization["WEBFRONT_ALERTS_SOME_TOOLTIP"] : ViewBag.Localization["WEBFRONT_ALERTS_NONE_TOOLTIP"])" data-placement="bottom">
<i class="oi oi-bell mt-5"></i> <i class="oi oi-bell mt-5"></i>
</div> </div>
@if (Model.Any()) @if (Model.Any())

View File

@ -4,8 +4,8 @@
@{ @{
Layout = null; Layout = null;
} }
<div class="content-title">Recent Reports</div> <div class="content-title">@ViewBag.Localization["WEBFRONT_MODAL_REPORTS_TITLE"]</div>
<div class="text-muted">Last 24 hours</div> <div class="text-muted">@ViewBag.Localization["WEBFRONT_MODAL_REPORTS_SUBTITLE"]</div>
@foreach (var server in Model.Where(server => server.Reports.Any()).OrderByDescending(server => server.Reports.Max(report => report.ReportedOn))) @foreach (var server in Model.Where(server => server.Reports.Any()).OrderByDescending(server => server.Reports.Max(report => report.ReportedOn)))
{ {
@ -33,7 +33,6 @@
<partial name="~/Views/Client/Profile/Meta/_ReceivedPenaltyResponse.cshtml" for="@penalty"/> <partial name="~/Views/Client/Profile/Meta/_ReceivedPenaltyResponse.cshtml" for="@penalty"/>
</div> </div>
<hr/> <hr/>
} }
</div> </div>
} }

View File

@ -23,14 +23,14 @@
{ {
<!-- desktop --> <!-- desktop -->
<tr class="bg-dark-dm bg-light-lm d-none d-lg-table-row"> <tr class="bg-dark-dm bg-light-lm d-none d-lg-table-row">
<td colspan="@Model.Columns.Count">No data...</td> <td colspan="@Model.Columns.Count">@ViewBag.Localization["WEBFRONT_DATATABLE_NO_DATA"]</td>
</tr> </tr>
<!-- mobile --> <!-- mobile -->
<tr class="d-flex d-table-row d-lg-none"> <tr class="d-flex d-table-row d-lg-none">
<td class="bg-primary text-light text-right w-125"> <td class="bg-primary text-light text-right w-125">
&mdash; &mdash;
</td> </td>
<td class="bg-dark-dm bg-light-lm flex-fill w-200">No data...</td> <td class="bg-dark-dm bg-light-lm flex-fill w-200">@ViewBag.Localization["WEBFRONT_DATATABLE_NO_DATA"]</td>
</tr> </tr>
} }
@foreach (var row in Model.Rows) @foreach (var row in Model.Rows)
@ -103,7 +103,7 @@
</table> </table>
@if (Model.InitialRowCount > 0 && Model.Rows.Count > 0) @if (Model.InitialRowCount > 0 && Model.Rows.Count > 0)
{ {
<button class="btn btn-block table-slide" data-toggle="tooltip" data-title="Show @(Model.Rows.Count - Model.InitialRowCount) more rows"> <button class="btn btn-block table-slide" data-toggle="tooltip" data-title="@((ViewBag.Localization["WEBFRONT_DATATABLE_LOAD_MORE_FORMAT"] as string).FormatExt(Model.Rows.Count - Model.InitialRowCount))">
<span class="oi oi-chevron-bottom"></span> <span class="oi oi-chevron-bottom"></span>
</button> </button>
} }

View File

@ -52,7 +52,7 @@
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</a> </a>
<div id="actionModalContent"> <div id="actionModalContent">
<h4 class="mt-20">No content available yet...</h4> <h4 class="mt-20">@ViewBag.Localization["WEBFRONT_GLOBAL_MODAL_EMPTY"]</h4>
</div> </div>
</div> </div>
</div> </div>
@ -98,21 +98,21 @@
<div class="d-none d-md-block"> <div class="d-none d-md-block">
<div class="badge-group ml-20" role="group" aria-label="..."> <div class="badge-group ml-20" role="group" aria-label="...">
<span class="badge badge-primary">@(ViewBag.ClientCount ?? "-")</span> <span class="badge badge-primary">@(ViewBag.ClientCount ?? "-")</span>
<span class="badge bg-dark-dm bg-light-lm">Clients</span> <span class="badge bg-dark-dm bg-light-lm">@ViewBag.Localization["WEBFRONT_LAYOUT_CLIENTS_ONLINE"]</span>
</div> </div>
<has-permission entity="PrivilegedClientsPage" required-permission="Read"> <has-permission entity="PrivilegedClientsPage" required-permission="Read">
<div class="badge-group ml-10" role="group" aria-label="..."> <div class="badge-group ml-10" role="group" aria-label="...">
<span class="badge badge-success">@(ViewBag.AdminCount ?? "-")</span> <span class="badge badge-success">@(ViewBag.AdminCount ?? "-")</span>
<span class="badge bg-dark-dm bg-light-lm">Admins</span> <span class="badge bg-dark-dm bg-light-lm">@ViewBag.Localization["WEBFRONT_LAYOUT_ADMINS_ONLINE"]</span>
</div> </div>
</has-permission> </has-permission>
<has-permission entity="AdminMenu" required-permission="Read"> <has-permission entity="AdminMenu" required-permission="Read">
<a href="#actionModal" class="profile-action no-decoration" data-action="RecentReports" data-toggle="tooltip" data-title="View recent reports" data-placement="bottom"> <a href="#actionModal" class="profile-action no-decoration" data-action="RecentReports" data-toggle="tooltip" data-title="@ViewBag.Localization["WEBFRONT_MODAL_REPORTS_TOOLTIP_TITLE"]" data-placement="bottom">
<div class="badge-group ml-10" role="group"> <div class="badge-group ml-10" role="group">
<span class="badge badge-danger">@(ViewBag.ReportCount ?? "-")</span> <span class="badge badge-danger">@(ViewBag.ReportCount ?? "-")</span>
<span class="badge bg-dark-dm bg-light-lm">Reports</span> <span class="badge bg-dark-dm bg-light-lm">@ViewBag.Localization["WEBFRONT_LAYOUT_REPORTS"]</span>
</div> </div>
</a> </a>
</has-permission> </has-permission>
@ -122,7 +122,7 @@
<div class="align-self-center"> <div class="align-self-center">
@await Html.PartialAsync("Partials/_Notifications", (object)ViewBag.Alerts) @await Html.PartialAsync("Partials/_Notifications", (object)ViewBag.Alerts)
</div> </div>
<div class="btn btn-action mr-10 ml-10" onclick="halfmoon.toggleDarkMode()" data-toggle="tooltip" data-title="Toggle display mode" data-placement="bottom"> <div class="btn btn-action mr-10 ml-10" onclick="halfmoon.toggleDarkMode()" data-toggle="tooltip" data-title="@ViewBag.Localization["WEBFRONT_LAYOUT_TOGGLE_DISPLAY"]" data-placement="bottom">
<i class="oi oi-moon"></i> <i class="oi oi-moon"></i>
</div> </div>
<div class="d-none d-md-block "> <div class="d-none d-md-block ">
@ -149,12 +149,7 @@
<div id="mainLoadingBar" class="progress-bar position-absolute flex-fill position-fixed z-30" style="display: none"> <div id="mainLoadingBar" class="progress-bar position-absolute flex-fill position-fixed z-30" style="display: none">
<div class="progress-bar-value"></div> <div class="progress-bar-value"></div>
</div> </div>
@RenderBody() @RenderBody()
<div class="content">
<div class="badge text-muted">threadsafe.pw</div>
</div>
</div> </div>
</div> </div>

View File

@ -10,7 +10,7 @@
<div class="pr-20 pl-20 mb-20 d-block d-lg-none"> <div class="pr-20 pl-20 mb-20 d-block d-lg-none">
<partial name="_SearchResourceForm"/> <partial name="_SearchResourceForm"/>
</div> </div>
<span class="sidebar-title ">Main</span> <span class="sidebar-title">@ViewBag.Localization["WEBFRONT_NAV_TITLE_MAIN"]</span>
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
<!-- servers --> <!-- servers -->
<a asp-controller="Home" asp-action="Index" class="sidebar-link"> <a asp-controller="Home" asp-action="Index" class="sidebar-link">
@ -47,7 +47,7 @@
<has-permission entity="ProfilePage" required-permission="Read"> <has-permission entity="ProfilePage" required-permission="Read">
<a asp-controller="Client" asp-action="Profile" asp-route-id="@ViewBag.User.ClientId" class="sidebar-link"> <a asp-controller="Client" asp-action="Profile" asp-route-id="@ViewBag.User.ClientId" class="sidebar-link">
<i class="oi oi-person mr-5"></i> <i class="oi oi-person mr-5"></i>
<span class="name">Profile</span> <span class="name">@ViewBag.Localization["WEBFRONT_NAV_TITLE_PROFILE"]</span>
</a> </a>
</has-permission> </has-permission>
@ -55,13 +55,13 @@
{ {
<a href="#actionModal" class="profile-action sidebar-link" data-action="login"> <a href="#actionModal" class="profile-action sidebar-link" data-action="login">
<i class="oi oi-key mr-5"></i> <i class="oi oi-key mr-5"></i>
<span class="name">Login</span> <span class="name">@ViewBag.Localization["WEBFRONT_NAV_TITLE_LOGIN"]</span>
</a> </a>
} }
<br/> <br/>
<!-- stats --> <!-- stats -->
<div class="sidebar-title ">Stats</div> <div class="sidebar-title ">@ViewBag.Localization["WEBFRONT_NAV_TITLE_STATS"]</div>
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
@foreach (Page pageLink in ViewBag.Pages) @foreach (Page pageLink in ViewBag.Pages)
@ -74,14 +74,14 @@
<!-- scoreboard --> <!-- scoreboard -->
<a asp-controller="Server" asp-action="Scoreboard" class="sidebar-link"> <a asp-controller="Server" asp-action="Scoreboard" class="sidebar-link">
<i class="oi oi-spreadsheet mr-5"></i> <i class="oi oi-spreadsheet mr-5"></i>
<span class="name">Scoreboard</span> <span class="name">@ViewBag.Localization["WEBFRONT_NAV_TITLE_SCOREBOARD"]</span>
</a> </a>
<br/> <br/>
<!-- socials --> <!-- socials -->
@if (ViewBag.CommunityInformation?.IsEnabled && ViewBag.CommunityInformation.SocialAccounts.Length > 0) @if (ViewBag.CommunityInformation?.IsEnabled && ViewBag.CommunityInformation.SocialAccounts.Length > 0)
{ {
<span class="sidebar-title ">Socials</span> <span class="sidebar-title">@ViewBag.Localization["WEBFRONT_NAV_TITLE_SOCIALS"]</span>
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
} }
@ -106,7 +106,7 @@
<!-- admin --> <!-- admin -->
<has-permission entity="AdminMenu" required-permission="Read"> <has-permission entity="AdminMenu" required-permission="Read">
<div class="sidebar-title ">Admin</div> <div class="sidebar-title">@ViewBag.Localization["WEBFRONT_NAV_TITLE_ADMIN"]</div>
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
<has-permission entity="ConsolePage" required-permission="Read"> <has-permission entity="ConsolePage" required-permission="Read">
@ -118,14 +118,14 @@
<has-permission entity="Penalty" required-permission="Read"></has-permission> <has-permission entity="Penalty" required-permission="Read"></has-permission>
<a asp-controller="Admin" asp-action="BanManagement" class="sidebar-link"> <a asp-controller="Admin" asp-action="BanManagement" class="sidebar-link">
<i class="oi oi-ban mr-5"></i> <i class="oi oi-ban mr-5"></i>
<span class="name">Ban Management</span> <span class="name">@ViewBag.Localization["WEBFRONT_NAV_TITLE_BAN_MANAGEMENT"]</span>
</a> </a>
</has-permission> </has-permission>
@if (ViewBag.User.Level >= EFClient.Permission.Owner) @if (ViewBag.User.Level >= EFClient.Permission.Owner)
{ {
<a asp-controller="Configuration" asp-action="Edit" class="sidebar-link"> <a asp-controller="Configuration" asp-action="Edit" class="sidebar-link">
<i class="oi oi-cog mr-5"></i> <i class="oi oi-cog mr-5"></i>
<span class="name">Configuration</span> <span class="name">@ViewBag.Localization["WEBFRONT_NAV_TITLE_CONFIGURATION"]</span>
</a> </a>
} }
<has-permission entity="AuditPage" required-permission="Read"> <has-permission entity="AuditPage" required-permission="Read">
@ -158,11 +158,21 @@
<div class="sidebar-link font-size-12 font-weight-light"> <div class="sidebar-link font-size-12 font-weight-light">
@if (ViewBag.Authorized) @if (ViewBag.Authorized)
{ {
<span>Logged in as <color-code value="@ViewBag.User.Name"></color-code></span> @foreach (var match in Utilities.SplitTranslationTokens(ViewBag.Localization["WEBFRONT_NAV_LOGIN_YES_FORMAT"]))
{
if (match.IsInterpolation && match.MatchValue == "username")
{
<color-code value="@ViewBag.User.Name"></color-code>
} }
else else
{ {
<span>Not logged in</span> <span>@match.MatchValue</span>
}
}
}
else
{
<span>@ViewBag.Localization["WEBFRONT_NAV_LOGIN_NO_FORMAT"]</span>
} }
</div> </div>
<div class="sidebar-divider mt-0 mb-0"></div> <div class="sidebar-divider mt-0 mb-0"></div>

View File

@ -5,15 +5,15 @@
<form class="action-form" asp-action="Login" asp-controller="Account"> <form class="action-form" asp-action="Login" asp-controller="Account">
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text" id="basic-addon-clientId">Client ID</span> <span class="input-group-text" id="basic-addon-clientId">@ViewBag.Localization["WEBFRONT_LOGIN_MODAL_FORM_CLIENTID"]</span>
</div> </div>
<input type="text" name="clientId" value="" class="form-control" aria-label="clientId" aria-describedby="basic-addon-clientId"> <input type="text" name="clientId" value="" class="form-control" aria-label="clientId" aria-describedby="basic-addon-clientId">
</div> </div>
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text" id="basic-addon-Password">Token/Password</span> <span class="input-group-text" id="basic-addon-Password">@ViewBag.Localization["WEBFRONT_LOGIN_MODAL_FORM_PASSWORD"]</span>
</div> </div>
<input type="password" name="Password" value="" class="form-control" aria-label="Password" aria-describedby="basic-addon-Password"> <input type="password" name="Password" value="" class="form-control" aria-label="Password" aria-describedby="basic-addon-Password">
</div> </div>
<button type="submit" class="btn btn-block btn-primary">Login</button> <button type="submit" class="btn btn-block btn-primary">@ViewBag.Localization["WEBFRONT_LOGIN_BUTTON_SUBMIT"]</button>
</form> </form>

View File

@ -37,7 +37,7 @@
</div> </div>
} }
<hr/> <hr/>
<a href="#" class="btn btn-lg btn-danger btn-block mt-15" role="button">Close</a> <a href="#" class="btn btn-lg btn-danger btn-block mt-15" role="button">@ViewBag.Localization["WEBFRONT_CONTEXT_MENU_BUTTON_CLOSE"]</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -79,7 +79,7 @@ $(document).ready(function () {
clearQueryString(); clearQueryString();
halfmoon.initStickyAlert({ halfmoon.initStickyAlert({
content: toastMessage, content: toastMessage,
title: 'Success', title: _localization['WEBFRONT_SCRIPT_ACTION_SUCCESS'],
alertType: 'alert-success', alertType: 'alert-success',
fillType: 'filled', fillType: 'filled',
timeShown: duration timeShown: duration
@ -107,7 +107,7 @@ $(document).ready(function () {
.fail(function (jqxhr, textStatus, error) { .fail(function (jqxhr, textStatus, error) {
halfmoon.initStickyAlert({ halfmoon.initStickyAlert({
content: jqxhr.responseText, content: jqxhr.responseText,
title: 'Error', title: _localization['WEBFRONT_SCRIPT_ACTION_ERROR'],
alertType: 'alert-danger', alertType: 'alert-danger',
fillType: 'filled' fillType: 'filled'
}); });
@ -145,7 +145,7 @@ $(document).ready(function () {
modal.modal(); modal.modal();
halfmoon.initStickyAlert({ halfmoon.initStickyAlert({
content: escapeHtml(message), content: escapeHtml(message),
title: 'Executed', title: _localization['WEBFRONT_SCRIPT_ACTION_EXECUTED'],
alertType: 'alert-primary', alertType: 'alert-primary',
fillType: 'filled' fillType: 'filled'
}); });
@ -174,7 +174,7 @@ $(document).ready(function () {
halfmoon.initStickyAlert({ halfmoon.initStickyAlert({
content: message, content: message,
title: 'Error', title: _localization['WEBFRONT_SCRIPT_ACTION_ERROR'],
alertType: 'alert-danger', alertType: 'alert-danger',
fillType: 'filled' fillType: 'filled'
}); });

View File

@ -73,7 +73,7 @@ function loadMoreItems() {
.fail(function () { .fail(function () {
errorLoader(); errorLoader();
halfmoon.initStickyAlert({ halfmoon.initStickyAlert({
content: 'Could not load more items...', content: _localization['WEBFRONT_SCRIPT_LOADER_ERROR'],
title: 'Error', title: 'Error',
alertType: 'alert-danger', alertType: 'alert-danger',
fillType: 'filled' fillType: 'filled'

View File

@ -88,7 +88,7 @@ function getPlayerHistoryChart(playerHistory, i, width, maxClients) {
callbacks: { callbacks: {
// todo: localization at some point // todo: localization at some point
title: context => moment(context[0].label).local().calendar(), title: context => moment(context[0].label).local().calendar(),
label: context => context.datasetIndex !== 1 ? `${context.value} players on ${playerHistory[context.index].mapAlias}` : context.value === '0' ? '' : 'Server Unreachable!', label: context => context.datasetIndex !== 1 ? `${context.value} ${_localization['WEBFRONT_SCRIPT_SERVER_PLAYERS']} | ${playerHistory[context.index].mapAlias}` : context.value === '0' ? '' : _localization['WEBFRONT_SCRIPT_SERVER_UNREACHABLE'],
}, },
mode: 'nearest', mode: 'nearest',
intersect: false, intersect: false,