BootstrapAdmin/Bootstrap.Admin/Views/Shared/SubNavItem.cshtml

32 lines
1.3 KiB
Plaintext

@model Bootstrap.Security.BootstrapMenu
@if(Model.Menus.Any())
{
<li class="nav-item parent">
@if(Model.Active == "active")
{
<a href="@string.Format("#collapse_{0}", Model.Id)" role="button" data-toggle="collapse" class="nav-link active"><i class="@Model.Icon"></i><span class="flex-fill">@Model.Name</span><i class="fa fa-angle-left"></i></a>
<div class="show" id="@string.Format("collapse_{0}", Model.Id)">
@if (Model.Menus.Any())
{
@await Html.PartialAsync("SubNavigation", Model.Menus)
}
</div>
}
else
{
<a href="@string.Format("#collapse_{0}", Model.Id)" role="button" data-toggle="collapse" class="nav-link collapsed"><i class="@Model.Icon"></i><span class="flex-fill">@Model.Name</span><i class="fa fa-angle-left"></i></a>
<div class="collapse" id="@string.Format("collapse_{0}", Model.Id)">
@if (Model.Menus.Any())
{
@await Html.PartialAsync("SubNavigation", Model.Menus)
}
</div>
}
</li>
}
else
{
<li class="nav-item">
<a href="@Url.Content(Model.Url)" class="nav-link @Model.Active" target="@Model.Target"><i class="@Model.Icon"></i><span class="flex-fill">@Model.Name</span></a>
</li>
}