String fix with login/register button (#755)

* Display "Login" only when registration is off, remove unused BaseLayoutStrings

* Remove un-used strings from BaseLayout
This commit is contained in:
koko 2023-04-28 23:44:33 -04:00 committed by GitHub
commit 586c161c71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 12 deletions

View file

@ -24,11 +24,6 @@
</value> </value>
</resheader> </resheader>
<data name="header_home" xml:space="preserve">
<value>Home</value>
<comment>A button on the header that takes you to the landing page.</comment>
</data>
<data name="header_users" xml:space="preserve"> <data name="header_users" xml:space="preserve">
<value>Users</value> <value>Users</value>
<comment>A button on the header that takes you to the user listing.</comment> <comment>A button on the header that takes you to the user listing.</comment>
@ -49,14 +44,14 @@
<comment>A button on the header that takes you to a list of authentication attempts.</comment> <comment>A button on the header that takes you to a list of authentication attempts.</comment>
</data> </data>
<data name="header_login" xml:space="preserve">
<value>Login</value>
<comment>A button on the header that lets you log in.</comment>
</data>
<data name="header_loginRegister" xml:space="preserve"> <data name="header_loginRegister" xml:space="preserve">
<value>Login / Register</value> <value>Login / Register</value>
<comment>A button on the header that lets you log in or register.</comment> <comment>A button on the header that lets you log in or register.</comment>
</data> </data>
<data name="header_profile" xml:space="preserve">
<value>Profile</value>
<comment>A quick shortcut on the header to take you to your profile if logged in.</comment>
</data>
<data name="header_adminPanel" xml:space="preserve"> <data name="header_adminPanel" xml:space="preserve">
<value>Admin</value> <value>Admin</value>
<comment>A header link that takes you to the admin panel if available.</comment> <comment>A header link that takes you to the admin panel if available.</comment>

View file

@ -2,14 +2,13 @@ namespace LBPUnion.ProjectLighthouse.Localization.StringLists;
public static class BaseLayoutStrings public static class BaseLayoutStrings
{ {
public static readonly TranslatableString HeaderHome = create("header_home");
public static readonly TranslatableString HeaderUsers = create("header_users"); public static readonly TranslatableString HeaderUsers = create("header_users");
public static readonly TranslatableString HeaderPhotos = create("header_photos"); public static readonly TranslatableString HeaderPhotos = create("header_photos");
public static readonly TranslatableString HeaderSlots = create("header_slots"); public static readonly TranslatableString HeaderSlots = create("header_slots");
public static readonly TranslatableString HeaderAuthentication = create("header_authentication"); public static readonly TranslatableString HeaderAuthentication = create("header_authentication");
public static readonly TranslatableString HeaderLogin = create("header_login");
public static readonly TranslatableString HeaderLoginRegister = create("header_loginRegister"); public static readonly TranslatableString HeaderLoginRegister = create("header_loginRegister");
public static readonly TranslatableString HeaderProfile = create("header_profile");
public static readonly TranslatableString HeaderAdminPanel = create("header_adminPanel"); public static readonly TranslatableString HeaderAdminPanel = create("header_adminPanel");
public static readonly TranslatableString HeaderModPanel = create("header_modPanel"); public static readonly TranslatableString HeaderModPanel = create("header_modPanel");
public static readonly TranslatableString HeaderLogout = create("header_logout"); public static readonly TranslatableString HeaderLogout = create("header_logout");

View file

@ -7,10 +7,17 @@
@{ @{
if (Model.User == null) if (Model.User == null)
{
if (ServerConfiguration.Instance.Authentication.RegistrationEnabled)
{ {
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLoginRegister, "/login", "sign in")); Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLoginRegister, "/login", "sign in"));
} }
else else
{
Model.NavigationItemsRight.Add(new PageNavigationItem(BaseLayoutStrings.HeaderLogin, "/login", "sign in"));
}
}
else
{ {
Model.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAuthentication, "/authentication", "key")); Model.NavigationItems.Add(new PageNavigationItem(BaseLayoutStrings.HeaderAuthentication, "/authentication", "key"));