<commit_before>{% load ditto i18n %}

<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
    <ul class="nav navbar-nav">
        {% if request.tenant %}
            {% url 'ditto:about' as url %}
            {% navitem "about" url _("About") %}
            
            {% if request.user.is_authenticated and request.tenant.is_configured %}
                {% if perms.users.can_admin %}
                    {% url 'ditto:dash' as url %}
                    {% navitem "dash" url _("Dashboard") %}
                {% endif %}
                
                {% url 'ditto:chatroom' as url %}
                {% navitem "chatroom" url _("Chatroom") %}
                
                {% if perms.users.can_admin %}
                    {% url 'ditto:new-chatroom' as url %}
                    {% navitem "newchatroom" url _("New chatroom") %}
                {% endif %}
            {% endif %}
        {% endif %}
    </ul>
    
    {% if not request.tenant %}
        {# TODO can't figure out how to centre this :( #}
        <p class="navbar-text"><big>DITTO.TECHNOLOGY</big></p>
    {% endif %}
    
    <ul class="nav navbar-nav navbar-right">
        {% if not request.user.is_authenticated %}
            <li><a href="{% url 'account_login' %}">{% trans "Log In" %}</a></li>
        {% endif %}

        {% if not request.tenant and request.user.is_authenticated %}
            <li><a href="{% url 'account_logout' %}">{% trans "Logout" %}</a></li>
        {% endif %}

        {% if request.user.is_authenticated %}
            {% if request.tenant %}
                {% if request.tenant.is_configured %}
                <li>
                    {% url "ditto:private_chats" as url %}
                    <a class="navicon navicon-messages" href="{{ url }}">
                        Messages
                    </a>
                </li>
                {% endif %}
                
                <li class="dropdown">
                    {% url "users:detail" request.user.username as profile_url %}
                    <a href="#" class="navicon navicon-profile dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Me <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="{{ profile_url }}">My Profile</a></li>
                        <li><a href="{% url 'account_logout' %}">Logout</a></li>
                    </ul>
                </li>
                
                {% if request.tenant.is_configured %}
                <li class="{% if "settings" in nav %} active{% endif %}">
                    {% url "ditto:config" as url %}
                    <a class="navicon navicon-settings" href="{{ url }}">
                        Settings
                    </a>
                </li>
                {% endif %}
            {% endif %}
        {% endif %}
    </ul>
</div>
<commit_msg>Only show settings nav if user has admin perms<commit_after>{% load ditto i18n %}

<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
    <ul class="nav navbar-nav">
        {% if request.tenant %}
            {% url 'ditto:about' as url %}
            {% navitem "about" url _("About") %}
            
            {% if request.user.is_authenticated and request.tenant.is_configured %}
                {% if perms.users.can_admin %}
                    {% url 'ditto:dash' as url %}
                    {% navitem "dash" url _("Dashboard") %}
                {% endif %}
                
                {% url 'ditto:chatroom' as url %}
                {% navitem "chatroom" url _("Chatroom") %}
                
                {% if perms.users.can_admin %}
                    {% url 'ditto:new-chatroom' as url %}
                    {% navitem "newchatroom" url _("New chatroom") %}
                {% endif %}
            {% endif %}
        {% endif %}
    </ul>
    
    {% if not request.tenant %}
        {# TODO can't figure out how to centre this :( #}
        <p class="navbar-text"><big>DITTO.TECHNOLOGY</big></p>
    {% endif %}
    
    <ul class="nav navbar-nav navbar-right">
        {% if not request.user.is_authenticated %}
            <li><a href="{% url 'account_login' %}">{% trans "Log In" %}</a></li>
        {% endif %}

        {% if not request.tenant and request.user.is_authenticated %}
            <li><a href="{% url 'account_logout' %}">{% trans "Logout" %}</a></li>
        {% endif %}

        {% if request.user.is_authenticated %}
            {% if request.tenant %}
                {% if request.tenant.is_configured %}
                <li>
                    {% url "ditto:private_chats" as url %}
                    <a class="navicon navicon-messages" href="{{ url }}">
                        Messages
                    </a>
                </li>
                {% endif %}
                
                <li class="dropdown">
                    {% url "users:detail" request.user.username as profile_url %}
                    <a href="#" class="navicon navicon-profile dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Me <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="{{ profile_url }}">My Profile</a></li>
                        <li><a href="{% url 'account_logout' %}">Logout</a></li>
                    </ul>
                </li>
                
                <li class="{% if "settings" in nav %} active{% endif %}">
                {% if request.tenant.is_configured and perms.users.can_admin %}
                    {% url "ditto:config" as url %}
                    <a class="navicon navicon-settings" href="{{ url }}">
                        Settings
                    </a>
                </li>
                {% endif %}
            {% endif %}
        {% endif %}
    </ul>
</div>

{'fraction_non_alphanumeric': 0.15592761711483172, 'fraction_numerical': 0.0010147133434804667, 'mean_word_length': 1.360878243512974, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 87, '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': '5880794', 'n_tokens_mistral': 1845, 'n_tokens_neox': 1584, 'n_words': 372}