more changes to support Default pane
This commit is contained in:
@ -582,9 +582,9 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (PageState.Page.Panes.Count != 0)
|
if (PageState.Page.Panes.FindIndex(item => item.Equals(PaneNames.Default, StringComparison.OrdinalIgnoreCase)) != -1)
|
||||||
{
|
{
|
||||||
_pane = PageState.Page.Panes[0];
|
_pane = PaneNames.Default;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -16,13 +16,6 @@
|
|||||||
<Pane Name="@PaneNames.Default" />
|
<Pane Name="@PaneNames.Default" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<Pane Name="@PaneNames.Admin" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<Pane Name="Top Full Width" />
|
<Pane Name="Top Full Width" />
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@ -115,7 +108,7 @@
|
|||||||
@code {
|
@code {
|
||||||
public override string Name => "Default Theme";
|
public override string Name => "Default Theme";
|
||||||
|
|
||||||
public override string Panes => PaneNames.Default + ",Top Full Width,Top 100%,Left 50%,Right 50%,Left 33%,Center 33%,Right 33%,Left Outer 25%,Left Inner 25%,Right Inner 25%,Right Outer 25%,Left 25%,Center 50%,Right 25%,Left Sidebar 66%,Right Sidebar 33%,Left Sidebar 33%,Right Sidebar 66%,Bottom 100%,Bottom Full Width,Footer," + PaneNames.Admin;
|
public override string Panes => PaneNames.Default + ",Top Full Width,Top 100%,Left 50%,Right 50%,Left 33%,Center 33%,Right 33%,Left Outer 25%,Left Inner 25%,Right Inner 25%,Right Outer 25%,Left 25%,Center 50%,Right 25%,Left Sidebar 66%,Right Sidebar 33%,Left Sidebar 33%,Right Sidebar 66%,Bottom 100%,Bottom Full Width,Footer";
|
||||||
|
|
||||||
public override List<Resource> Resources => new List<Resource>()
|
public override List<Resource> Resources => new List<Resource>()
|
||||||
{
|
{
|
||||||
|
@ -45,8 +45,18 @@ else
|
|||||||
{
|
{
|
||||||
if (PageState.ModuleId != -1 && PageState.Action != Constants.DefaultAction)
|
if (PageState.ModuleId != -1 && PageState.Action != Constants.DefaultAction)
|
||||||
{
|
{
|
||||||
// an admin pane is required in every theme so that module controls can be rendered in a specific location
|
// action route needs to inject module control into specific pane
|
||||||
if (Name.ToLower() == PaneNames.Admin.ToLower())
|
string pane = "";
|
||||||
|
if (PageState.Page.Panes.FindIndex(item => item.Equals(PaneNames.Default, StringComparison.OrdinalIgnoreCase)) != -1)
|
||||||
|
{
|
||||||
|
pane = PaneNames.Default;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pane = PaneNames.Admin;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (Name.ToLower() == pane.ToLower())
|
||||||
{
|
{
|
||||||
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
|
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
|
||||||
if (module != null)
|
if (module != null)
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
@if (!string.IsNullOrEmpty(_error))
|
@if (!string.IsNullOrEmpty(_error))
|
||||||
{
|
{
|
||||||
<ModuleMessage Message="@_error" Type="@MessageType.Error" />
|
<ModuleMessage Message="@_error" Type="@MessageType.Warning" />
|
||||||
}
|
}
|
||||||
|
|
||||||
@DynamicComponent
|
@DynamicComponent
|
||||||
@ -359,9 +359,9 @@
|
|||||||
if (!string.IsNullOrEmpty(panes))
|
if (!string.IsNullOrEmpty(panes))
|
||||||
{
|
{
|
||||||
page.Panes = panes.Replace(";", ",").Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
page.Panes = panes.Replace(";", ",").Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||||
if (!page.Panes.Contains(PaneNames.Admin))
|
if (!page.Panes.Contains(PaneNames.Default) && !page.Panes.Contains(PaneNames.Admin))
|
||||||
{
|
{
|
||||||
_error = "The Current Theme Does Not Contain An Admin Pane";
|
_error = "The Current Theme Does Not Contain A Default Or Admin Pane";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -460,11 +460,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure module's pane exists in current page and if not, fallback to the admin pane
|
// validate that module's pane exists in current page
|
||||||
if (page.Panes.FindIndex(item => item.Equals(module.Pane, StringComparison.OrdinalIgnoreCase)) == -1)
|
if (page.Panes.FindIndex(item => item.Equals(module.Pane, StringComparison.OrdinalIgnoreCase)) == -1)
|
||||||
|
{
|
||||||
|
// fallback to default pane if it exists
|
||||||
|
if (page.Panes.FindIndex(item => item.Equals(PaneNames.Default, StringComparison.OrdinalIgnoreCase)) != -1)
|
||||||
|
{
|
||||||
|
module.Pane = PaneNames.Default;
|
||||||
|
}
|
||||||
|
else // otherwise admin pane (legacy)
|
||||||
{
|
{
|
||||||
module.Pane = PaneNames.Admin;
|
module.Pane = PaneNames.Admin;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// calculate module position within pane
|
// calculate module position within pane
|
||||||
if (paneindex.ContainsKey(module.Pane.ToLower()))
|
if (paneindex.ContainsKey(module.Pane.ToLower()))
|
||||||
|
Reference in New Issue
Block a user