@using NewLife.Model;
@using XCode.Membership;
@{
var user = ViewBag.User as IUser ?? User.Identity as IUser;
var fact = ObjectContainer.Current.Resolve<IMenuFactory>();
var item = Model as IMenu;
var childs = fact.GetMySubMenus(item.ID, user).Where(m => m.Visible);
var url = item.Url.IsNullOrEmpty() ? "" : Url.Content(item.Url);
}
<li>
@if (childs.Any())
{
<a href="#" class="dropdown-toggle">
<i class="menu-icon fa fa-caret-right"></i>
@item.DisplayName
</a>
}
else
{
<a href="@url" target="main">
<i class="menu-icon fa fa-caret-right"></i>
@item.DisplayName
</a>
<b class="arrow"></b>
<ul class="submenu">
@foreach (var menu in childs)
{
@Html.Partial("_Left_Item", menu);
}
</ul>
}
</li>
|