<commit_before>{% macro render_menu_items(endpoints) %}
    {% for endpoint, name, icon in endpoints %}
        <a class="item {% if request.endpoint == endpoint %}active{% endif %}" href="{{ url_for(endpoint) }}">
            {% if icon %}
                <i class="{{ icon }} icon"></i>
            {% endif %}
            {{ name | safe }}
        </a>
    {% endfor %}
{% endmacro %}

{% macro header_items(current_user) %}
    <a class="header item" href="{{ url_for('main.index') }}">{{ config.APP_NAME }}</a>
    {% if current_user.is_authenticated() %}
        {% set href = url_for(current_user.role.index + '.index') %}
        <a class="item" href="{{ href }}">{{ current_user.role.name }} Dashboard</a>
    {% endif %}
{% endmacro %}

{% macro dropdown_choice(title, endpoint, icon=None, id="") %}
    <a id="{{ id }}" class="item" href="{{ url_for(endpoint) }}">
        {% if icon is not none %}
            <i class="{{ icon }}"></i>
        {% endif %}
        {{ title }}
    </a>
{% endmacro %}

{% macro account_items(current_user) %}
    {% if current_user.is_authenticated() %}
        <div class="ui simple dropdown item">
            Manage Resources
            <i class="dropdown icon"></i>
            <div class="menu">
                <h3 class="ui header">Resources</h3>
                {{ dropdown_choice('All Resources', 'single_resource.index',
                                    icon='book icon') }}
                {{ dropdown_choice('Add New Resource', 'single_resource.create',
                                    icon='add circle icon') }}
                {{ dropdown_choice('Suggested Resources', 'suggestion.index',
                                    icon='checkmark box icon', id='suggested-resources') }}
                <div class="ui section divider"></div>
                <h3 class="ui header">Descriptors</h3>
                {{ dropdown_choice('All Descriptors', 'descriptor.index',
                                    icon='tags icon') }}
                {{ dropdown_choice('Add New Descriptor', 'descriptor.new_descriptor',
                                    icon='add circle icon') }}
                <div class="ui section divider"></div>
                <h3 class="ui header">Bulk</h3>
                {{ dropdown_choice('Upload Resources', 'bulk_resource.upload',
                                    icon='upload icon') }}
                {{ dropdown_choice('Download Resources', 'single_resource.index',
                                    icon='download icon') }}
            </div>
        </div>
        <a href="{{ url_for('account.manage') }}" class="item">Your Account</a>
        <a href="{{ url_for('account.logout') }}" class="item">Log out</a>
    {% else %}
        <a href="{{ url_for('account.login') }}" class="item">Log in</a>
    {% endif %}
{% endmacro %}

{% macro mobile_nav(current_user, endpoints=None) %}
    <div class="mobile only row">
        <div class="ui fixed inverted black main menu">
            {{ header_items(current_user) }}
            <div class="right menu">
                <a class="icon item" id="open-nav"><i class="sidebar icon"></i></a>
            </div>
        </div>

        {# The menu items which will be shown when open-nav is clicked #}
        <div class="ui fixed vertical fluid menu">
            {% if endpoints %}
                {{ render_menu_items(endpoints) }}
            {% endif %}
            {{ account_items(current_user) }}
        </div>
    </div>
{% endmacro %}

{# If `count` and `endpoints` are specified, the endpoints will be put into a
 # secondary menu. `count` should be the string (e.g. 'four') number of endpoints. #}
{% macro desktop_nav(current_user, endpoints=None, count=None) %}
    <div class="computer tablet only row">
        <div class="ui fixed inverted black main menu">
            <div class="ui container">
                {{ header_items(current_user) }}
                <div class="right menu">
                    {{ account_items(current_user) }}
                </div>
            </div>
        </div>

        {# Endpoints go into a submenu #}
        {% if endpoints %}
            <div class="ui fixed {{ count + ' item' }} labeled icon fluid stackable sub menu">
                <div class="ui stackable container">
                    {{ render_menu_items(endpoints) }}
                </div>
            </div>
        {% endif %}
    </div>
{% endmacro %}

{% macro render_nav(current_user, count, endpoints) %}
    <nav class="ui navigation grid {% if endpoints %}has-submenu{% endif %}">
        {{ mobile_nav(current_user, endpoints=endpoints) }}
        {{ desktop_nav(current_user, endpoints=endpoints, count=count) }}
    </nav>
{% endmacro %}
<commit_msg>remove 'log in' button - public users aren't distracted and admins will know link to log in<commit_after>{% macro render_menu_items(endpoints) %}
    {% for endpoint, name, icon in endpoints %}
        <a class="item {% if request.endpoint == endpoint %}active{% endif %}" href="{{ url_for(endpoint) }}">
            {% if icon %}
                <i class="{{ icon }} icon"></i>
            {% endif %}
            {{ name | safe }}
        </a>
    {% endfor %}
{% endmacro %}

{% macro header_items(current_user) %}
    <a class="header item" href="{{ url_for('main.index') }}">{{ config.APP_NAME }}</a>
    {% if current_user.is_authenticated() %}
        {% set href = url_for(current_user.role.index + '.index') %}
        <a class="item" href="{{ href }}">{{ current_user.role.name }} Dashboard</a>
    {% endif %}
{% endmacro %}

{% macro dropdown_choice(title, endpoint, icon=None, id="") %}
    <a id="{{ id }}" class="item" href="{{ url_for(endpoint) }}">
        {% if icon is not none %}
            <i class="{{ icon }}"></i>
        {% endif %}
        {{ title }}
    </a>
{% endmacro %}

{% macro account_items(current_user) %}
    {% if current_user.is_authenticated() %}
        <div class="ui simple dropdown item">
            Manage Resources
            <i class="dropdown icon"></i>
            <div class="menu">
                <h3 class="ui header">Resources</h3>
                {{ dropdown_choice('All Resources', 'single_resource.index',
                                    icon='book icon') }}
                {{ dropdown_choice('Add New Resource', 'single_resource.create',
                                    icon='add circle icon') }}
                {{ dropdown_choice('Suggested Resources', 'suggestion.index',
                                    icon='checkmark box icon', id='suggested-resources') }}
                <div class="ui section divider"></div>
                <h3 class="ui header">Descriptors</h3>
                {{ dropdown_choice('All Descriptors', 'descriptor.index',
                                    icon='tags icon') }}
                {{ dropdown_choice('Add New Descriptor', 'descriptor.new_descriptor',
                                    icon='add circle icon') }}
                <div class="ui section divider"></div>
                <h3 class="ui header">Bulk</h3>
                {{ dropdown_choice('Upload Resources', 'bulk_resource.upload',
                                    icon='upload icon') }}
                {{ dropdown_choice('Download Resources', 'single_resource.index',
                                    icon='download icon') }}
            </div>
        </div>
        <a href="{{ url_for('account.manage') }}" class="item">Your Account</a>
        <a href="{{ url_for('account.logout') }}" class="item">Log out</a>
    {% endif %}
{% endmacro %}

{% macro mobile_nav(current_user, endpoints=None) %}
    <div class="mobile only row">
        <div class="ui fixed inverted black main menu">
            {{ header_items(current_user) }}
            <div class="right menu">
                <a class="icon item" id="open-nav"><i class="sidebar icon"></i></a>
            </div>
        </div>

        {# The menu items which will be shown when open-nav is clicked #}
        <div class="ui fixed vertical fluid menu">
            {% if endpoints %}
                {{ render_menu_items(endpoints) }}
            {% endif %}
            {{ account_items(current_user) }}
        </div>
    </div>
{% endmacro %}

{# If `count` and `endpoints` are specified, the endpoints will be put into a
 # secondary menu. `count` should be the string (e.g. 'four') number of endpoints. #}
{% macro desktop_nav(current_user, endpoints=None, count=None) %}
    <div class="computer tablet only row">
        <div class="ui fixed inverted black main menu">
            <div class="ui container">
                {{ header_items(current_user) }}
                <div class="right menu">
                    {{ account_items(current_user) }}
                </div>
            </div>
        </div>

        {# Endpoints go into a submenu #}
        {% if endpoints %}
            <div class="ui fixed {{ count + ' item' }} labeled icon fluid stackable sub menu">
                <div class="ui stackable container">
                    {{ render_menu_items(endpoints) }}
                </div>
            </div>
        {% endif %}
    </div>
{% endmacro %}

{% macro render_nav(current_user, count, endpoints) %}
    <nav class="ui navigation grid {% if endpoints %}has-submenu{% endif %}">
        {{ mobile_nav(current_user, endpoints=endpoints) }}
        {{ desktop_nav(current_user, endpoints=endpoints, count=count) }}
    </nav>
{% endmacro %}

{'fraction_non_alphanumeric': 0.15619047619047619, 'fraction_numerical': 0.0012698412698412698, 'mean_word_length': 1.9692114357524348, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1670299', 'n_tokens_mistral': 2765, 'n_tokens_neox': 2486, 'n_words': 651}