introducing Site Groups
This commit is contained in:
@@ -4,11 +4,6 @@
|
||||
@inject IPageService PageService
|
||||
@inject ISettingService SettingService
|
||||
|
||||
@if (ShowLanguageSwitcher)
|
||||
{
|
||||
<LanguageSwitcher ButtonClass="@ButtonClass" DropdownAlignment="@LanguageDropdownAlignment" />
|
||||
}
|
||||
|
||||
@if (ShowEditMode && (_showEditMode || (PageState.Page.IsPersonalizable && PageState.User != null && UserSecurity.IsAuthorized(PageState.User, RoleNames.Registered))))
|
||||
{
|
||||
<form method="post" class="app-form-inline" @formname="EditModeForm" @onsubmit="@(async () => await ToggleEditMode(PageState.EditMode))" data-enhance>
|
||||
@@ -53,9 +48,11 @@
|
||||
[Parameter]
|
||||
public string BodyClass { get; set; } = "offcanvas-body overflow-auto";
|
||||
|
||||
// deprecated in 10.1.0 - UI culture is set in user's profile
|
||||
[Parameter]
|
||||
public bool ShowLanguageSwitcher { get; set; } = true;
|
||||
|
||||
// deprecated in 10.1.0 - UI culture is set in user's profile
|
||||
[Parameter]
|
||||
public string LanguageDropdownAlignment { get; set; } = string.Empty; // Empty or Left or Right
|
||||
|
||||
|
||||
37
Oqtane.Client/Themes/Controls/Theme/LanguageSelector.razor
Normal file
37
Oqtane.Client/Themes/Controls/Theme/LanguageSelector.razor
Normal file
@@ -0,0 +1,37 @@
|
||||
@using System.Globalization
|
||||
@using Oqtane.Models
|
||||
@using System.Linq
|
||||
@namespace Oqtane.Themes.Controls
|
||||
@inherits ThemeControlBase
|
||||
@inject ILocalizationService LocalizationService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@if (PageState.Site.Languages.Count() > 1)
|
||||
{
|
||||
<div class="app-languages btn-group pe-1" role="group">
|
||||
<button id="btnCultures" type="button" class="btn @ButtonClass dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="oi oi-globe"></span>
|
||||
</button>
|
||||
<div class="dropdown-menu @MenuAlignment">
|
||||
@foreach (var language in PageState.Site.Languages)
|
||||
{
|
||||
<a class="dropdown-item" href="@(PageState.Alias.Protocol + language.AliasName)">@language.Name</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code{
|
||||
private string MenuAlignment = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public string DropdownAlignment { get; set; } = string.Empty; // Empty or Left or Right
|
||||
|
||||
[Parameter]
|
||||
public string ButtonClass { get; set; } = "btn-outline-secondary";
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
MenuAlignment = DropdownAlignment.ToLower() == "right" ? "dropdown-menu-end" : string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
<Search CssClass="me-3 text-center bg-primary" />
|
||||
<UserProfile ShowRegister="@_register" />
|
||||
<Login ShowLogin="@_login" />
|
||||
<LanguageSelector />
|
||||
<ControlPanel LanguageDropdownAlignment="right" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user