@using System.Text @using Abp.Application.Navigation @using Abp.Collections.Extensions @using WeApp.Authorization @using WeApp.Views @model WeApp.Models.Layout.SideBarNavViewModel @{ var pageTitleStr = ""; var calculateMenuUrl = new Func((url) => { if (string.IsNullOrEmpty(url)) { return ApplicationPath; } if (UrlChecker.IsRooted(url)) { return url; } return ApplicationPath + url; }); string MenuHtml(UserMenuItem menuItem) { if (menuItem==null||menuItem.Name==PermissionNames.Pages) { return ""; } StringBuilder sb = new StringBuilder(); string open="", active="",angle="left"; if (Model.ActiveNames != null && (Model.ActiveNames.Contains(menuItem.Name)&& (menuItem.Name!=PermissionNames.Pages))) { open = " menu-open"; active = "active"; angle = "left"; } sb.AppendLine(); string iconHtml = string.IsNullOrWhiteSpace(menuItem.Icon) ? "" : " "; if (menuItem.Items.IsNullOrEmpty()) { sb.AppendFormat("
  • ", active); sb.AppendFormat("{2}

    {3}

    ", active, calculateMenuUrl(menuItem.Url), iconHtml, menuItem.DisplayName); sb.Append("
  • "); sb.AppendLine(); } else { sb.AppendFormat("
  • ", open); sb.AppendFormat("{1}

    {2}

    ", active, iconHtml, menuItem.DisplayName, angle); sb.AppendLine(); sb.Append(""); sb.Append("
  • "); sb.AppendLine(); } sb.AppendLine(); return sb.ToString(); } } @foreach (var menuItem in Model.MainMenu.Items) { @Html.Raw(MenuHtml(menuItem)) } @if (Model != null && Model.PageTitles.Any()) { foreach (var pageTitle in Model.PageTitles) { pageTitleStr += "
  • >
  • " + pageTitle.Name + "
  • "; } } @**@ @**@