[backend/razor] Show register link in Public Preview footer if registrations aren't closed

This commit is contained in:
pancakes 2024-11-29 00:13:52 +10:00 committed by Laura Hausmann
parent 49e9c6d825
commit ca567e4aba
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -1,4 +1,4 @@
@inject IOptions<Config.InstanceSection> Instance @inject IOptions<Config> Config
@using Iceshrimp.Backend.Core.Configuration @using Iceshrimp.Backend.Core.Configuration
@using Iceshrimp.Backend.Core.Extensions @using Iceshrimp.Backend.Core.Extensions
@using Iceshrimp.Backend.Core.Middleware @using Iceshrimp.Backend.Core.Middleware
@ -22,11 +22,18 @@
<footer> <footer>
<div class="footer"> <div class="footer">
<span> <span>
<strong>Iceshrimp.NET</strong> v@(Instance.Value.Version) <strong>Iceshrimp.NET</strong> v@(Config.Value.Instance.Version)
</span> </span>
@if (!Context.ShouldHideFooter()) @if (!Context.ShouldHideFooter())
{ {
<div>
@if (Config.Value.Security.Registrations != Enums.Registrations.Closed)
{
<a href="/register">Register</a>
<span aria-hidden="true">&bullet;</span>
}
<a href="/login?rd=@((Context.Request.Path.Value ?? "/").UrlEncode())">Login</a> <a href="/login?rd=@((Context.Request.Path.Value ?? "/").UrlEncode())">Login</a>
</div>
} }
</div> </div>
</footer> </footer>