-
Notifications
You must be signed in to change notification settings - Fork 183
/
Navigation.cshtml
41 lines (37 loc) · 1.59 KB
/
Navigation.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@using APIViewWeb.Models
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using APIViewWeb.Helpers
@model IEnumerable<APIView.NavigationItem>
@{
bool hasSections = ViewBag.HasSections;
bool isChildNavigation = ViewBag.IsChildNavigation ?? false;
string navListGroupClass = (hasSections && isChildNavigation) ? "nav-list-group nav-list-collapsed" : "nav-list-group";
var userPreference = TempData["UserPreference"] as UserPreferenceModel;
var languageCssSafename = TempData["LanguageCssSafeName"] as string;
}
<ul class="nav-list-children">
@foreach (var item in Model)
{
var elementNavListClass = navListGroupClass;
if (item.IsHiddenApi)
{
elementNavListClass += PageModelHelpers.GetHiddenApiClass(userPreference);
}
<li class="@elementNavListClass">
<span class="nav-list-toggle @(item.ChildItems.Any() ? "":"invisible")"></span>
@if (item.Tags != null && item.Tags.ContainsKey("TypeKind"))
{
<span class="@languageCssSafename-variant icon-@item.Tags.GetValueOrDefault("TypeKind")"> </span>
}
else
{
<span class="@languageCssSafename-variant icon-unknown"> </span>
}
<a href="#@item.NavigationId" title="@item.Text">@item.Text</a>
@{
ViewBag.IsChildNavigation = true;
}
<partial name="Shared/Navigation" model="item.ChildItems"/>
</li>
}
</ul>