Merge pull request #486 from sbwalker/master
added ability to set default container at the page level, expanded size of role description in upgrade script for 0.9.2
This commit is contained in:
		| @ -24,7 +24,7 @@ | ||||
|                     </td> | ||||
|                     <td> | ||||
|                         <select id="container" class="form-control" @bind="@_containerType"> | ||||
|                             <option value=""><Select Container></option> | ||||
|                             <option value="-"><Inherit From Page Or Site></option> | ||||
|                             @foreach (KeyValuePair<string, string> container in _containers) | ||||
|                             { | ||||
|                                 <option value="@container.Key">@container.Value</option> | ||||
| @ -107,6 +107,14 @@ | ||||
|         _title = ModuleState.Title; | ||||
|         _containers = ThemeService.GetContainerTypes(await ThemeService.GetThemesAsync()); | ||||
|         _containerType = ModuleState.ContainerType; | ||||
|         if (!string.IsNullOrEmpty(PageState.Page.DefaultContainerType) && _containerType == PageState.Page.DefaultContainerType) | ||||
|         { | ||||
|             _containerType = "-"; | ||||
|         } | ||||
|         if (_containerType == PageState.Site.DefaultContainerType) | ||||
|         { | ||||
|             _containerType = "-"; | ||||
|         } | ||||
|         _allPages = ModuleState.AllPages.ToString(); | ||||
|         _permissions = ModuleState.Permissions; | ||||
|         _permissionNames = ModuleState.ModuleDefinition.PermissionNames; | ||||
| @ -136,7 +144,15 @@ | ||||
|         var pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId); | ||||
|         pagemodule.PageId = int.Parse(_pageId); | ||||
|         pagemodule.Title = _title; | ||||
|         pagemodule.ContainerType = _containerType; | ||||
|         pagemodule.ContainerType = (_containerType != "-") ? _containerType : string.Empty; | ||||
|         if (!string.IsNullOrEmpty(pagemodule.ContainerType) && pagemodule.ContainerType == PageState.Page.DefaultContainerType) | ||||
|         { | ||||
|             pagemodule.ContainerType = string.Empty; | ||||
|         } | ||||
|         if (!string.IsNullOrEmpty(pagemodule.ContainerType) && pagemodule.ContainerType == PageState.Site.DefaultContainerType) | ||||
|         { | ||||
|             pagemodule.ContainerType = string.Empty; | ||||
|         } | ||||
|         await PageModuleService.UpdatePageModuleAsync(pagemodule); | ||||
|         await PageModuleService.UpdatePageModuleOrderAsync(pagemodule.PageId, pagemodule.Pane); | ||||
|  | ||||
|  | ||||
| @ -101,7 +101,7 @@ | ||||
|                         </td> | ||||
|                         <td> | ||||
|                             <select id="Theme" class="form-control" @onchange="(e => ThemeChanged(e))"> | ||||
|                                 <option value="-"><Select Theme></option> | ||||
|                                 <option value="-"><Inherit From Site></option> | ||||
|                                 @foreach (KeyValuePair<string, string> item in _themes) | ||||
|                                 { | ||||
|                                     if (item.Key == _themetype) | ||||
| @ -122,7 +122,7 @@ | ||||
|                         </td> | ||||
|                         <td> | ||||
|                             <select id="Layout" class="form-control" @bind="@_layouttype"> | ||||
|                                 <option value="-"><Select Layout></option> | ||||
|                                 <option value="-"><Inherit From Site></option> | ||||
|                                 @foreach (KeyValuePair<string, string> panelayout in _panelayouts) | ||||
|                                 { | ||||
|                                     if (panelayout.Key == _layouttype) | ||||
| @ -137,6 +137,20 @@ | ||||
|                             </select> | ||||
|                         </td> | ||||
|                     </tr> | ||||
|                     <tr> | ||||
|                         <td> | ||||
|                             <Label For="defaultContainer" HelpText="Select the default container for the page">Default Container: </Label> | ||||
|                         </td> | ||||
|                         <td> | ||||
|                             <select id="defaultContainer" class="form-control" @bind="@_containertype"> | ||||
|                                 <option value="-"><Inherit From Site></option> | ||||
|                                 @foreach (KeyValuePair<string, string> container in _containers) | ||||
|                                 { | ||||
|                                     <option value="@container.Key">@container.Value</option> | ||||
|                                 } | ||||
|                             </select> | ||||
|                         </td> | ||||
|                     </tr> | ||||
|                     <tr> | ||||
|                         <td> | ||||
|                             <Label For="Icon" HelpText="Optionally provide an icon for this page which will be displayed in the site navigation">Icon: </Label> | ||||
| @ -187,6 +201,7 @@ | ||||
| @code { | ||||
|     private Dictionary<string, string> _themes; | ||||
|     private Dictionary<string, string> _panelayouts; | ||||
|     private Dictionary<string, string> _containers = new Dictionary<string, string>(); | ||||
|     private List<Theme> _themeList; | ||||
|     private List<Page> _pageList; | ||||
|     private string _name; | ||||
| @ -202,6 +217,7 @@ | ||||
|     private string _mode = "view"; | ||||
|     private string _themetype = "-"; | ||||
|     private string _layouttype = "-"; | ||||
|     private string _containertype = "-"; | ||||
|     private string _icon = string.Empty; | ||||
|     private string _permissions = string.Empty; | ||||
|     private PermissionGrid _permissionGrid; | ||||
| @ -216,11 +232,9 @@ | ||||
|             _pageList = PageState.Pages; | ||||
|             _children = PageState.Pages.Where(item => item.ParentId == null).ToList(); | ||||
|  | ||||
|             _themetype = PageState.Site.DefaultThemeType; | ||||
|             _layouttype = PageState.Site.DefaultLayoutType; | ||||
|  | ||||
|             _themes = ThemeService.GetThemeTypes(_themeList); | ||||
|             _panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype); | ||||
|             _containers = ThemeService.GetContainerTypes(_themeList); | ||||
|  | ||||
|             _permissions = string.Empty; | ||||
|         } | ||||
| @ -351,16 +365,20 @@ | ||||
|                 page.Url = _url; | ||||
|                 page.EditMode = (_mode == "edit" ? true : false); | ||||
|                 page.ThemeType = (_themetype != "-") ? _themetype : string.Empty; | ||||
|                 page.LayoutType = (_layouttype != "-") ? _layouttype : string.Empty; | ||||
|                 if (page.ThemeType == PageState.Site.DefaultThemeType) | ||||
|                 if (!string.IsNullOrEmpty(page.ThemeType) && page.ThemeType == PageState.Site.DefaultThemeType) | ||||
|                 { | ||||
|                     page.ThemeType = string.Empty; | ||||
|                 } | ||||
|  | ||||
|                 if (page.LayoutType == PageState.Site.DefaultLayoutType) | ||||
|                 page.LayoutType = (_layouttype != "-") ? _layouttype : string.Empty; | ||||
|                 if (!string.IsNullOrEmpty(page.LayoutType) && page.LayoutType == PageState.Site.DefaultLayoutType) | ||||
|                 { | ||||
|                     page.LayoutType = string.Empty; | ||||
|                 } | ||||
|                 page.DefaultContainerType = (_containertype != "-") ? _containertype : string.Empty; | ||||
|                 if (!string.IsNullOrEmpty(page.DefaultContainerType) && page.DefaultContainerType == PageState.Site.DefaultContainerType) | ||||
|                 { | ||||
|                     page.DefaultContainerType = string.Empty; | ||||
|                 } | ||||
|                 page.Icon = (_icon == null ? string.Empty : _icon); | ||||
|                 page.Permissions = _permissionGrid.GetPermissions(); | ||||
|                 page.IsPersonalizable = (_ispersonalizable == null ? false : Boolean.Parse(_ispersonalizable)); | ||||
|  | ||||
| @ -112,7 +112,7 @@ | ||||
|                         </td> | ||||
|                         <td> | ||||
|                             <select id="Theme" class="form-control" @onchange="(e => ThemeChanged(e))"> | ||||
|                                 <option value="-"><Select Theme></option> | ||||
|                                 <option value="-"><Inherit From Site></option> | ||||
|                                 @foreach (KeyValuePair<string, string> item in _themes) | ||||
|                                 { | ||||
|                                     if (item.Key == _themetype) | ||||
| @ -133,7 +133,7 @@ | ||||
|                         </td> | ||||
|                         <td> | ||||
|                             <select id="Layout" class="form-control" @bind="@_layouttype"> | ||||
|                                 <option value="-"><Select Layout></option> | ||||
|                                 <option value="-"><Inherit From Site></option> | ||||
|                                 @foreach (KeyValuePair<string, string> panelayout in _panelayouts) | ||||
|                                 { | ||||
|                                     if (panelayout.Key == _layouttype) | ||||
| @ -148,6 +148,20 @@ | ||||
|                             </select> | ||||
|                         </td> | ||||
|                     </tr> | ||||
|                     <tr> | ||||
|                         <td> | ||||
|                             <Label For="defaultContainer" HelpText="Select the default container for the page">Default Container: </Label> | ||||
|                         </td> | ||||
|                         <td> | ||||
|                             <select id="defaultContainer" class="form-control" @bind="@_containertype"> | ||||
|                                 <option value="-"><Inherit From Site></option> | ||||
|                                 @foreach (KeyValuePair<string, string> container in _containers) | ||||
|                                 { | ||||
|                                     <option value="@container.Key">@container.Value</option> | ||||
|                                 } | ||||
|                             </select> | ||||
|                         </td> | ||||
|                     </tr> | ||||
|                     <tr> | ||||
|                         <td> | ||||
|                             <Label For="Icon" HelpText="Optionally provide an icon for this page which will be displayed in the site navigation">Icon: </Label> | ||||
| @ -200,6 +214,7 @@ | ||||
| @code { | ||||
|     private Dictionary<string, string> _themes; | ||||
|     private Dictionary<string, string> _panelayouts; | ||||
|     private Dictionary<string, string> _containers = new Dictionary<string, string>(); | ||||
|     private List<Theme> _themeList; | ||||
|     private List<Page> _pageList; | ||||
|     private int _pageId; | ||||
| @ -217,6 +232,7 @@ | ||||
|     private string _mode; | ||||
|     private string _themetype = "-"; | ||||
|     private string _layouttype = "-"; | ||||
|     private string _containertype = "-"; | ||||
|     private string _icon; | ||||
|     private string _permissions; | ||||
|     private string _createdby; | ||||
| @ -241,6 +257,7 @@ | ||||
|             _children = PageState.Pages.Where(item => item.ParentId == null).ToList(); | ||||
|  | ||||
|             _themes = ThemeService.GetThemeTypes(_themeList); | ||||
|             _containers = ThemeService.GetContainerTypes(_themeList); | ||||
|  | ||||
|             _pageId = Int32.Parse(PageState.QueryString["id"]); | ||||
|             var page = PageState.Pages.FirstOrDefault(item => item.PageId == _pageId); | ||||
| @ -270,16 +287,21 @@ | ||||
|                 _ispersonalizable = page.IsPersonalizable.ToString(); | ||||
|                 _mode = (page.EditMode) ? "edit" : "view"; | ||||
|                 _themetype = page.ThemeType; | ||||
|                 _panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype); | ||||
|                 _layouttype = page.LayoutType; | ||||
|                 if (_themetype == PageState.Site.DefaultThemeType) | ||||
|                 { | ||||
|                     _themetype = "-"; | ||||
|                 } | ||||
|                 _panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype); | ||||
|                 _layouttype = page.LayoutType; | ||||
|                 if (_layouttype == PageState.Site.DefaultLayoutType) | ||||
|                 { | ||||
|                     _layouttype = "-"; | ||||
|                 } | ||||
|                 _containertype = page.DefaultContainerType; | ||||
|                 if (string.IsNullOrEmpty(_containertype)) | ||||
|                 { | ||||
|                     _containertype = "-"; | ||||
|                 } | ||||
|                 _icon = page.Icon; | ||||
|                 _permissions = page.Permissions; | ||||
|                 _createdby = page.CreatedBy; | ||||
| @ -426,15 +448,20 @@ | ||||
|                 page.Url = _url; | ||||
|                 page.EditMode = (_mode == "edit"); | ||||
|                 page.ThemeType = (_themetype != "-") ? _themetype : string.Empty; | ||||
|                 page.LayoutType = (_layouttype != "-") ? _layouttype : string.Empty; | ||||
|                 if (page.ThemeType == PageState.Site.DefaultThemeType) | ||||
|                 if (!string.IsNullOrEmpty(page.ThemeType) && page.ThemeType == PageState.Site.DefaultThemeType) | ||||
|                 { | ||||
|                     page.ThemeType = string.Empty; | ||||
|                 } | ||||
|                 if (page.LayoutType == PageState.Site.DefaultLayoutType) | ||||
|                 page.LayoutType = (_layouttype != "-") ? _layouttype : string.Empty; | ||||
|                 if (!string.IsNullOrEmpty(page.LayoutType) && page.LayoutType == PageState.Site.DefaultLayoutType) | ||||
|                 { | ||||
|                     page.LayoutType = string.Empty; | ||||
|                 } | ||||
|                 page.DefaultContainerType = (_containertype != "-") ? _containertype : string.Empty; | ||||
|                 if (!string.IsNullOrEmpty(page.DefaultContainerType) && page.DefaultContainerType == PageState.Site.DefaultContainerType) | ||||
|                 { | ||||
|                     page.DefaultContainerType = string.Empty; | ||||
|                 } | ||||
|                 page.Icon = _icon ?? string.Empty; | ||||
|                 page.Permissions = _permissionGrid.GetPermissions(); | ||||
|                 page.IsPersonalizable = (_ispersonalizable != null && Boolean.Parse(_ispersonalizable)); | ||||
|  | ||||
| @ -260,7 +260,7 @@ | ||||
|                     if (PageState == null || reload >= Reload.Page) | ||||
|                     { | ||||
|                         modules = await ModuleService.GetModulesAsync(site.SiteId); | ||||
|                         modules = ProcessModules(modules, page.PageId, _pagestate.ModuleId, _pagestate.Action, page.Panes, site.DefaultContainerType); | ||||
|                         modules = ProcessModules(modules, page.PageId, _pagestate.ModuleId, _pagestate.Action, page.Panes, (!string.IsNullOrEmpty(page.DefaultContainerType)) ? page.DefaultContainerType : site.DefaultContainerType); | ||||
|                     } | ||||
|                     else | ||||
|                     { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shaun Walker
					Shaun Walker