+
+
+
+
+
+
@@ -112,6 +123,7 @@
private List
_containers = new List();
private string _module;
private string _title;
+ private string _pane;
private string _containerType;
private string _allPages = "false";
private string _permissionNames = "";
@@ -134,80 +146,82 @@
{
_module = ModuleState.ModuleDefinition.Name;
_title = ModuleState.Title;
+ _pane = ModuleState.Pane;
_containers = ThemeService.GetContainerControls(PageState.Site.Themes, PageState.Page.ThemeType);
- _containerType = ModuleState.ContainerType;
- _allPages = ModuleState.AllPages.ToString();
- _permissions = ModuleState.PermissionList;
- _pageId = ModuleState.PageId.ToString();
- createdby = ModuleState.CreatedBy;
- createdon = ModuleState.CreatedOn;
- modifiedby = ModuleState.ModifiedBy;
- modifiedon = ModuleState.ModifiedOn;
+ _containerType = ModuleState.ContainerType;
+ _allPages = ModuleState.AllPages.ToString();
+ _permissions = ModuleState.PermissionList;
+ _pageId = ModuleState.PageId.ToString();
+ createdby = ModuleState.CreatedBy;
+ createdon = ModuleState.CreatedOn;
+ modifiedby = ModuleState.ModifiedBy;
+ modifiedon = ModuleState.ModifiedOn;
- if (ModuleState.ModuleDefinition != null)
- {
- _permissionNames = ModuleState.ModuleDefinition?.PermissionNames;
+ if (ModuleState.ModuleDefinition != null)
+ {
+ _permissionNames = ModuleState.ModuleDefinition?.PermissionNames;
- if (!string.IsNullOrEmpty(ModuleState.ModuleDefinition.SettingsType))
- {
- // module settings type explicitly declared in IModule interface
- _moduleSettingsType = Type.GetType(ModuleState.ModuleDefinition.SettingsType);
- }
- else
- {
- // legacy support - module settings type determined by convention ( ie. existence of a "Settings.razor" component in module )
- _moduleSettingsType = Type.GetType(ModuleState.ModuleDefinition.ControlTypeTemplate.Replace(Constants.ActionToken, PageState.Action), false, true);
- }
- if (_moduleSettingsType != null)
- {
- var moduleobject = Activator.CreateInstance(_moduleSettingsType) as IModuleControl;
- if (!string.IsNullOrEmpty(moduleobject.Title))
- {
- _moduleSettingsTitle = moduleobject.Title;
- }
+ if (!string.IsNullOrEmpty(ModuleState.ModuleDefinition.SettingsType))
+ {
+ // module settings type explicitly declared in IModule interface
+ _moduleSettingsType = Type.GetType(ModuleState.ModuleDefinition.SettingsType);
+ }
+ else
+ {
+ // legacy support - module settings type determined by convention ( ie. existence of a "Settings.razor" component in module )
+ _moduleSettingsType = Type.GetType(ModuleState.ModuleDefinition.ControlTypeTemplate.Replace(Constants.ActionToken, PageState.Action), false, true);
+ }
+ if (_moduleSettingsType != null)
+ {
+ var moduleobject = Activator.CreateInstance(_moduleSettingsType) as IModuleControl;
+ if (!string.IsNullOrEmpty(moduleobject.Title))
+ {
+ _moduleSettingsTitle = moduleobject.Title;
+ }
- ModuleSettingsComponent = builder =>
- {
- builder.OpenComponent(0, _moduleSettingsType);
- builder.AddComponentReferenceCapture(1, inst => { _moduleSettings = Convert.ChangeType(inst, _moduleSettingsType); });
- builder.CloseComponent();
- };
- }
- }
- else
- {
- AddModuleMessage(string.Format(Localizer["Error.Module.Load"], ModuleState.ModuleDefinitionName), MessageType.Error);
- }
+ ModuleSettingsComponent = builder =>
+ {
+ builder.OpenComponent(0, _moduleSettingsType);
+ builder.AddComponentReferenceCapture(1, inst => { _moduleSettings = Convert.ChangeType(inst, _moduleSettingsType); });
+ builder.CloseComponent();
+ };
+ }
+ }
+ else
+ {
+ AddModuleMessage(string.Format(Localizer["Error.Module.Load"], ModuleState.ModuleDefinitionName), MessageType.Error);
+ }
var theme = PageState.Site.Themes.FirstOrDefault(item => item.Containers.Any(themecontrol => themecontrol.TypeName.Equals(_containerType)));
- if (theme != null && !string.IsNullOrEmpty(theme.ContainerSettingsType))
- {
- _containerSettingsType = Type.GetType(theme.ContainerSettingsType);
- if (_containerSettingsType != null)
- {
- ContainerSettingsComponent = builder =>
- {
- builder.OpenComponent(0, _containerSettingsType);
- builder.AddComponentReferenceCapture(1, inst => { _containerSettings = Convert.ChangeType(inst, _containerSettingsType); });
- builder.CloseComponent();
- };
- }
- }
- }
+ if (theme != null && !string.IsNullOrEmpty(theme.ContainerSettingsType))
+ {
+ _containerSettingsType = Type.GetType(theme.ContainerSettingsType);
+ if (_containerSettingsType != null)
+ {
+ ContainerSettingsComponent = builder =>
+ {
+ builder.OpenComponent(0, _containerSettingsType);
+ builder.AddComponentReferenceCapture(1, inst => { _containerSettings = Convert.ChangeType(inst, _containerSettingsType); });
+ builder.CloseComponent();
+ };
+ }
+ }
+ }
- private async Task SaveModule()
- {
- validated = true;
- var interop = new Interop(JSRuntime);
- if (await interop.FormValid(form))
- {
- if (!string.IsNullOrEmpty(_title))
- {
- var pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId);
- pagemodule.PageId = int.Parse(_pageId);
- pagemodule.Title = _title;
- pagemodule.ContainerType = (_containerType != "-") ? _containerType : string.Empty;
- if (!string.IsNullOrEmpty(pagemodule.ContainerType) && pagemodule.ContainerType == PageState.Page.DefaultContainerType)
+ private async Task SaveModule()
+ {
+ validated = true;
+ var interop = new Interop(JSRuntime);
+ if (await interop.FormValid(form))
+ {
+ if (!string.IsNullOrEmpty(_title))
+ {
+ var pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId);
+ pagemodule.PageId = int.Parse(_pageId);
+ pagemodule.Title = _title;
+ pagemodule.Pane = _pane;
+ pagemodule.ContainerType = (_containerType != "-") ? _containerType : string.Empty;
+ if (!string.IsNullOrEmpty(pagemodule.ContainerType) && pagemodule.ContainerType == PageState.Page.DefaultContainerType)
{
pagemodule.ContainerType = string.Empty;
}
diff --git a/Oqtane.Client/Modules/Admin/Pages/Index.razor b/Oqtane.Client/Modules/Admin/Pages/Index.razor
index d71dc964..f1b9e9b4 100644
--- a/Oqtane.Client/Modules/Admin/Pages/Index.razor
+++ b/Oqtane.Client/Modules/Admin/Pages/Index.razor
@@ -9,7 +9,7 @@
{
-
+
+
@@ -101,6 +107,7 @@
private string _category = string.Empty;
private string _vieworder = "0";
private string _maxlength = "0";
+ private string _rows = "1";
private string _defaultvalue = string.Empty;
private string _options = string.Empty;
private string _validation = string.Empty;
@@ -131,6 +138,7 @@
_category = profile.Category;
_vieworder = profile.ViewOrder.ToString();
_maxlength = profile.MaxLength.ToString();
+ _rows = profile.Rows.ToString();
_defaultvalue = profile.DefaultValue;
_options = profile.Options;
_validation = profile.Validation;
@@ -175,6 +183,7 @@
profile.Category = _category;
profile.ViewOrder = int.Parse(_vieworder);
profile.MaxLength = int.Parse(_maxlength);
+ profile.Rows = int.Parse(_rows);
profile.DefaultValue = _defaultvalue;
profile.Options = _options;
profile.Validation = _validation;
diff --git a/Oqtane.Client/Modules/Admin/Profiles/Index.razor b/Oqtane.Client/Modules/Admin/Profiles/Index.razor
index f554c6c5..587fa452 100644
--- a/Oqtane.Client/Modules/Admin/Profiles/Index.razor
+++ b/Oqtane.Client/Modules/Admin/Profiles/Index.razor
@@ -12,7 +12,7 @@ else
{
-
+
|
|
diff --git a/Oqtane.Client/Modules/Admin/Roles/Index.razor b/Oqtane.Client/Modules/Admin/Roles/Index.razor
index 6677548d..6b0e4610 100644
--- a/Oqtane.Client/Modules/Admin/Roles/Index.razor
+++ b/Oqtane.Client/Modules/Admin/Roles/Index.razor
@@ -12,7 +12,7 @@ else
{
-
+
|
|
diff --git a/Oqtane.Client/Modules/Admin/Sites/Index.razor b/Oqtane.Client/Modules/Admin/Sites/Index.razor
index 8075d4d6..20a652ee 100644
--- a/Oqtane.Client/Modules/Admin/Sites/Index.razor
+++ b/Oqtane.Client/Modules/Admin/Sites/Index.razor
@@ -14,7 +14,7 @@ else
{
-
+
|
|
diff --git a/Oqtane.Client/Modules/Admin/Themes/Add.razor b/Oqtane.Client/Modules/Admin/Themes/Add.razor
index 3b22ef3c..a7be5907 100644
--- a/Oqtane.Client/Modules/Admin/Themes/Add.razor
+++ b/Oqtane.Client/Modules/Admin/Themes/Add.razor
@@ -66,6 +66,7 @@
@SharedLocalizer["Search.Version"]: @context.Version
diff --git a/Oqtane.Client/Modules/Admin/UrlMappings/Index.razor b/Oqtane.Client/Modules/Admin/UrlMappings/Index.razor
index 28478589..6ed8c769 100644
--- a/Oqtane.Client/Modules/Admin/UrlMappings/Index.razor
+++ b/Oqtane.Client/Modules/Admin/UrlMappings/Index.razor
@@ -28,7 +28,7 @@ else
-
+
@@ -282,9 +296,11 @@ else
private int folderid = -1;
private int photofileid = -1;
private File photo = null;
+
private List profiles;
private Dictionary settings;
private string category = string.Empty;
+
private string filter = "to";
private List notifications;
private string notificationSummary = string.Empty;
@@ -363,44 +379,47 @@ else
{
try
{
- if (username != string.Empty && email != string.Empty && ValidateProfiles())
+ if (username != string.Empty && email != string.Empty)
{
if (_password == confirm)
{
- var user = PageState.User;
- user.Username = username;
- user.Password = _password;
- user.TwoFactorRequired = bool.Parse(twofactor);
- user.Email = email;
- user.DisplayName = (displayname == string.Empty ? username : displayname);
- user.PhotoFileId = filemanager.GetFileId();
- if (user.PhotoFileId == -1)
+ if (ValidateProfiles())
{
- user.PhotoFileId = null;
- }
- if (user.PhotoFileId != null)
- {
- photofileid = user.PhotoFileId.Value;
- photo = await FileService.GetFileAsync(photofileid);
- }
- else
- {
- photofileid = -1;
- photo = null;
- }
+ var user = PageState.User;
+ user.Username = username;
+ user.Password = _password;
+ user.TwoFactorRequired = bool.Parse(twofactor);
+ user.Email = email;
+ user.DisplayName = (displayname == string.Empty ? username : displayname);
+ user.PhotoFileId = filemanager.GetFileId();
+ if (user.PhotoFileId == -1)
+ {
+ user.PhotoFileId = null;
+ }
+ if (user.PhotoFileId != null)
+ {
+ photofileid = user.PhotoFileId.Value;
+ photo = await FileService.GetFileAsync(photofileid);
+ }
+ else
+ {
+ photofileid = -1;
+ photo = null;
+ }
- user = await UserService.UpdateUserAsync(user);
- if (user != null)
- {
- await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId);
- await logger.LogInformation("User Profile Saved");
+ user = await UserService.UpdateUserAsync(user);
+ if (user != null)
+ {
+ await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId);
+ await logger.LogInformation("User Profile Saved");
- AddModuleMessage(Localizer["Success.Profile.Update"], MessageType.Success);
- StateHasChanged();
- }
- else
- {
- AddModuleMessage(Localizer["Message.Password.Complexity"], MessageType.Error);
+ AddModuleMessage(Localizer["Success.Profile.Update"], MessageType.Success);
+ StateHasChanged();
+ }
+ else
+ {
+ AddModuleMessage(Localizer["Message.Password.Complexity"], MessageType.Error);
+ }
}
}
else
@@ -424,7 +443,6 @@ else
private bool ValidateProfiles()
{
- bool valid = true;
foreach (Profile profile in profiles)
{
if (string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)) && !string.IsNullOrEmpty(profile.DefaultValue))
@@ -433,18 +451,24 @@ else
}
if (!profile.IsPrivate || UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin))
{
- if (valid == true && profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
+ if (profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
{
- valid = false;
+ AddModuleMessage(string.Format(SharedLocalizer["ProfileRequired"], profile.Title), MessageType.Warning);
+ return false;
}
- if (valid == true && !string.IsNullOrEmpty(profile.Validation))
+ if (!string.IsNullOrEmpty(profile.Validation))
{
Regex regex = new Regex(profile.Validation);
- valid = regex.Match(SettingService.GetSetting(settings, profile.Name, string.Empty)).Success;
+ bool valid = regex.Match(SettingService.GetSetting(settings, profile.Name, string.Empty)).Success;
+ if (!valid)
+ {
+ AddModuleMessage(string.Format(SharedLocalizer["ProfileInvalid"], profile.Title), MessageType.Warning);
+ return false;
+ }
}
}
}
- return valid;
+ return true;
}
private void Cancel()
diff --git a/Oqtane.Client/Modules/Admin/Users/Add.razor b/Oqtane.Client/Modules/Admin/Users/Add.razor
index 817bf5e1..10f24ff1 100644
--- a/Oqtane.Client/Modules/Admin/Users/Add.razor
+++ b/Oqtane.Client/Modules/Admin/Users/Add.razor
@@ -80,18 +80,50 @@
}
-
}
@@ -148,31 +180,34 @@
{
try
{
- if (_username != string.Empty && _password != string.Empty && _confirm != string.Empty && _email != string.Empty && ValidateProfiles())
+ if (_username != string.Empty && _password != string.Empty && _confirm != string.Empty && _email != string.Empty)
{
if (_password == _confirm)
{
- var user = new User();
- user.SiteId = PageState.Site.SiteId;
- user.Username = _username;
- user.Password = _password;
- user.Email = _email;
- user.DisplayName = string.IsNullOrWhiteSpace(_displayname) ? _username : _displayname;
- user.PhotoFileId = null;
- user.SuppressNotification = !bool.Parse(_notify);
-
- user = await UserService.AddUserAsync(user);
-
- if (user != null)
+ if (ValidateProfiles())
{
- await SettingService.UpdateUserSettingsAsync(settings, user.UserId);
- await logger.LogInformation("User Created {User}", user);
- NavigationManager.NavigateTo(NavigateUrl());
- }
- else
- {
- await logger.LogError("Error Adding User {Username} {Email}", _username, _email);
- AddModuleMessage(Localizer["Error.User.AddCheckPass"], MessageType.Error);
+ var user = new User();
+ user.SiteId = PageState.Site.SiteId;
+ user.Username = _username;
+ user.Password = _password;
+ user.Email = _email;
+ user.DisplayName = string.IsNullOrWhiteSpace(_displayname) ? _username : _displayname;
+ user.PhotoFileId = null;
+ user.SuppressNotification = !bool.Parse(_notify);
+
+ user = await UserService.AddUserAsync(user);
+
+ if (user != null)
+ {
+ await SettingService.UpdateUserSettingsAsync(settings, user.UserId);
+ await logger.LogInformation("User Created {User}", user);
+ NavigationManager.NavigateTo(NavigateUrl());
+ }
+ else
+ {
+ await logger.LogError("Error Adding User {Username} {Email}", _username, _email);
+ AddModuleMessage(Localizer["Error.User.AddCheckPass"], MessageType.Error);
+ }
}
}
else
@@ -194,7 +229,6 @@
private bool ValidateProfiles()
{
- bool valid = true;
foreach (Profile profile in profiles)
{
if (string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)) && !string.IsNullOrEmpty(profile.DefaultValue))
@@ -203,18 +237,24 @@
}
if (!profile.IsPrivate || UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin))
{
- if (valid == true && profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
+ if (profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
{
- valid = false;
+ AddModuleMessage(string.Format(SharedLocalizer["ProfileRequired"], profile.Title), MessageType.Warning);
+ return false;
}
- if (valid == true && !string.IsNullOrEmpty(profile.Validation))
+ if (!string.IsNullOrEmpty(profile.Validation))
{
Regex regex = new Regex(profile.Validation);
- valid = regex.Match(SettingService.GetSetting(settings, profile.Name, string.Empty)).Success;
+ bool valid = regex.Match(SettingService.GetSetting(settings, profile.Name, string.Empty)).Success;
+ if (!valid)
+ {
+ AddModuleMessage(string.Format(SharedLocalizer["ProfileInvalid"], profile.Title), MessageType.Warning);
+ return false;
+ }
}
}
}
- return valid;
+ return true;
}
private void ProfileChanged(ChangeEventArgs e, string SettingName)
diff --git a/Oqtane.Client/Modules/Admin/Users/Edit.razor b/Oqtane.Client/Modules/Admin/Users/Edit.razor
index 19fbbdd1..ea0198c9 100644
--- a/Oqtane.Client/Modules/Admin/Users/Edit.razor
+++ b/Oqtane.Client/Modules/Admin/Users/Edit.razor
@@ -125,13 +125,27 @@ else
}
else
{
- @if (p.IsRequired)
+ @if (p.Rows == 1)
{
-
ProfileChanged(e, p.Name))" />
+ @if (p.IsRequired)
+ {
+
ProfileChanged(e, p.Name))" />
+ }
+ else
+ {
+
ProfileChanged(e, p.Name))" />
+ }
}
else
{
-
ProfileChanged(e, p.Name))" />
+ @if (p.IsRequired)
+ {
+
+ }
+ else
+ {
+
+ }
}
}
@@ -240,35 +254,38 @@ else
{
try
{
- if (username != string.Empty && email != string.Empty && ValidateProfiles())
+ if (username != string.Empty && email != string.Empty)
{
if (_password == confirm)
{
- var user = await UserService.GetUserAsync(userid, PageState.Site.SiteId);
- user.SiteId = PageState.Site.SiteId;
- user.Username = username;
- user.Password = _password;
- user.Email = email;
- user.DisplayName = string.IsNullOrWhiteSpace(displayname) ? username : displayname;
- user.PhotoFileId = null;
- user.PhotoFileId = filemanager.GetFileId();
- if (user.PhotoFileId == -1)
+ if (ValidateProfiles())
{
+ var user = await UserService.GetUserAsync(userid, PageState.Site.SiteId);
+ user.SiteId = PageState.Site.SiteId;
+ user.Username = username;
+ user.Password = _password;
+ user.Email = email;
+ user.DisplayName = string.IsNullOrWhiteSpace(displayname) ? username : displayname;
user.PhotoFileId = null;
- }
+ user.PhotoFileId = filemanager.GetFileId();
+ if (user.PhotoFileId == -1)
+ {
+ user.PhotoFileId = null;
+ }
- user.IsDeleted = (isdeleted == null ? true : Boolean.Parse(isdeleted));
+ user.IsDeleted = (isdeleted == null ? true : Boolean.Parse(isdeleted));
- user = await UserService.UpdateUserAsync(user);
- if (user != null)
- {
- await SettingService.UpdateUserSettingsAsync(settings, user.UserId);
- await logger.LogInformation("User Saved {User}", user);
- NavigationManager.NavigateTo(NavigateUrl());
- }
- else
- {
- AddModuleMessage(Localizer["Message.Password.Complexity"], MessageType.Error);
+ user = await UserService.UpdateUserAsync(user);
+ if (user != null)
+ {
+ await SettingService.UpdateUserSettingsAsync(settings, user.UserId);
+ await logger.LogInformation("User Saved {User}", user);
+ NavigationManager.NavigateTo(NavigateUrl());
+ }
+ else
+ {
+ AddModuleMessage(Localizer["Message.Password.Complexity"], MessageType.Error);
+ }
}
}
else
@@ -290,7 +307,6 @@ else
private bool ValidateProfiles()
{
- bool valid = true;
foreach (Profile profile in profiles)
{
if (string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)) && !string.IsNullOrEmpty(profile.DefaultValue))
@@ -299,18 +315,24 @@ else
}
if (!profile.IsPrivate || UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin))
{
- if (valid == true && profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
+ if (profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
{
- valid = false;
+ AddModuleMessage(string.Format(SharedLocalizer["ProfileRequired"], profile.Title), MessageType.Warning);
+ return false;
}
- if (valid == true && !string.IsNullOrEmpty(profile.Validation))
+ if (!string.IsNullOrEmpty(profile.Validation))
{
Regex regex = new Regex(profile.Validation);
- valid = regex.Match(SettingService.GetSetting(settings, profile.Name, string.Empty)).Success;
+ bool valid = regex.Match(SettingService.GetSetting(settings, profile.Name, string.Empty)).Success;
+ if (!valid)
+ {
+ AddModuleMessage(string.Format(SharedLocalizer["ProfileInvalid"], profile.Title), MessageType.Warning);
+ return false;
+ }
}
}
}
- return valid;
+ return true;
}
private void ProfileChanged(ChangeEventArgs e, string SettingName)
diff --git a/Oqtane.Client/Modules/Admin/Users/Index.razor b/Oqtane.Client/Modules/Admin/Users/Index.razor
index 57f10221..4cd17e00 100644
--- a/Oqtane.Client/Modules/Admin/Users/Index.razor
+++ b/Oqtane.Client/Modules/Admin/Users/Index.razor
@@ -17,21 +17,10 @@ else
{
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+