@namespace Oqtane.Modules.Admin.Sites
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject ISiteService SiteService
@inject IThemeService ThemeService
@if (themes == null)
{
Loading...
}
else
{
Cancel
}
@code {
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Host; } }
Dictionary themes = new Dictionary();
Dictionary panelayouts = new Dictionary();
string name = "";
string logo = "";
string themetype;
string layouttype;
protected override void OnInitialized()
{
themes = ThemeService.GetThemeTypes(PageState.Themes);
panelayouts = ThemeService.GetPaneLayoutTypes(PageState.Themes);
name = PageState.Site.Name;
logo = PageState.Site.Logo;
themetype = PageState.Site.DefaultThemeType;
layouttype = PageState.Site.DefaultLayoutType;
}
private async Task SaveSite()
{
Site site = PageState.Site;
site.Name = name;
site.Logo = (logo == null ? "" : logo);
site.DefaultThemeType = themetype;
site.DefaultLayoutType = (layouttype == null ? "" : layouttype);
site = await SiteService.UpdateSiteAsync(site);
NavigationManager.NavigateTo(NavigateUrl());
}
}