1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

Add about/community info guidelines/social page

This commit is contained in:
RaidMax
2021-10-09 21:11:47 -05:00
parent 9f859c5d23
commit 60681458c4
11 changed files with 226 additions and 10 deletions

View File

@ -0,0 +1,70 @@
@model WebfrontCore.ViewModels.CommunityInfo
@{
var allRules = Model.ServerRules.Prepend(new KeyValuePair<string, string[]>(ViewBag.Localization["WEBFRONT_ABOUT_GLOBAL_RULES"], Model.GlobalRules));
}
<div class="row">
@if (Model.CommunityInformation.EnableBanner)
{
<img class="img-fluid mb-3" style="max-height: 250px" src="images/community/banner.png"/>
}
@if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Name))
{
<h2 class="mb-4 ml-auto mr-auto ml-md-0">
<color-code value="@Model.CommunityInformation.Name" allow="@ViewBag.EnableColorCodes"></color-code>
</h2>
}
@if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Description))
{
<div class="p-4 bg-dark border border-primary mb-4 text-white-50">
<h4 class="text-primary">@ViewBag.Localization["WEBFRONT_ABOUT_TITLE"]</h4>
<color-code value="@Model.CommunityInformation.Description" allow="@ViewBag.EnableColorCodes"></color-code>
<div class="mt-3">
@foreach (var social in Model.CommunityInformation.SocialAccounts)
{
<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))
{
var url = Uri.TryCreate(social.IconUrl, UriKind.Absolute, out _) ? social.IconUrl : $"images/community/{social.IconUrl}";
<img class="img-fluid" style="max-width: 1rem; fill: white" src="@url" alt="@social.Title"/>
}
<span>@social.Title</span>
</a>
</div>
}
</div>
</div>
}
<h2 class="pb-3 ml-auto mr-auto ml-md-0">@ViewBag.Localization["WEBFRONT_ABOUT_COMMUNITY_GUIDELINES"]</h2>
@foreach (var (serverName, rules) in allRules)
{
if (rules?.Length == 0)
{
continue;
}
var start = 1;
<div class="col-12 bg-dark p-4 border border-primary mb-4">
<div class="text-primary h4">
<color-code value="@serverName" allow="@ViewBag.EnableColorCodes"></color-code>
</div>
@foreach (var rule in rules)
{
<div class="text-white-50">
<span class="text-white">@start.</span>
<color-code value="@rule" allow="@ViewBag.EnableColorCodes"></color-code>
</div>
start++;
}
</div>
}
</div>

View File

@ -2,7 +2,7 @@
var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<html xmlns="http://www.w3.org/1999/html" lang="@ViewBag.Language">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
@ -34,22 +34,46 @@
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item text-center text-lg-left">@Html.ActionLink(loc["WEBFRONT_NAV_HOME"], "Index", "Home", new { area = "" }, new { @class = "nav-link" })</li>
<li class="nav-item text-center text-lg-left">@Html.ActionLink(loc["WEBFRONT_NAV_PENALTIES"], "List", "Penalty", new { area = "" }, new { @class = "nav-link" })</li>
<li class="nav-item d-none d-lg-inline-block d-xl-none">@Html.ActionLink("", "Index", "Home", new {area = ""}, new {@class = "nav-link nav-icon oi oi-hard-drive", title=@loc["WEBFRONT_NAV_SERVERS"]})</li>
<li class="nav-item text-center d-lg-none d-xl-inline-block">@Html.ActionLink(loc["WEBFRONT_NAV_SERVERS"], "Index", "Home", new {area = ""}, new {@class = "nav-link"})</li>
<li class="nav-item d-none d-lg-inline-block d-xl-none">@Html.ActionLink("", "Index", "About", new {area = ""}, new {@class = "nav-link nav-icon oi oi-list-rich", title=loc["WEBFRONT_NAV_ABOUT"]})</li>
<li class="nav-item text-center text-lg-left d-lg-none d-xl-inline-block">@Html.ActionLink(loc["WEBFRONT_NAV_ABOUT"], "Index", "About", new {area = ""}, new {@class = "nav-link"})</li>
<li class="nav-item d-none d-lg-inline-block d-xl-none">@Html.ActionLink("", "List", "Penalty", new {area = ""}, new {@class = "nav-link nav-icon oi oi-lock-locked", title=loc["WEBFRONT_NAV_PENALTIES"]})</li>
<li class="nav-item text-center d-lg-none d-xl-inline-block">@Html.ActionLink(loc["WEBFRONT_NAV_PENALTIES"], "List", "Penalty", new {area = ""}, new {@class = "nav-link"})</li>
@if (ViewBag.Authorized)
{
<li class="nav-item text-center text-lg-left">@Html.ActionLink(loc["WEBFRONT_NAV_PRIVILEGED"], "PrivilegedAsync", "Client", new {area = ""}, new {@class = "nav-link"})</li>
<li class="nav-item d-none d-lg-inline-block d-xl-none">@Html.ActionLink("", "PrivilegedAsync", "Client", new {area = ""}, new {@class = "nav-link nav-icon oi oi-people", title=loc["WEBFRONT_NAV_PRIVILEGED"]})</li>
<li class="nav-item text-center text-lg-left d-lg-none d-xl-inline-block">@Html.ActionLink(loc["WEBFRONT_NAV_PRIVILEGED"], "PrivilegedAsync", "Client", new {area = ""}, new {@class = "nav-link"})</li>
}
else if (!ViewBag.Authorized && !ViewBag.EnablePrivilegedUserPrivacy)
{
<li class="nav-item text-center text-lg-left">@Html.ActionLink(loc["WEBFRONT_NAV_PRIVILEGED"], "PrivilegedAsync", "Client", new {area = ""}, new {@class = "nav-link"})</li>
<li class="nav-item d-none d-lg-inline-block d-xl-none">@Html.ActionLink("", "PrivilegedAsync", "Client", new {area = ""}, new {@class = "nav-link nav-icon oi oi-people", title=loc["WEBFRONT_NAV_PRIVILEGED"]})</li>
<li class="nav-item text-center text-lg-left d-lg-none d-xl-inline-block">@Html.ActionLink(loc["WEBFRONT_NAV_PRIVILEGED"], "PrivilegedAsync", "Client", new {area = ""}, new {@class = "nav-link"})</li>
}
<li class="nav-item text-center text-lg-left">@Html.ActionLink(loc["WEBFRONT_NAV_HELP"], "Help", "Home", new { area = "" }, new { @class = "nav-link" })</li>
<li class="nav-item d-none d-lg-inline-block d-xl-none">@Html.ActionLink("", "Help", "Home", new {area = ""}, new {@class = "nav-link nav-icon oi oi-question-mark", title=loc["WEBFRONT_NAV_HELP"]})</li>
<li class="nav-item text-center text-lg-left d-lg-none d-xl-inline-block">@Html.ActionLink(loc["WEBFRONT_NAV_HELP"], "Help", "Home", new {area = ""}, new {@class = "nav-link"})</li>
@foreach (var _page in ViewBag.Pages)
{
<li class="nav-item text-center text-lg-left">
<a class="nav-link" href="@_page.Location">@_page.Name</a>
</li>
if (_page.Location == "/Stats/TopPlayersAsync")
{
<li class="nav-item d-none d-lg-inline-block d-xl-none">
<a class="nav-link nav-icon oi oi-bar-chart" href="@_page.Location" title="@_page.Name"></a>
</li>
<li class="nav-item text-center text-lg-left d-lg-none d-xl-inline-block">
<a class="nav-link" href="@_page.Location">@_page.Name</a>
</li>
}
else
{
<li class="nav-item text-center text-lg-left">
<a class="nav-link" href="@_page.Location">@_page.Name</a>
</li>
}
}
<li class="nav-item text-center text-lg-left"></li>
@if (!string.IsNullOrEmpty(ViewBag.SocialLink))