ability to specify PageTemplates for modules

This commit is contained in:
sbwalker
2023-05-30 15:52:27 -04:00
parent 30cb8ec9c3
commit 0d5c3a3a0c
13 changed files with 366 additions and 165 deletions

View File

@ -35,6 +35,8 @@ namespace Oqtane.Models
Runtimes = "";
Template = "";
Resources = null;
IsAutoEnabled = true;
PageTemplates = null;
}
/// <summary>
@ -111,7 +113,10 @@ namespace Oqtane.Models
public List<Resource> Resources { get; set; } // added in 4.0.0
[NotMapped]
public bool IsAutoEnabled { get; set; } = true; // added in 4.0.0
public bool IsAutoEnabled { get; set; } // added in 4.0.0
[NotMapped]
public List<PageTemplate> PageTemplates { get; set; } // added in 4.0.0
// internal properties
[NotMapped]

View File

@ -21,6 +21,12 @@ namespace Oqtane.Models
/// </summary>
public int SiteId { get; set; }
/// <summary>
/// Path of the page.
/// TODO: todoc relative to what? site root, parent-page, domain?
/// </summary>
public string Path { get; set; }
/// <summary>
/// Reference to the parent <see cref="Page"/> if it has one.
/// </summary>
@ -36,13 +42,7 @@ namespace Oqtane.Models
/// Page Title which is shown in the browser tab.
/// </summary>
public string Title { get; set; }
/// <summary>
/// Path of the page.
/// TODO: todoc relative to what? site root, parent-page, domain?
/// </summary>
public string Path { get; set; }
/// <summary>
/// Sort order in the list of other sibling pages
/// </summary>

View File

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json;
using Oqtane.Shared;
namespace Oqtane.Models
{
@ -13,16 +13,59 @@ namespace Oqtane.Models
public class PageTemplate
{
public string Name { get; set; }
public string Parent { get; set; }
public int Order { get; set; }
public PageTemplate()
{
Url = "";
Name = "";
Parent = "";
Title = "";
Path = "";
Order = 1;
ThemeType = "";
DefaultContainerType = "";
HeadContent = "";
BodyContent = "";
Icon = "";
IsNavigation = true;
IsClickable = true;
IsPersonalizable = false;
IsDeleted = false;
PermissionList = new List<Permission>()
{
new Permission(PermissionNames.View, RoleNames.Admin, true),
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
};
PageTemplateModules = new List<PageTemplateModule>();
// properties used by IModule
AliasName = "*";
Version = "*";
Update = false;
}
public string Path { get; set; }
public string Parent { get; set; }
public string Name { get; set; }
public string Title { get; set; }
public int Order { get; set; }
public string Url { get; set; }
public string ThemeType { get; set; }
public string DefaultContainerType { get; set; }
public string HeadContent { get; set; }
public string BodyContent { get; set; }
public string Icon { get; set; }
public bool IsNavigation { get; set; }
public bool IsClickable { get; set; }
public bool IsPersonalizable { get; set; }
public bool IsDeleted { get; set; }
public List<Permission> PermissionList { get; set; }
public List<PageTemplateModule> PageTemplateModules { get; set; }
// properties used by IModule
public string AliasName { get; set; }
public string Version { get; set; }
public bool Update { get; set; }
[Obsolete("This property is obsolete", false)]
public bool EditMode { get; set; }
@ -42,9 +85,28 @@ namespace Oqtane.Models
public class PageTemplateModule
{
public PageTemplateModule()
{
ModuleDefinitionName = "";
Title = "";
Pane = PaneNames.Default;
Order = 1;
ContainerType = "";
IsDeleted = false;
PermissionList = new List<Permission>()
{
new Permission(PermissionNames.View, RoleNames.Admin, true),
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
};
Content = "";
}
public string ModuleDefinitionName { get; set; }
public string Title { get; set; }
public string Pane { get; set; }
public int Order { get; set; }
public string ContainerType { get; set; }
public bool IsDeleted { get; set; }
public List<Permission> PermissionList { get; set; }
public string Content { get; set; }