Merge main into mod-panel

This commit is contained in:
jvyden 2022-08-05 17:02:19 -04:00
commit b6da930e20
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
300 changed files with 8417 additions and 700 deletions

View file

@ -127,28 +127,36 @@
<div class="ui container">
<div style="display: flex; align-items: center; font-size: 1.2rem;">
<i class="warning icon"></i>
<span style="font-size: 1.2rem;">JavaScript not enabled</span>
<span style="font-size: 1.2rem;">@Model.Translate(BaseLayoutStrings.JavaScriptWarnTitle)</span>
</div>
<p>
While we intend to have as little JavaScript as possible, we can not
guarantee everything will work without it. We recommend that you whitelist JavaScript for Project Lighthouse.
It's not <i>too</i> bloated, we promise.
</p>
<p>@Model.Translate(BaseLayoutStrings.JavaScriptWarn)</p>
</div>
</div>
</noscript>
@* ReSharper disable HeuristicUnreachableCode *@
@* ReSharper disable CSharpWarnings::CS0162 *@
@if (!ServerStatics.IsDebug && VersionHelper.IsDirty)
{
<div class="ui bottom attached red message large">
<div class="ui container">
<i class="warning icon"></i>
<span style="font-size: 1.2rem;">Potential License Violation</span>
<p>This instance is a public-facing instance that has been modified without the changes published. You may be in violation of the <a href="https://github.com/LBPUnion/project-lighthouse/blob/main/LICENSE">GNU Affero General Public License v3.0</a>.</p>
<p>If you believe this is an error, please create an issue with the output of <code>git status</code> ran from the root of the server source code in the description on our <a href="https://github.com/LBPUnion/project-lighthouse/issues">issue tracker</a>.</p>
<p>If not, please publish the source code somewhere accessible to your users.</p>
<span style="font-size: 1.2rem;">@Model.Translate(BaseLayoutStrings.LicenseWarnTitle)</span>
<p>
@Html.Raw(Model.Translate(BaseLayoutStrings.LicenseWarn1,
"<a href=\"https://github.com/LBPUnion/project-lighthouse/blob/main/LICENSE\">GNU Affero General Public License v3.0</a>"))
</p>
<p>
@Html.Raw(Model.Translate(BaseLayoutStrings.LicenseWarn2,
"<code>git status</code>", "<a href=\"https://github.com/LBPUnion/project-lighthouse/issues\">", "</a>"))
</p>
<p>
@Html.Raw(Model.Translate(BaseLayoutStrings.LicenseWarn3))
</p>
</div>
</div>
}
@* ReSharper restore CSharpWarnings::CS0162 *@
@* ReSharper restore HeuristicUnreachableCode *@
</header>
<div class="main">
<div class="ui container">
@ -165,10 +173,10 @@
<div class="ui black attached inverted segment">
<div class="ui container">
<p>Page generated by @VersionHelper.FullVersion.</p>
<p>@Model.Translate(BaseLayoutStrings.GeneratedBy, VersionHelper.FullVersion)</p>
@if (VersionHelper.IsDirty)
{
<p>This page was generated using a modified version of Project Lighthouse. Please make sure you are properly disclosing the source code to any users who may be using this instance.</p>
<p>@Model.Translate(BaseLayoutStrings.GeneratedModified)</p>
}
</div>
</div>

View file

@ -52,6 +52,8 @@ public class BaseLayout : PageModel
{
if (ServerStatics.IsUnitTesting) return LocalizationManager.DefaultLang;
if (this.language != null) return this.language;
if (this.User?.IsAPirate ?? false) return "en-PT";
IRequestCultureFeature? requestCulture = Request.HttpContext.Features.Get<IRequestCultureFeature>();
if (requestCulture == null) return this.language = LocalizationManager.DefaultLang;