2021-10-10 11:44:18 -04:00
|
|
|
@using SharedLibraryCore.Configuration
|
|
|
|
@model WebfrontCore.ViewModels.CommunityInfo
|
2021-10-09 22:11:47 -04:00
|
|
|
@{
|
2021-10-19 21:02:31 -04:00
|
|
|
IEnumerable<KeyValuePair<(string, long), string[]>> allRules = new[] {new KeyValuePair<(string, long), string[]>((ViewBag.Localization["WEBFRONT_ABOUT_GLOBAL_RULES"], 0), Model.GlobalRules)};
|
2021-10-10 11:44:18 -04:00
|
|
|
var serverRules = Model.ServerRules?.Where(server => server.Value != null && server.Value.Any()).ToList();
|
|
|
|
if (serverRules?.Any() ?? false)
|
|
|
|
{
|
|
|
|
allRules = allRules.Union(serverRules);
|
|
|
|
}
|
2021-10-09 22:11:47 -04:00
|
|
|
}
|
|
|
|
|
2021-10-16 14:30:26 -04:00
|
|
|
<div class="row text-break">
|
2021-10-09 22:11:47 -04:00
|
|
|
@if (Model.CommunityInformation.EnableBanner)
|
|
|
|
{
|
2021-10-16 14:30:26 -04:00
|
|
|
<img class="img-fluid mb-3" style="max-height: 250px" src="images/community/banner.png" alt="@Model.CommunityInformation.Name"/>
|
2021-10-09 22:11:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Name))
|
|
|
|
{
|
2021-10-16 14:30:26 -04:00
|
|
|
<h2 class="mb-4 p-0 col-12 text-center text-md-left">
|
2022-01-22 13:49:12 -05:00
|
|
|
<color-code value="@Model.CommunityInformation.Name"></color-code>
|
2021-10-09 22:11:47 -04:00
|
|
|
</h2>
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Description))
|
|
|
|
{
|
2021-10-16 14:30:26 -04:00
|
|
|
<div class="p-4 bg-dark border border-primary mb-4 text-white-50 col-12">
|
2021-10-09 22:11:47 -04:00
|
|
|
<h4 class="text-primary">@ViewBag.Localization["WEBFRONT_ABOUT_TITLE"]</h4>
|
2022-01-22 13:49:12 -05:00
|
|
|
<color-code value="@Model.CommunityInformation.Description"></color-code>
|
2021-10-09 22:11:47 -04:00
|
|
|
<div class="mt-3">
|
2021-10-10 11:44:18 -04:00
|
|
|
@foreach (var social in Model.CommunityInformation.SocialAccounts ?? new SocialAccountConfiguration[0])
|
2021-10-09 22:11:47 -04:00
|
|
|
{
|
|
|
|
<div>
|
|
|
|
<a href="@social.Url" target="_blank" title="@social.Title">
|
|
|
|
@if (!string.IsNullOrWhiteSpace(social.IconId))
|
|
|
|
{
|
|
|
|
<span class="oi @social.IconId"></span>
|
|
|
|
}
|
|
|
|
else if (!string.IsNullOrWhiteSpace(social.IconUrl))
|
|
|
|
{
|
2021-10-16 14:30:26 -04:00
|
|
|
var url = Uri.TryCreate(social.IconUrl, UriKind.Absolute, out var parsedUrl)
|
|
|
|
? parsedUrl.AbsoluteUri
|
|
|
|
: $"images/community/{social.IconUrl}";
|
2021-10-09 22:11:47 -04:00
|
|
|
<img class="img-fluid" style="max-width: 1rem; fill: white" src="@url" alt="@social.Title"/>
|
|
|
|
}
|
2021-10-16 14:30:26 -04:00
|
|
|
<span class="ml-1">@social.Title</span>
|
2021-10-09 22:11:47 -04:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
2021-10-10 11:44:18 -04:00
|
|
|
@if (allRules.Any(rule => rule.Value.Any()))
|
|
|
|
{
|
2021-10-16 14:30:26 -04:00
|
|
|
<h2 class="pb-3 p-0 col-12 text-center text-md-left">@ViewBag.Localization["WEBFRONT_ABOUT_COMMUNITY_GUIDELINES"]</h2>
|
2021-10-10 11:44:18 -04:00
|
|
|
}
|
2021-10-09 22:11:47 -04:00
|
|
|
|
2021-10-19 21:02:31 -04:00
|
|
|
@foreach (var ((serverName, id), rules) in allRules)
|
2021-10-09 22:11:47 -04:00
|
|
|
{
|
2021-10-10 11:44:18 -04:00
|
|
|
if (!rules.Any())
|
2021-10-09 22:11:47 -04:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
var start = 1;
|
2021-10-16 14:30:26 -04:00
|
|
|
<div class="col-12 bg-dark p-4 border border-primary mb-4 col-12">
|
2021-10-09 22:11:47 -04:00
|
|
|
<div class="text-primary h4">
|
2022-01-22 13:49:12 -05:00
|
|
|
<color-code value="@serverName"></color-code>
|
2021-10-09 22:11:47 -04:00
|
|
|
</div>
|
|
|
|
@foreach (var rule in rules)
|
|
|
|
{
|
|
|
|
<div class="text-white-50">
|
|
|
|
<span class="text-white">@start.</span>
|
2022-01-22 13:49:12 -05:00
|
|
|
<color-code value="@rule"></color-code>
|
2021-10-09 22:11:47 -04:00
|
|
|
</div>
|
|
|
|
start++;
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
}
|
2022-01-22 13:49:12 -05:00
|
|
|
</div>
|