<commit_before>{% import '@bolt/_nav/_macros.twig' as nav %}
{% import _self as self %}
{##
 # Main-level menuitem without path
 #}
{% macro linkExt(icon, label, pathname, active, divider) %}
    {% from '@bolt/_nav/_macros.twig' import label, icon %}
    {% set class = 'main-level-settings' %}
    {% if pathname == 'dashboard' %}{% set class = 'nav-secondary-dashboard' %}{% endif %}
    {% if active %}{% set class = class ~ ' active' %}{% endif %}
    {% if divider %}{% set class = class ~ ' divider' %}{% endif %}
    <li{% if class %} class="{{ class|trim }}" {% endif %}>
        <a href="{{ pathname }}">{{ label(icon, label) }}</a>
    </li>
{% endmacro %}

<ul class="nav">
    {% if app.session.get('authentication') is not null %}

        {# Omnisearch: one here for "extra small", the other in the header-navbar #}
        {{ include('@bolt/_nav/_secondary-search.twig') }}

        {# Dashboard #}
        {{ nav.link('fa:dashboard', __('general.phrase.dashboard'), 'dashboard', (page_nav == 'Dashboard')) }}

        {# View site #}
        <li class="visible-xs">
            <a href="{{ paths.root }}" target="_blank"><i class="icon fa fa-external-link-square"></i> {{ __('general.phrase.view-site') }}</a>
        </li>

        {# Contenttypes #}
        {{ nav.heading(__('Content'), 'fa:file-text') }}
        {{ include('@bolt/_nav/_secondary-content.twig') }}

        {# Settings #}
        {% if isallowed('settings') %}
            {% set nav_config %}{{ include('@bolt/_nav/_secondary-configuration.twig') }}{% endset %}
            {% set nav_files %}{{ include('@bolt/_nav/_secondary-filemanagement.twig') }}{% endset %}
            {% set nav_trans %}{{ include('@bolt/_nav/_secondary-translations.twig') }}{% endset %}
            {# Link to Extend Bolt #}
            {% if app['menu.admin'].get('extend').children or isallowed('extensions||extensions:config') %}
                {% set nav_extend %}{{ include('@bolt/_nav/_secondary-extensions.twig') }}{% endset %}
            {% else %}
                {% set nav_extend = '' %}
            {% endif %}

            {% if nav_config|trim or nav_files|trim or nav_trans|trim or nav_extend|trim %}
                {{ nav.heading(__('general.phrase.settings'), 'fa:wrench') }}

                {{ nav_config }}
                {{ nav_files }}
                {{ nav_trans }}
                {{ nav_extend }}

                {# Add the available extensions that have added a menu-item. #}
                {% set extend_menu = app['menu.admin'].get('extend') %}
                {% for extension in extend_menu.children %}
                    {% if extension.permission is null or isallowed(extension.permission) == true or extension.permission == 'everyone' %}
                        {{ self.linkExt(
                            extension.icon|default('fa:briefcase'), 
                            extension.label, 
                            extension.uri, 
                            (extension.uri == app.request.pathInfo)
                        )}}
                    {% endif %}
                {% endfor %}
            {% endif %}
            {% if isallowed('files:theme') %}
                {% if app.config.get('theme/shortcuts') %}
                    {{ nav.heading(__('Shortcuts'), 'fa:code', 'shortcut-header') }}
                    {% for shortcut in app.config.get('theme/shortcuts') %}
                        {% if shortcut.file|default(false) %}
                            {{ self.linkExt(
                                'fa:'~shortcut.icon|default('fa:file'),
                                shortcut.name,
                                app.resources.getUrl('bolt') ~ 'file/edit/theme' ~ shortcut.file,
                                (app.resources.getUrl('bolt') ~ 'file/edit/theme' ~ shortcut.file == app.request.pathInfo)
                            )}}
                        {% elseif shortcut.folder|default(false) %}
                            {{ self.linkExt(
                                'fa:'~shortcut.icon|default('fa:folder-o'),
                                shortcut.name,
                                app.resources.getUrl('bolt') ~ 'files/theme' ~ shortcut.folder,
                                (app.resources.getUrl('bolt') ~ 'files/theme' ~ shortcut.folder == app.request.pathInfo)
                            )}}
                        {% endif %}
                    {% endfor %}
                {% endif %}
            {% endif %}
        {% endif %}


        {{ nav.collapse() }}

    {% else %}

        {# View site #}
        <li>
            <a href="{{ paths.root }}" target="_blank"><i class="fa fa-external-link-square"></i> {{ __('general.phrase.view-site') }}</a>
        </li>

        {# Login #}
        <li>
            <a href="{{ path('login') }}"><i class="fa fa-signin"></i> {{ __('general.phrase.login') }}</a>
        </li>
    {% endif %}
</ul>
<commit_msg>Updated if statement with menu items<commit_after>{% import '@bolt/_nav/_macros.twig' as nav %}
{% import _self as self %}
{##
 # Main-level menuitem without path
 #}
{% macro linkExt(icon, label, pathname, active, divider) %}
    {% from '@bolt/_nav/_macros.twig' import label, icon %}
    {% set class = 'main-level-settings' %}
    {% if pathname == 'dashboard' %}{% set class = 'nav-secondary-dashboard' %}{% endif %}
    {% if active %}{% set class = class ~ ' active' %}{% endif %}
    {% if divider %}{% set class = class ~ ' divider' %}{% endif %}
    <li{% if class %} class="{{ class|trim }}" {% endif %}>
        <a href="{{ pathname }}">{{ label(icon, label) }}</a>
    </li>
{% endmacro %}

<ul class="nav">
    {% if app.session.get('authentication') is not null %}

        {# Omnisearch: one here for "extra small", the other in the header-navbar #}
        {{ include('@bolt/_nav/_secondary-search.twig') }}

        {# Dashboard #}
        {{ nav.link('fa:dashboard', __('general.phrase.dashboard'), 'dashboard', (page_nav == 'Dashboard')) }}

        {# View site #}
        <li class="visible-xs">
            <a href="{{ paths.root }}" target="_blank"><i class="icon fa fa-external-link-square"></i> {{ __('general.phrase.view-site') }}</a>
        </li>

        {# Contenttypes #}
        {{ nav.heading(__('Content'), 'fa:file-text') }}
        {{ include('@bolt/_nav/_secondary-content.twig') }}

        {# Settings #}
        {% if isallowed('settings') %}
            {% set nav_config %}{{ include('@bolt/_nav/_secondary-configuration.twig') }}{% endset %}
            {% set nav_files %}{{ include('@bolt/_nav/_secondary-filemanagement.twig') }}{% endset %}
            {% set nav_trans %}{{ include('@bolt/_nav/_secondary-translations.twig') }}{% endset %}
            {# Link to Extend Bolt #}
            {% if app['menu.admin'].get('extend').children or isallowed('extensions||extensions:config') %}
                {% set nav_extend %}{{ include('@bolt/_nav/_secondary-extensions.twig') }}{% endset %}
            {% else %}
                {% set nav_extend = '' %}
            {% endif %}

            {% if nav_config|trim or nav_files|trim or nav_trans|trim or nav_extend|trim %}
                {{ nav.heading(__('general.phrase.settings'), 'fa:wrench') }}

                {{ nav_config }}
                {{ nav_files }}
                {{ nav_trans }}
                {{ nav_extend }}

                {# Add the available extensions that have added a menu-item. #}
                {% set extend_menu = app['menu.admin'].get('extend') %}
                {% for extension in extend_menu.children %}
                    {% if isallowed(extension.permission) %}
                        {{ self.linkExt(
                            extension.icon|default('fa:briefcase'), 
                            extension.label, 
                            extension.uri, 
                            (extension.uri == app.request.pathInfo)
                        )}}
                    {% endif %}
                {% endfor %}
            {% endif %}
            {% if isallowed('files:theme') %}
                {% if app.config.get('theme/shortcuts') %}
                    {{ nav.heading(__('Shortcuts'), 'fa:code', 'shortcut-header') }}
                    {% for shortcut in app.config.get('theme/shortcuts') %}
                        {% if shortcut.file|default(false) %}
                            {{ self.linkExt(
                                'fa:'~shortcut.icon|default('fa:file'),
                                shortcut.name,
                                app.resources.getUrl('bolt') ~ 'file/edit/theme' ~ shortcut.file,
                                (app.resources.getUrl('bolt') ~ 'file/edit/theme' ~ shortcut.file == app.request.pathInfo)
                            )}}
                        {% elseif shortcut.folder|default(false) %}
                            {{ self.linkExt(
                                'fa:'~shortcut.icon|default('fa:folder-o'),
                                shortcut.name,
                                app.resources.getUrl('bolt') ~ 'files/theme' ~ shortcut.folder,
                                (app.resources.getUrl('bolt') ~ 'files/theme' ~ shortcut.folder == app.request.pathInfo)
                            )}}
                        {% endif %}
                    {% endfor %}
                {% endif %}
            {% endif %}
        {% endif %}


        {{ nav.collapse() }}

    {% else %}

        {# View site #}
        <li>
            <a href="{{ paths.root }}" target="_blank"><i class="fa fa-external-link-square"></i> {{ __('general.phrase.view-site') }}</a>
        </li>

        {# Login #}
        <li>
            <a href="{{ path('login') }}"><i class="fa fa-signin"></i> {{ __('general.phrase.login') }}</a>
        </li>
    {% endif %}
</ul>

{'fraction_non_alphanumeric': 0.17519142419601838, 'fraction_numerical': 0.0, 'mean_word_length': 1.6333333333333333, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4245257', 'n_tokens_mistral': 2945, 'n_tokens_neox': 2634, 'n_words': 501}