Hide numerical prefix for about page rules if included in the config

This commit is contained in:
RaidMax 2022-04-09 10:16:34 -05:00
parent 425ec2621d
commit 4023ca37d4

View File

@ -1,4 +1,5 @@
@using SharedLibraryCore.Configuration
@using System.Text.RegularExpressions
@model WebfrontCore.ViewModels.CommunityInfo
@{
IEnumerable<KeyValuePair<(string, long), string[]>> allRules = new[] {new KeyValuePair<(string, long), string[]>((ViewBag.Localization["WEBFRONT_ABOUT_GLOBAL_RULES"], 0), Model.GlobalRules)};
@ -71,7 +72,10 @@
@foreach (var rule in rules)
{
<div class="text-white-50">
<span class="text-white">@start.</span>
@if (!rule.StartsWith("#") && !Regex.IsMatch(rule, @"^\d+(.|\))"))
{
<span class="text-white">@start.</span>
}
<color-code value="@rule"></color-code>
</div>
start++;