38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
@namespace Oqtane.Themes.Controls
|
|
@inherits LoginBase
|
|
@inject IStringLocalizer<Login> Localizer
|
|
@inject IStringLocalizer<SharedResources> SharedLocalizer
|
|
|
|
<span class="app-login">
|
|
@if (PageState.User != null)
|
|
{
|
|
@if (PageState.Runtime == Runtime.Hybrid)
|
|
{
|
|
<button type="button" class="@CssClass" @onclick="LogoutUser">@Localizer["Logout"]</button>
|
|
}
|
|
else
|
|
{
|
|
<form method="post" class="app-form-inline" action="@logouturl" @formname="LogoutForm">
|
|
<input type="hidden" name="@Constants.RequestVerificationToken" value="@SiteState.AntiForgeryToken" />
|
|
<input type="hidden" name="returnurl" value="@returnurl" />
|
|
<input type="hidden" name="everywhere" value="@everywhere" />
|
|
<button type="submit" class="@CssClass">@Localizer["Logout"]</button>
|
|
</form>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
@if (ShowLogin)
|
|
{
|
|
<a href="@loginurl" class="@CssClass">@SharedLocalizer["Login"]</a>
|
|
}
|
|
}
|
|
</span>
|
|
|
|
@code
|
|
{
|
|
[Parameter]
|
|
public bool ShowLogin { get; set; } = true;
|
|
[Parameter]
|
|
public string CssClass { get; set; } = "btn btn-primary";
|
|
} |