<commit_before>﻿@using Site.App_Code
@inherits Umbraco.Web.Mvc.UmbracoViewPage<IPublishedContent>
@{
    Layout = null;
    var parent = Model.AncestorOrSelf(2);
    var deep = Model.DocumentTypeAlias == "ProductFolder" ? 4 : 3;
    if (parent != null)
    {

        <aside class=" sidebar" style="float: left; width: 25%;">
            <h2 class="sidebar-widget-title">@parent.GetTitleOrName()</h2>
            <nav>
                @traverse(parent, deep)
            </nav>    
        </aside>
    }
}


@helper traverse(IPublishedContent parent, int finishLevel)
{
    <ul>
        @foreach (var node in parent.Children.Where(x => x.IsVisible()))
        {
            if (node != null)
            {
                var selected = Array.IndexOf(Model.Path.Split(','), node.Id.ToString()) >= 0 ? " class=\"active\"" : "";
                <li>
                    <a @Html.Raw(selected) href="@node.GetAliasOrUrl()">@node.GetTitleOrName()</a>                                       
                    @if (selected != "" && @node.Level <= finishLevel && @node.Children.Any())
                    {
                        @traverse(node, finishLevel)
                    }  
                </li><commit_msg>Change left navigation<commit_after>﻿@using Site.App_Code
@inherits Umbraco.Web.Mvc.UmbracoViewPage<IPublishedContent>
@{
    Layout = null;
    var parent = Model.AncestorOrSelf(2);
    var deep = Model.DocumentTypeAlias == "ProductFolder" || Model.DocumentTypeAlias == "ProductItem" ? 4 : 3;
    if (parent != null)
    {

        <aside class=" sidebar" style="float: left; width: 25%;">
            <h2 class="sidebar-widget-title">@parent.GetTitleOrName()</h2>
            <nav>
                @traverse(parent, deep)
            </nav>    
        </aside>
    }
}


@helper traverse(IPublishedContent parent, int finishLevel)
{
    <ul>
        @foreach (var node in parent.Children.Where(x => x.IsVisible()))
        {
            if (node != null)
            {
                var selected = Array.IndexOf(Model.Path.Split(','), node.Id.ToString()) >= 0 ? " class=\"active\"" : "";
                <li>
                    <a @Html.Raw(selected) href="@node.GetAliasOrUrl()">@node.GetTitleOrName()</a>                                       
                    @if (selected != "" && @node.Level < finishLevel && @node.Children.Any())
                    {
                        @traverse(node, finishLevel)
                    }  
                </li>
{'fraction_non_alphanumeric': 0.14919354838709678, 'fraction_numerical': 0.0064516129032258064, 'mean_word_length': 1.6792656587473003, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6707112', 'n_tokens_mistral': 755, 'n_tokens_neox': 700, 'n_words': 133}