updated namespaces, improved page management,
This commit is contained in:
		
							
								
								
									
										36
									
								
								Oqtane.Client/Modules/Admin/Dashboard/Index.razor
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								Oqtane.Client/Modules/Admin/Dashboard/Index.razor
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,36 @@ | ||||
| @using Microsoft.AspNetCore.Components.Routing | ||||
| @using Oqtane.Modules | ||||
| @using Oqtane.Services | ||||
| @using Oqtane.Models; | ||||
| @using Oqtane.Security | ||||
| @namespace Oqtane.Modules.Admin.Dashboard | ||||
| @inherits ModuleBase | ||||
| @inject IPageService PageService | ||||
| @inject IUserService UserService | ||||
|  | ||||
| <ul class="list-group"> | ||||
|     @foreach (var p in pages) | ||||
|     { | ||||
|         if (p.IsNavigation && UserSecurity.IsAuthorized(PageState.User, "View", p.Permissions)) | ||||
|         { | ||||
|             string url = NavigateUrl(p.Path); | ||||
|             <li class="list-group-item"> | ||||
|                 <NavLink class="nav-link" href="@url" Match="NavLinkMatch.All"> | ||||
|                     <span class="oi @p.Icon" aria-hidden="true"></span> @p.Name | ||||
|                 </NavLink> | ||||
|             </li> | ||||
|         } | ||||
|     } | ||||
| </ul> | ||||
| <br /> | ||||
| <br /> | ||||
|  | ||||
| @code { | ||||
|     List<Page> pages; | ||||
|  | ||||
|     protected override void OnInitialized() | ||||
|     { | ||||
|         // display list of pages which are children of current page | ||||
|         pages = PageState.Pages.Where(item => item.ParentId == PageState.Page.PageId).ToList(); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Shaun Walker
					Shaun Walker