@@ -95,7 +112,7 @@
@SharedLocalizer["Cancel"]
- @if (PageState.QueryString.ContainsKey("id"))
+ @if (PageState.QueryString.ContainsKey("id"))
{
@@ -116,6 +133,8 @@
private string _rows = "1";
private string _defaultvalue = string.Empty;
private string _options = string.Empty;
+ private string _optiontype = "Settings";
+ private List
_entitynames;
private string _validation = string.Empty;
private string _autocomplete = string.Empty;
private string _isrequired = "False";
@@ -133,6 +152,8 @@
{
try
{
+ _entitynames = await SettingService.GetEntityNamesAsync();
+
if (PageState.QueryString.ContainsKey("id"))
{
_profileid = Int32.Parse(PageState.QueryString["id"]);
@@ -148,6 +169,11 @@
_rows = profile.Rows.ToString();
_defaultvalue = profile.DefaultValue;
_options = profile.Options;
+ if (_options.StartsWith("EntityName:"))
+ {
+ _optiontype = "Options";
+ _options = _options.Substring(11);
+ }
_validation = profile.Validation;
_autocomplete = profile.Autocomplete;
_isrequired = profile.IsRequired.ToString();
@@ -166,6 +192,18 @@
}
}
+ private void ToggleOptionType()
+ {
+ if (_optiontype == "Options")
+ {
+ _optiontype = "Settings";
+ }
+ else
+ {
+ _optiontype = "Options";
+ }
+ }
+
private async Task SaveProfile()
{
validated = true;
@@ -193,7 +231,14 @@
profile.MaxLength = int.Parse(_maxlength);
profile.Rows = int.Parse(_rows);
profile.DefaultValue = _defaultvalue;
- profile.Options = _options;
+ if (_optiontype == "Options" && !string.IsNullOrEmpty(_options))
+ {
+ profile.Options = "EntityName:" + _options;
+ }
+ else
+ {
+ profile.Options = _options;
+ }
profile.Validation = _validation;
profile.Autocomplete = _autocomplete;
profile.IsRequired = (_isrequired == null ? false : Boolean.Parse(_isrequired));
diff --git a/Oqtane.Client/Modules/Admin/Site/Index.razor b/Oqtane.Client/Modules/Admin/Site/Index.razor
index b921ab38..525f45df 100644
--- a/Oqtane.Client/Modules/Admin/Site/Index.razor
+++ b/Oqtane.Client/Modules/Admin/Site/Index.razor
@@ -592,9 +592,17 @@
{
_faviconfileid = site.FaviconFileId.Value;
}
- _themes = ThemeService.GetThemeControls(PageState.Site.Themes);
+ var themes = new List();
+ foreach (var theme in PageState.Site.Themes)
+ {
+ if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Utilize, theme.PermissionList))
+ {
+ themes.Add(theme);
+ }
+ }
+ _themes = ThemeService.GetThemeControls(themes);
_themetype = (!string.IsNullOrEmpty(site.DefaultThemeType)) ? site.DefaultThemeType : Constants.DefaultTheme;
- _containers = ThemeService.GetContainerControls(PageState.Site.Themes, _themetype);
+ _containers = ThemeService.GetContainerControls(themes, _themetype);
_containertype = (!string.IsNullOrEmpty(site.DefaultContainerType)) ? site.DefaultContainerType : Constants.DefaultContainer;
_admincontainertype = (!string.IsNullOrEmpty(site.AdminContainerType)) ? site.AdminContainerType : Constants.DefaultAdminContainer;
_cookieconsent = SettingService.GetSetting(settings, "CookieConsent", string.Empty);
diff --git a/Oqtane.Client/Modules/Admin/Sites/Add.razor b/Oqtane.Client/Modules/Admin/Sites/Add.razor
index 96949077..383a839e 100644
--- a/Oqtane.Client/Modules/Admin/Sites/Add.razor
+++ b/Oqtane.Client/Modules/Admin/Sites/Add.razor
@@ -216,7 +216,7 @@ else
_tenantid = _tenants.First(item => item.Name == TenantNames.Master).TenantId.ToString();
}
_urls = PageState.Alias.Name;
- _themeList = await ThemeService.GetThemesAsync();
+ _themeList = await ThemeService.GetThemesAsync(PageState.Site.SiteId);
_themes = ThemeService.GetThemeControls(_themeList);
if (_themes.Any(item => item.TypeName == Constants.DefaultTheme))
{
diff --git a/Oqtane.Client/Modules/Admin/Themes/Add.razor b/Oqtane.Client/Modules/Admin/Themes/Add.razor
index cece5ed4..0da378fa 100644
--- a/Oqtane.Client/Modules/Admin/Themes/Add.razor
+++ b/Oqtane.Client/Modules/Admin/Themes/Add.razor
@@ -195,7 +195,7 @@
{
try
{
- _themes = await ThemeService.GetThemesAsync();
+ _themes = await ThemeService.GetThemesAsync(PageState.Site.SiteId);
await LoadPackages();
_initialized = true;
}
diff --git a/Oqtane.Client/Modules/Admin/Themes/Edit.razor b/Oqtane.Client/Modules/Admin/Themes/Edit.razor
index 125e2846..4e7560e5 100644
--- a/Oqtane.Client/Modules/Admin/Themes/Edit.razor
+++ b/Oqtane.Client/Modules/Admin/Themes/Edit.razor
@@ -9,84 +9,98 @@
@if (_initialized)
{
-