Merge branch 'oqtane:dev' into dev
This commit is contained in:
@ -12,6 +12,9 @@ using Oqtane.Infrastructure;
|
||||
using Oqtane.Repository;
|
||||
using Oqtane.Modules.Admin.Users;
|
||||
using System.IO;
|
||||
using Oqtane.Services;
|
||||
using Oqtane.UI;
|
||||
using System;
|
||||
|
||||
namespace Oqtane.Controllers
|
||||
{
|
||||
@ -180,9 +183,9 @@ namespace Oqtane.Controllers
|
||||
page = new Page();
|
||||
page.SiteId = parent.SiteId;
|
||||
page.ParentId = parent.PageId;
|
||||
page.Name = user.Username;
|
||||
page.Path = parent.Path + "/" + page.Name;
|
||||
page.Title = parent.Name + " - " + page.Name;
|
||||
page.Name = user.DisplayName;
|
||||
page.Path = parent.Path + "/" + Utilities.GetFriendlyUrl(page.Name);
|
||||
page.Title = page.Name + " - " + parent.Name;
|
||||
page.Order = 0;
|
||||
page.IsNavigation = false;
|
||||
page.Url = "";
|
||||
@ -263,14 +266,18 @@ namespace Oqtane.Controllers
|
||||
// save url mapping if page path changed
|
||||
if (currentPage.Path != page.Path)
|
||||
{
|
||||
var urlMapping = new UrlMapping();
|
||||
urlMapping.SiteId = page.SiteId;
|
||||
urlMapping.Url = currentPage.Path;
|
||||
urlMapping.MappedUrl = page.Path;
|
||||
urlMapping.Requests = 0;
|
||||
urlMapping.CreatedOn = System.DateTime.UtcNow;
|
||||
urlMapping.RequestedOn = System.DateTime.UtcNow;
|
||||
_urlMappings.AddUrlMapping(urlMapping);
|
||||
var urlMapping = _urlMappings.GetUrlMapping(page.SiteId, currentPage.Path);
|
||||
if (urlMapping == null)
|
||||
{
|
||||
urlMapping = new UrlMapping();
|
||||
urlMapping.SiteId = page.SiteId;
|
||||
urlMapping.Url = currentPage.Path;
|
||||
urlMapping.MappedUrl = page.Path;
|
||||
urlMapping.Requests = 0;
|
||||
urlMapping.CreatedOn = System.DateTime.UtcNow;
|
||||
urlMapping.RequestedOn = System.DateTime.UtcNow;
|
||||
_urlMappings.AddUrlMapping(urlMapping);
|
||||
}
|
||||
}
|
||||
|
||||
// get differences between current and new page permissions
|
||||
@ -314,6 +321,16 @@ namespace Oqtane.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
// update child paths
|
||||
if (page.ParentId != currentPage.ParentId)
|
||||
{
|
||||
foreach (Page _page in _pages.GetPages(page.SiteId).Where(item => item.Path.StartsWith(currentPage.Path)).ToList())
|
||||
{
|
||||
_page.Path = _page.Path.Replace(currentPage.Path, page.Path);
|
||||
_pages.UpdatePage(_page);
|
||||
}
|
||||
}
|
||||
|
||||
_syncManager.AddSyncEvent(_alias.TenantId, EntityNames.Page, page.PageId, SyncEventActions.Update);
|
||||
_syncManager.AddSyncEvent(_alias.TenantId, EntityNames.Site, page.SiteId, SyncEventActions.Refresh);
|
||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Page Updated {Page}", page);
|
||||
|
@ -246,7 +246,7 @@ namespace Oqtane.Controllers
|
||||
foreach (Page child in children)
|
||||
{
|
||||
child.Level = level + 1;
|
||||
child.HasChildren = pages.Any(item => item.ParentId == child.PageId);
|
||||
child.HasChildren = pages.Any(item => item.ParentId == child.PageId && !item.IsDeleted);
|
||||
hierarchy.Add(child);
|
||||
getPath(pageList, child);
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ namespace Oqtane.Pages
|
||||
}
|
||||
|
||||
var site = _sites.InitializeSite(alias);
|
||||
if (site != null && !site.IsDeleted && site.Runtime != "Hybrid")
|
||||
if (site != null && (!site.IsDeleted || url.Contains("admin/site")) && site.Runtime != "Hybrid")
|
||||
{
|
||||
Route route = new Route(url, alias.Path);
|
||||
|
||||
|
Reference in New Issue
Block a user