improve about page layout

This commit is contained in:
RaidMax 2021-10-16 13:30:26 -05:00
parent 5b3420b97a
commit b2afc410f2
2 changed files with 12 additions and 10 deletions

View File

@ -19,7 +19,7 @@ namespace WebfrontCore.Controllers
public IActionResult Index() public IActionResult Index()
{ {
ViewBag.Description = Localization["WEBFRONT_DESCRIPTION_ABOUT"].FormatExt( ViewBag.Description = Localization["WEBFRONT_ABOUT_DESCRIPTION"].FormatExt(
_appConfig.ShouldUseFallbackBranding() _appConfig.ShouldUseFallbackBranding()
? _appConfig.WebfrontCustomBranding ? _appConfig.WebfrontCustomBranding
: _appConfig.CommunityInformation.Name); : _appConfig.CommunityInformation.Name);

View File

@ -1,7 +1,7 @@
@using SharedLibraryCore.Configuration @using SharedLibraryCore.Configuration
@model WebfrontCore.ViewModels.CommunityInfo @model WebfrontCore.ViewModels.CommunityInfo
@{ @{
IEnumerable<KeyValuePair<string, string[]>> allRules = new []{new KeyValuePair<string, string[]>(ViewBag.Localization["WEBFRONT_ABOUT_GLOBAL_RULES"], Model.GlobalRules)}; IEnumerable<KeyValuePair<string, string[]>> allRules = new[] {new KeyValuePair<string, string[]>(ViewBag.Localization["WEBFRONT_ABOUT_GLOBAL_RULES"], Model.GlobalRules)};
var serverRules = Model.ServerRules?.Where(server => server.Value != null && server.Value.Any()).ToList(); var serverRules = Model.ServerRules?.Where(server => server.Value != null && server.Value.Any()).ToList();
if (serverRules?.Any() ?? false) if (serverRules?.Any() ?? false)
{ {
@ -9,22 +9,22 @@
} }
} }
<div class="row"> <div class="row text-break">
@if (Model.CommunityInformation.EnableBanner) @if (Model.CommunityInformation.EnableBanner)
{ {
<img class="img-fluid mb-3" style="max-height: 250px" src="images/community/banner.png"/> <img class="img-fluid mb-3" style="max-height: 250px" src="images/community/banner.png" alt="@Model.CommunityInformation.Name"/>
} }
@if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Name)) @if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Name))
{ {
<h2 class="mb-4 ml-auto mr-auto ml-md-0"> <h2 class="mb-4 p-0 col-12 text-center text-md-left">
<color-code value="@Model.CommunityInformation.Name" allow="@ViewBag.EnableColorCodes"></color-code> <color-code value="@Model.CommunityInformation.Name" allow="@ViewBag.EnableColorCodes"></color-code>
</h2> </h2>
} }
@if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Description)) @if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Description))
{ {
<div class="p-4 bg-dark border border-primary mb-4 text-white-50"> <div class="p-4 bg-dark border border-primary mb-4 text-white-50 col-12">
<h4 class="text-primary">@ViewBag.Localization["WEBFRONT_ABOUT_TITLE"]</h4> <h4 class="text-primary">@ViewBag.Localization["WEBFRONT_ABOUT_TITLE"]</h4>
<color-code value="@Model.CommunityInformation.Description" allow="@ViewBag.EnableColorCodes"></color-code> <color-code value="@Model.CommunityInformation.Description" allow="@ViewBag.EnableColorCodes"></color-code>
<div class="mt-3"> <div class="mt-3">
@ -38,10 +38,12 @@
} }
else if (!string.IsNullOrWhiteSpace(social.IconUrl)) else if (!string.IsNullOrWhiteSpace(social.IconUrl))
{ {
var url = Uri.TryCreate(social.IconUrl, UriKind.Absolute, out _) ? social.IconUrl : $"images/community/{social.IconUrl}"; var url = Uri.TryCreate(social.IconUrl, UriKind.Absolute, out var parsedUrl)
? parsedUrl.AbsoluteUri
: $"images/community/{social.IconUrl}";
<img class="img-fluid" style="max-width: 1rem; fill: white" src="@url" alt="@social.Title"/> <img class="img-fluid" style="max-width: 1rem; fill: white" src="@url" alt="@social.Title"/>
} }
<span>@social.Title</span> <span class="ml-1">@social.Title</span>
</a> </a>
</div> </div>
} }
@ -51,7 +53,7 @@
@if (allRules.Any(rule => rule.Value.Any())) @if (allRules.Any(rule => rule.Value.Any()))
{ {
<h2 class="pb-3 ml-auto mr-auto ml-md-0">@ViewBag.Localization["WEBFRONT_ABOUT_COMMUNITY_GUIDELINES"]</h2> <h2 class="pb-3 p-0 col-12 text-center text-md-left">@ViewBag.Localization["WEBFRONT_ABOUT_COMMUNITY_GUIDELINES"]</h2>
} }
@foreach (var (serverName, rules) in allRules) @foreach (var (serverName, rules) in allRules)
@ -62,7 +64,7 @@
} }
var start = 1; var start = 1;
<div class="col-12 bg-dark p-4 border border-primary mb-4"> <div class="col-12 bg-dark p-4 border border-primary mb-4 col-12">
<div class="text-primary h4"> <div class="text-primary h4">
<color-code value="@serverName" allow="@ViewBag.EnableColorCodes"></color-code> <color-code value="@serverName" allow="@ViewBag.EnableColorCodes"></color-code>
</div> </div>