diff --git a/Oqtane.Client/Modules/Admin/Languages/Add.razor b/Oqtane.Client/Modules/Admin/Languages/Add.razor
index b3c9c533..1c6324ac 100644
--- a/Oqtane.Client/Modules/Admin/Languages/Add.razor
+++ b/Oqtane.Client/Modules/Admin/Languages/Add.razor
@@ -350,7 +350,7 @@ else
var localizationCookieValue = CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture));
await interop.SetCookie(CookieRequestCultureProvider.DefaultCookieName, localizationCookieValue, 360);
- NavigationManager.NavigateTo(NavigationManager.Uri, forceLoad: true);
+ NavigationManager.NavigateTo(NavigationManager.Uri, true);
}
}
}
diff --git a/Oqtane.Client/Modules/Admin/Pages/Edit.razor b/Oqtane.Client/Modules/Admin/Pages/Edit.razor
index 04084d2b..6a118a62 100644
--- a/Oqtane.Client/Modules/Admin/Pages/Edit.razor
+++ b/Oqtane.Client/Modules/Admin/Pages/Edit.razor
@@ -152,13 +152,11 @@
-
}
-
+
@if(_pageModules != null)
{
@@ -169,10 +167,10 @@
@Localizer["ModuleDefinition"] |
- |
- |
+ |
+ |
@context.Title |
- @(context.ModuleDefinition.Name.Length > 0 ? context.ModuleDefinition.Name : context.ModuleDefinitionName) |
+ @context.ModuleDefinition.Name |
}
@@ -190,135 +188,131 @@
@code {
- public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
+ public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
- private ElementReference form;
- private bool validated = false;
- private List _themeList;
- private List _themes = new List();
- private List _containers = new List();
- private List _pageList;
- private List _pageModules;
- private int _pageId;
- private string _name;
- private string _title;
- private string _path;
- private string _currentparentid;
- private string _parentid = "-1";
- private string _insert = "=";
- private List _children;
- private int _childid = -1;
- private string _isnavigation;
- private string _isclickable;
- private string _url;
- private string _ispersonalizable;
- private string _themetype;
- private string _containertype = "-";
- private string _icon;
- private string _permissions = null;
- private string _createdby;
- private DateTime _createdon;
- private string _modifiedby;
- private DateTime _modifiedon;
- private string _deletedby;
- private DateTime? _deletedon;
- private PermissionGrid _permissionGrid;
- private Type _themeSettingsType;
- private object _themeSettings;
- private RenderFragment ThemeSettingsComponent { get; set; }
- private bool _refresh = false;
- protected Page page;
+ private ElementReference form;
+ private bool validated = false;
+ private List _themeList;
+ private List _themes = new List();
+ private List _containers = new List();
+ private List _pageList;
+ private List _pageModules;
+ private int _pageId;
+ private string _name;
+ private string _title;
+ private string _path;
+ private string _currentparentid;
+ private string _parentid = "-1";
+ private string _insert = "=";
+ private List _children;
+ private int _childid = -1;
+ private string _isnavigation;
+ private string _isclickable;
+ private string _url;
+ private string _ispersonalizable;
+ private string _themetype;
+ private string _containertype = "-";
+ private string _icon;
+ private string _permissions = null;
+ private string _createdby;
+ private DateTime _createdon;
+ private string _modifiedby;
+ private DateTime _modifiedon;
+ private string _deletedby;
+ private DateTime? _deletedon;
+ private PermissionGrid _permissionGrid;
+ private Type _themeSettingsType;
+ private object _themeSettings;
+ private RenderFragment ThemeSettingsComponent { get; set; }
+ private bool _refresh = false;
+ protected Page page;
- protected override async Task OnInitializedAsync()
- {
- try
- {
- _pageList = PageState.Pages;
- _children = PageState.Pages.Where(item => item.ParentId == null).ToList();
- _themeList = await ThemeService.GetThemesAsync();
- _themes = ThemeService.GetThemeControls(_themeList);
+ protected override async Task OnInitializedAsync()
+ {
+ try
+ {
+ _pageList = PageState.Pages;
+ _children = PageState.Pages.Where(item => item.ParentId == null).ToList();
+ _themeList = await ThemeService.GetThemesAsync();
+ _themes = ThemeService.GetThemeControls(_themeList);
- _pageId = Int32.Parse(PageState.QueryString["id"]);
- page = PageState.Pages.FirstOrDefault(item => item.PageId == _pageId);
+ _pageId = Int32.Parse(PageState.QueryString["id"]);
+ page = PageState.Pages.FirstOrDefault(item => item.PageId == _pageId);
- if (page != null)
- {
- _name = page.Name;
- _title = page.Title;
- _path = page.Path;
- _pageModules = PageState.Modules.Where(m => m.PageId == page.PageId && m.IsDeleted == false).ToList();
+ if (page != null)
+ {
+ _name = page.Name;
+ _title = page.Title;
+ _path = page.Path;
+ _pageModules = PageState.Modules.Where(m => m.PageId == page.PageId && m.IsDeleted == false).ToList();
- if (string.IsNullOrEmpty(_path))
- {
- _path = "/";
- }
- else
- {
- if (_path.Contains("/"))
- {
- _path = _path.Substring(_path.LastIndexOf("/") + 1);
- }
- }
+ if (string.IsNullOrEmpty(_path))
+ {
+ _path = "/";
+ }
+ else
+ {
+ if (_path.Contains("/"))
+ {
+ _path = _path.Substring(_path.LastIndexOf("/") + 1);
+ }
+ }
- if (page.ParentId == null)
- {
- _parentid = "-1";
- }
- else
- {
- _parentid = page.ParentId.ToString();
- }
+ if (page.ParentId == null)
+ {
+ _parentid = "-1";
+ }
+ else
+ {
+ _parentid = page.ParentId.ToString();
+ }
- _currentparentid = _parentid;
- _isnavigation = page.IsNavigation.ToString();
- _isclickable = page.IsClickable.ToString();
- _url = page.Url;
- _ispersonalizable = page.IsPersonalizable.ToString();
- _themetype = page.ThemeType;
- if (string.IsNullOrEmpty(_themetype))
- {
- _themetype = PageState.Site.DefaultThemeType;
- }
- _containers = ThemeService.GetContainerControls(_themeList, _themetype);
- _containertype = page.DefaultContainerType;
- if (string.IsNullOrEmpty(_containertype))
- {
- _containertype = PageState.Site.DefaultContainerType;
- }
- _icon = page.Icon;
- _permissions = page.Permissions;
- _createdby = page.CreatedBy;
- _createdon = page.CreatedOn;
- _modifiedby = page.ModifiedBy;
- _modifiedon = page.ModifiedOn;
- _deletedby = page.DeletedBy;
- _deletedon = page.DeletedOn;
+ _currentparentid = _parentid;
+ _isnavigation = page.IsNavigation.ToString();
+ _isclickable = page.IsClickable.ToString();
+ _url = page.Url;
+ _ispersonalizable = page.IsPersonalizable.ToString();
+ _themetype = page.ThemeType;
+ if (string.IsNullOrEmpty(_themetype))
+ {
+ _themetype = PageState.Site.DefaultThemeType;
+ }
+ _containers = ThemeService.GetContainerControls(_themeList, _themetype);
+ _containertype = page.DefaultContainerType;
+ if (string.IsNullOrEmpty(_containertype))
+ {
+ _containertype = PageState.Site.DefaultContainerType;
+ }
+ _icon = page.Icon;
+ _permissions = page.Permissions;
+ _createdby = page.CreatedBy;
+ _createdon = page.CreatedOn;
+ _modifiedby = page.ModifiedBy;
+ _modifiedon = page.ModifiedOn;
+ _deletedby = page.DeletedBy;
+ _deletedon = page.DeletedOn;
- ThemeSettings();
- }
- }
- catch (Exception ex)
- {
- await logger.LogError(ex, "Error Loading Page {PageId} {Error}", _pageId, ex.Message);
- AddModuleMessage(Localizer["Error.Page.Load"], MessageType.Error);
- }
- }
+ ThemeSettings();
+ }
+ }
+ catch (Exception ex)
+ {
+ await logger.LogError(ex, "Error Loading Page {PageId} {Error}", _pageId, ex.Message);
+ AddModuleMessage(Localizer["Error.Page.Load"], MessageType.Error);
+ }
+ }
- protected void LoadModuleSettings(Module module)
- {
- NavigationManager.NavigateTo(EditUrl(module.ModuleId, "Settings"));
- }
-
- private async Task DeleteModule(Module module)
- {
- try
- {
- PageModule pagemodule = await PageModuleService.GetPageModuleAsync(page.PageId,module.ModuleId);
- pagemodule.IsDeleted = true;
-
- await PageModuleService.UpdatePageModuleAsync(pagemodule);
- await logger.LogInformation(LogFunction.Update,"Module Deleted {Title}", module.Title);
- NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, true));
+ private async Task DeleteModule(Module module)
+ {
+ try
+ {
+ PageModule pagemodule = await PageModuleService.GetPageModuleAsync(page.PageId, module.ModuleId);
+ pagemodule.IsDeleted = true;
+ await PageModuleService.UpdatePageModuleAsync(pagemodule);
+ await logger.LogInformation(LogFunction.Update,"Module Deleted {Title}", module.Title);
+ _pageModules.RemoveAll(item => item.PageModuleId == pagemodule.PageModuleId);
+ StateHasChanged();
+ NavigationManager.NavigateTo(NavigationManager.Uri + "&tab=PageModules");
}
catch (Exception ex)
{
diff --git a/Oqtane.Client/Modules/Admin/RecycleBin/Index.razor b/Oqtane.Client/Modules/Admin/RecycleBin/Index.razor
index e70165b9..75273207 100644
--- a/Oqtane.Client/Modules/Admin/RecycleBin/Index.razor
+++ b/Oqtane.Client/Modules/Admin/RecycleBin/Index.razor
@@ -25,7 +25,7 @@
@Localizer["DeletedOn"] |
- |
+ |
|
@context.Name |
@context.DeletedBy |
@@ -34,9 +34,7 @@
@if (_pages.Any())
{
-
+
}
}
@@ -58,7 +56,7 @@
@Localizer["DeletedOn"] |
- |
+ |
|
@PageState.Pages.Find(item => item.PageId == context.PageId).Name |
@context.Title |
@@ -68,9 +66,7 @@
@if (_modules.Any())
{
-
+
}
}
diff --git a/Oqtane.Client/Modules/Admin/Users/Index.razor b/Oqtane.Client/Modules/Admin/Users/Index.razor
index a661c325..c56c440a 100644
--- a/Oqtane.Client/Modules/Admin/Users/Index.razor
+++ b/Oqtane.Client/Modules/Admin/Users/Index.razor
@@ -23,7 +23,7 @@ else
-
+
diff --git a/Oqtane.Client/Modules/Controls/ActionDialog.razor b/Oqtane.Client/Modules/Controls/ActionDialog.razor
index 5cda1386..4e21b91a 100644
--- a/Oqtane.Client/Modules/Controls/ActionDialog.razor
+++ b/Oqtane.Client/Modules/Controls/ActionDialog.razor
@@ -17,7 +17,7 @@
@@ -30,16 +30,17 @@
{
if (Disabled)
{
-
+
}
else
{
-
+
}
}
@code {
private bool _visible = false;
+ private string _permissions = string.Empty;
private bool _editmode = false;
private bool _authorized = false;
private string _iconSpan = string.Empty;
@@ -59,6 +60,9 @@
[Parameter]
public SecurityAccessLevel? Security { get; set; } // optional - can be used to explicitly specify SecurityAccessLevel
+ [Parameter]
+ public string Permissions { get; set; } // optional - can be used to specify a permission string
+
[Parameter]
public string Class { get; set; } // optional
@@ -105,6 +109,7 @@
Header = Localize(nameof(Header), Header);
Message = Localize(nameof(Message), Message);
+ _permissions = (string.IsNullOrEmpty(Permissions)) ? ModuleState.Permissions : Permissions;
_authorized = IsAuthorized();
}
@@ -138,10 +143,10 @@
authorized = true;
break;
case SecurityAccessLevel.View:
- authorized = UserSecurity.IsAuthorized(PageState.User,PermissionNames.View, ModuleState.Permissions);
+ authorized = UserSecurity.IsAuthorized(PageState.User,PermissionNames.View, _permissions);
break;
case SecurityAccessLevel.Edit:
- authorized = UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, ModuleState.Permissions);
+ authorized = UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, _permissions);
break;
case SecurityAccessLevel.Admin:
authorized = UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin);
diff --git a/Oqtane.Client/Modules/Controls/ActionLink.razor b/Oqtane.Client/Modules/Controls/ActionLink.razor
index cf2cd1df..0ba0dfbe 100644
--- a/Oqtane.Client/Modules/Controls/ActionLink.razor
+++ b/Oqtane.Client/Modules/Controls/ActionLink.razor
@@ -6,101 +6,118 @@
{
if (Disabled)
{
-
- }
- else
- {
- @((MarkupString)_iconSpan) @_text
- }
+
+ }
+ else
+ {
+ if (OnClick == null)
+ {
+ @((MarkupString)_iconSpan) @_text
+ }
+ else
+ {
+
+ }
+ }
}
@code {
- private string _text = string.Empty;
- private string _url = string.Empty;
- private string _parameters = string.Empty;
- private string _classname = "btn btn-primary";
- private string _style = string.Empty;
- private bool _editmode = false;
- private bool _authorized = false;
- private string _iconSpan = string.Empty;
+ private string _text = string.Empty;
+ private string _parameters = string.Empty;
+ private string _url = string.Empty;
+ private string _permissions = string.Empty;
+ private bool _editmode = false;
+ private bool _authorized = false;
+ private string _classname = "btn btn-primary";
+ private string _style = string.Empty;
+ private string _iconSpan = string.Empty;
- [Parameter]
- public string Action { get; set; } // required
+ [Parameter]
+ public string Action { get; set; } // required
- [Parameter]
- public SecurityAccessLevel? Security { get; set; } // optional - can be used to explicitly specify SecurityAccessLevel
+ [Parameter]
+ public string Text { get; set; } // optional - defaults to Action if not specified
- [Parameter]
- public string Text { get; set; } // optional - defaults to Action if not specified
+ [Parameter]
+ public string Parameters { get; set; } // optional - querystring parameters should be in the form of "id=x&name=y"
- [Parameter]
- public string Parameters { get; set; } // optional - querystring parameter should be in the form of "id=x&name=y"
+ [Parameter]
+ public int ModuleId { get; set; } = -1; // optional - allows the link to target a specific moduleid
- [Parameter]
- public string Class { get; set; } // optional - defaults to primary if not specified
+ [Parameter]
+ public Action OnClick { get; set; } = null; // optional - executes a method in the calling component
- [Parameter]
- public string Style { get; set; } // optional
+ [Parameter]
+ public SecurityAccessLevel? Security { get; set; } // optional - can be used to explicitly specify SecurityAccessLevel
- [Parameter]
- public bool Disabled { get; set; } // optional
+ [Parameter]
+ public string Permissions { get; set; } // optional - can be used to specify a permission string
- [Parameter]
- public string EditMode { get; set; } // optional - specifies if an authorized user must be in edit mode to see the action - default is false.
+ [Parameter]
+ public bool Disabled { get; set; } // optional
- [Parameter]
- public string IconName { get; set; } // optional - specifies an icon for the link - default is no icon
+ [Parameter]
+ public string EditMode { get; set; } // optional - specifies if an authorized user must be in edit mode to see the action - default is false.
- [Parameter]
- public bool IconOnly { get; set; } // optional - specifies only icon in link
+ [Parameter]
+ public string Class { get; set; } // optional - defaults to primary if not specified
- protected override void OnParametersSet()
- {
- base.OnParametersSet();
+ [Parameter]
+ public string Style { get; set; } // optional
- _text = Action;
- if (!string.IsNullOrEmpty(Text))
- {
- _text = Text;
- }
+ [Parameter]
+ public string IconName { get; set; } // optional - specifies an icon for the link - default is no icon
- if (IconOnly && !string.IsNullOrEmpty(IconName))
- {
- _text = string.Empty;
- }
+ [Parameter]
+ public bool IconOnly { get; set; } // optional - specifies only icon in link
- if (!string.IsNullOrEmpty(Parameters))
- {
- _parameters = Parameters;
- }
+ protected override void OnParametersSet()
+ {
+ base.OnParametersSet();
- if (!string.IsNullOrEmpty(Class))
- {
- _classname = Class;
- }
+ _text = Action;
+ if (!string.IsNullOrEmpty(Text))
+ {
+ _text = Text;
+ }
- if (!string.IsNullOrEmpty(Style))
- {
- _style = Style;
- }
+ if (IconOnly && !string.IsNullOrEmpty(IconName))
+ {
+ _text = string.Empty;
+ }
- if (!string.IsNullOrEmpty(EditMode))
- {
- _editmode = bool.Parse(EditMode);
- }
+ if (!string.IsNullOrEmpty(Parameters))
+ {
+ _parameters = Parameters;
+ }
- if (!string.IsNullOrEmpty(IconName))
- {
- if (!IconName.Contains(" "))
- {
- IconName = "oi oi-" + IconName;
- }
- _iconSpan = $"{(IconOnly ? "" : " ")}";
+ if (!string.IsNullOrEmpty(Class))
+ {
+ _classname = Class;
+ }
- }
+ if (!string.IsNullOrEmpty(Style))
+ {
+ _style = Style;
+ }
- _text = Localize(nameof(Text), _text);
- _url = EditUrl(Action, _parameters);
+ if (!string.IsNullOrEmpty(EditMode))
+ {
+ _editmode = bool.Parse(EditMode);
+ }
+
+ if (!string.IsNullOrEmpty(IconName))
+ {
+ if (!IconName.Contains(" "))
+ {
+ IconName = "oi oi-" + IconName;
+ }
+ _iconSpan = $"{(IconOnly ? "" : " ")}";
+ }
+
+ _permissions = (string.IsNullOrEmpty(Permissions)) ? ModuleState.Permissions : Permissions;
+ _text = Localize(nameof(Text), _text);
+ _url = (ModuleId == -1) ? EditUrl(Action, _parameters) : EditUrl(ModuleId, Action, _parameters);
_authorized = IsAuthorized();
}
@@ -136,10 +153,10 @@
authorized = true;
break;
case SecurityAccessLevel.View:
- authorized = UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, ModuleState.Permissions);
+ authorized = UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, _permissions);
break;
case SecurityAccessLevel.Edit:
- authorized = UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, ModuleState.Permissions);
+ authorized = UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, _permissions);
break;
case SecurityAccessLevel.Admin:
authorized = UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin);
diff --git a/Oqtane.Client/Modules/Controls/TabStrip.razor b/Oqtane.Client/Modules/Controls/TabStrip.razor
index 2d423818..b9f24956 100644
--- a/Oqtane.Client/Modules/Controls/TabStrip.razor
+++ b/Oqtane.Client/Modules/Controls/TabStrip.razor
@@ -43,16 +43,12 @@
[Parameter]
public bool Refresh { get; set; } // optional - used in scenarios where TabPanels are added/removed dynamically within a parent form. ActiveTab may need to be reset as well when this property is used.
- protected override void OnInitialized()
+ protected override void OnParametersSet()
{
if (PageState.QueryString.ContainsKey("tab"))
{
ActiveTab = PageState.QueryString["tab"];
}
- }
-
- protected override void OnParametersSet()
- {
if (_tabPanels == null || Refresh)
{
_tabPanels = new List();
diff --git a/Oqtane.Client/Modules/ModuleBase.cs b/Oqtane.Client/Modules/ModuleBase.cs
index 5691a4f2..30adc2a1 100644
--- a/Oqtane.Client/Modules/ModuleBase.cs
+++ b/Oqtane.Client/Modules/ModuleBase.cs
@@ -136,7 +136,12 @@ namespace Oqtane.Modules
public string ImageUrl(int fileid, int width, int height, string mode)
{
- return Utilities.ImageUrl(PageState.Alias, fileid, width, height, mode);
+ return ImageUrl(fileid, width, height, mode, 0);
+ }
+
+ public string ImageUrl(int fileid, int width, int height, string mode, int rotate)
+ {
+ return Utilities.ImageUrl(PageState.Alias, fileid, width, height, mode, rotate);
}
public virtual Dictionary GetUrlParameters(string parametersTemplate = "")
diff --git a/Oqtane.Client/Resources/Modules/Admin/Pages/Edit.resx b/Oqtane.Client/Resources/Modules/Admin/Pages/Edit.resx
index 45cfb0b2..39fde0cc 100644
--- a/Oqtane.Client/Resources/Modules/Admin/Pages/Edit.resx
+++ b/Oqtane.Client/Resources/Modules/Admin/Pages/Edit.resx
@@ -1,4 +1,4 @@
-
+
diff --git a/Oqtane.Server/Pages/_Host.cshtml.cs b/Oqtane.Server/Pages/_Host.cshtml.cs
index 6fa559ca..bb3f75c4 100644
--- a/Oqtane.Server/Pages/_Host.cshtml.cs
+++ b/Oqtane.Server/Pages/_Host.cshtml.cs
@@ -40,6 +40,7 @@ namespace Oqtane.Pages
public RenderMode RenderMode = RenderMode.Server;
public string HeadResources = "";
public string BodyResources = "";
+ public string Title = "";
public void OnGet()
{
@@ -80,6 +81,7 @@ namespace Oqtane.Pages
{
RenderMode = (RenderMode)Enum.Parse(typeof(RenderMode), site.RenderMode, true);
}
+ Title = site.Name;
}
// if culture not specified
diff --git a/Oqtane.Server/wwwroot/favicon.ico b/Oqtane.Server/wwwroot/favicon.ico
index 0e569015..550d600e 100644
Binary files a/Oqtane.Server/wwwroot/favicon.ico and b/Oqtane.Server/wwwroot/favicon.ico differ
diff --git a/Oqtane.Server/wwwroot/oqtane.ico b/Oqtane.Server/wwwroot/oqtane.ico
new file mode 100644
index 00000000..0e569015
Binary files /dev/null and b/Oqtane.Server/wwwroot/oqtane.ico differ
diff --git a/Oqtane.Shared/Shared/Utilities.cs b/Oqtane.Shared/Shared/Utilities.cs
index aee8b568..1ac3f900 100644
--- a/Oqtane.Shared/Shared/Utilities.cs
+++ b/Oqtane.Shared/Shared/Utilities.cs
@@ -113,9 +113,14 @@ namespace Oqtane.Shared
}
public static string ImageUrl(Alias alias, int fileId, int width, int height, string mode)
+ {
+ return ImageUrl(alias, fileId, width, height, mode, 0);
+ }
+
+ public static string ImageUrl(Alias alias, int fileId, int width, int height, string mode, int rotate)
{
var aliasUrl = (alias != null && !string.IsNullOrEmpty(alias.Path)) ? "/" + alias.Path : "";
- return $"{aliasUrl}{Constants.ImageUrl}{fileId}/{width}/{height}/{mode}";
+ return $"{aliasUrl}{Constants.ImageUrl}{fileId}/{width}/{height}/{mode}/{rotate}";
}
public static string TenantUrl(Alias alias, string url)