|
|
|
@ -16,6 +16,7 @@ |
|
|
|
@using Volo.Abp.AspNetCore.Mvc.UI.Theming |
|
|
|
@using Volo.Docs |
|
|
|
@using Volo.Docs.Areas.Documents.TagHelpers |
|
|
|
@using Volo.Docs.Documents |
|
|
|
@using Volo.Docs.Localization |
|
|
|
@using Volo.Docs.Pages.Documents.Project |
|
|
|
@using Volo.Docs.Pages.Documents.Shared.ErrorComponent |
|
|
|
@ -292,6 +293,73 @@ |
|
|
|
<li class="breadcrumb-item"> |
|
|
|
<a href="@Model.CreateVersionLink(Model.LatestVersionInfo, Model.GetSpecificVersionOrLatest())"><i class="fa fa-home"></i></a> |
|
|
|
</li> |
|
|
|
@if (Model.Navigation != null && Model.Navigation.Items != null) |
|
|
|
{ |
|
|
|
var currentNode = Model.Navigation.Items.FirstOrDefault(n => n.IsSelected(Model.DocumentNameWithExtension)); |
|
|
|
var navigation = Model.Navigation.FindNavigation(Model.DocumentNameWithExtension); |
|
|
|
var documentExtension = System.IO.Path.GetExtension(Model.DocumentNameWithExtension); |
|
|
|
NavigationNode previousNode = null; |
|
|
|
if (currentNode != null) |
|
|
|
{ |
|
|
|
while (currentNode != null) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(currentNode.Path) && previousNode != currentNode) |
|
|
|
{ |
|
|
|
previousNode = currentNode; |
|
|
|
PrintNode(currentNode); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var indexDocument = FindIndexNode(currentNode); |
|
|
|
if (indexDocument != null && indexDocument != previousNode) |
|
|
|
{ |
|
|
|
PrintNode(indexDocument, currentNode.Text); |
|
|
|
} |
|
|
|
else if(currentNode != previousNode) |
|
|
|
{ |
|
|
|
<li class="breadcrumb-item"> |
|
|
|
<span> |
|
|
|
@currentNode.Text |
|
|
|
</span> |
|
|
|
</li> |
|
|
|
} |
|
|
|
|
|
|
|
previousNode = indexDocument; |
|
|
|
} |
|
|
|
|
|
|
|
currentNode = currentNode?.Items?.FirstOrDefault(n => n.IsSelected(Model.DocumentNameWithExtension)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void PrintNode(NavigationNode node, string text = null) |
|
|
|
{ |
|
|
|
var extension = System.IO.Path.GetExtension(node.Path); |
|
|
|
var path = string.IsNullOrWhiteSpace(extension) ? node.Path : node.Path.Substring(0, node.Path.Length - extension.Length); |
|
|
|
<li class="breadcrumb-item @(node == navigation ? "active" : "")"> |
|
|
|
<a href="@Model.BuildDocumentUrl(Model.ProjectName, Model.LanguageCode, Model.LatestVersionInfo.IsSelected ? DocsAppConsts.Latest : Model.Version, path)"> |
|
|
|
@(text ?? node.Text) |
|
|
|
</a> |
|
|
|
</li> |
|
|
|
} |
|
|
|
|
|
|
|
NavigationNode FindIndexNode(NavigationNode node) |
|
|
|
{ |
|
|
|
var nextNode = node.Items?.FirstOrDefault(n => n.IsSelected(Model.DocumentNameWithExtension)); |
|
|
|
while (nextNode != null && string.IsNullOrEmpty(nextNode.Path)) |
|
|
|
{ |
|
|
|
nextNode = nextNode.Items.FirstOrDefault(n => n.IsSelected(Model.DocumentNameWithExtension)); |
|
|
|
} |
|
|
|
|
|
|
|
if(nextNode == null) |
|
|
|
{ |
|
|
|
return node.Items?.FirstOrDefault(n => n.Text == "Overview"); |
|
|
|
} |
|
|
|
|
|
|
|
var lastSlashIndex = nextNode.Path.LastIndexOf('/'); |
|
|
|
var path = lastSlashIndex < 0 ? nextNode.Path : nextNode.Path.Substring(0, lastSlashIndex); |
|
|
|
return node.Items.FirstOrDefault(n => n.Path != null && (n.IsSelected(path + documentExtension) || n.IsSelected(path + "/index" + documentExtension))) ?? node.Items.FirstOrDefault(n => n.Text == "Overview"); |
|
|
|
} |
|
|
|
} |
|
|
|
</ol> |
|
|
|
</nav> |
|
|
|
<div class="doc-social-btns"> |
|
|
|
|