This commit is contained in:
beolafsen 2025-01-13 07:31:35 +01:00
parent 7f3d6ef6a5
commit 5a4cdc5354
2 changed files with 9 additions and 5 deletions

View File

@ -8,14 +8,14 @@
{ {
@if (PageState.Runtime == Runtime.Hybrid) @if (PageState.Runtime == Runtime.Hybrid)
{ {
<button type="button" class="btn btn-primary" @onclick="LogoutUser">@Localizer["Logout"]</button> <button type="button" class="@CssClass" @onclick="LogoutUser">@Localizer["Logout"]</button>
} }
else else
{ {
<form method="post" class="app-form-inline" action="@logouturl" @formname="LogoutForm"> <form method="post" class="app-form-inline" action="@logouturl" @formname="LogoutForm">
<input type="hidden" name="@Constants.RequestVerificationToken" value="@SiteState.AntiForgeryToken" /> <input type="hidden" name="@Constants.RequestVerificationToken" value="@SiteState.AntiForgeryToken" />
<input type="hidden" name="returnurl" value="@returnurl" /> <input type="hidden" name="returnurl" value="@returnurl" />
<button type="submit" class="btn btn-primary">@Localizer["Logout"]</button> <button type="submit" class="@CssClass">@Localizer["Logout"]</button>
</form> </form>
} }
} }
@ -23,7 +23,7 @@
{ {
@if (ShowLogin) @if (ShowLogin)
{ {
<a href="@loginurl" class="btn btn-primary">@SharedLocalizer["Login"]</a> <a href="@loginurl" class="@CssClass">@SharedLocalizer["Login"]</a>
} }
} }
</span> </span>
@ -32,4 +32,6 @@
{ {
[Parameter] [Parameter]
public bool ShowLogin { get; set; } = true; public bool ShowLogin { get; set; } = true;
[Parameter]
public string CssClass { get; set; } = "btn btn-primary";
} }

View File

@ -8,13 +8,13 @@
<span class="app-profile"> <span class="app-profile">
@if (PageState.User != null) @if (PageState.User != null)
{ {
<a href="@NavigateUrl("profile", "returnurl=" + _returnurl)" class="btn btn-primary">@PageState.User.Username</a> <a href="@NavigateUrl("profile", "returnurl=" + _returnurl)" class="@CssClass">@PageState.User.Username</a>
} }
else else
{ {
@if (ShowRegister && PageState.Site.AllowRegistration) @if (ShowRegister && PageState.Site.AllowRegistration)
{ {
<a href="@NavigateUrl("register", "returnurl=" + _returnurl)" class="btn btn-primary">@Localizer["Register"]</a> <a href="@NavigateUrl("register", "returnurl=" + _returnurl)" class="@CssClass">@Localizer["Register"]</a>
} }
} }
</span> </span>
@ -23,6 +23,8 @@
[Parameter] [Parameter]
public bool ShowRegister { get; set; } public bool ShowRegister { get; set; }
[Parameter]
public string CssClass { get; set; } = "btn btn-primary";
private string _returnurl = ""; private string _returnurl = "";