38 lines
940 B
Plaintext
38 lines
940 B
Plaintext
@namespace Oqtane.Themes.Controls
|
|
@inherits ThemeControlBase
|
|
@inject IStringLocalizer<UserProfile> Localizer
|
|
|
|
@inject NavigationManager NavigationManager
|
|
|
|
<span class="app-profile">
|
|
<AuthorizeView>
|
|
<Authorizing>
|
|
<text>...</text>
|
|
</Authorizing>
|
|
<Authorized>
|
|
<button type="button" class="btn btn-primary" @onclick="UpdateProfile">@context.User.Identity.Name</button>
|
|
</Authorized>
|
|
<NotAuthorized>
|
|
@if (PageState.Site.AllowRegistration)
|
|
{
|
|
<button type="button" class="btn btn-primary" @onclick="RegisterUser">@Localizer["Register"]</button>
|
|
}
|
|
</NotAuthorized>
|
|
</AuthorizeView>
|
|
</span>
|
|
|
|
@code {
|
|
|
|
private void RegisterUser()
|
|
{
|
|
NavigationManager.NavigateTo(NavigateUrl("register"));
|
|
}
|
|
|
|
private void UpdateProfile()
|
|
{
|
|
NavigationManager.NavigateTo(NavigateUrl("profile"));
|
|
}
|
|
}
|
|
|
|
|