{% load i18n static misago_avatars %}
<nav id="misago-navbar" class="navbar" role="navigation">
  <div class="container navbar-container">
    
    {% if settings.logo %}
      <div class="navbar-branding">
        <a href="{% url 'misago:index' %}" class="navbar-branding-logo">
          <img src="{{ settings.logo }}" alt="{{ settings.logo_text}}">
        </a>
      </div>
    {% else %}
      <div class="navbar-branding">
        {% if settings.logo_small %}
          <a href="{% url 'misago:index' %}" class="navbar-branding-logo-xs">
            <img src="{{ settings.logo_small }}" alt="{{ settings.logo_text}}">
          </a>
        {% endif %}
        {% if settings.logo_text %}
          <a href="{% url 'misago:index' %}" class="navbar-branding-text">
            {{ settings.logo_text }}
          </a>
        {% endif %}
      </div>
    {% endif %}

    <div class="navbar-right">
      {% if navbar_menu %}
        <ul class="navbar-extra-menu" role="nav">
          {% for link in navbar_menu %}
            <li>
              <a href="{{ link.url }}"{% if link.css_class %} class="{{ link.css_class }}"{% endif %}{% if link.rel %} rel="{{ link.rel }}"{% endif %}{% if link.target_blank %} target="_blank"{% endif %}>
                {{ link.title }}
              </a>
            </li>
          {% endfor %}
        </ul>
      {% endif %}
      {% if user_acl.can_search %}
        <div id="navbar-search-link">
          <a class="btn btn-navbar-icon" href="{% url 'misago:search' %}" title="{% trans 'Open search' context 'navbar' %}">
            <span class="material-icon">search</span>
          </a>
        </div>
      {% endif %}
      <div id="navbar-site-nav-link">
        <button class="btn btn-navbar-icon" title="Open menu" type="button" disabled>
          <span class="material-icon">menu</span>
        </button>
      </div>
      {% if user.is_authenticated and user_acl.can_use_private_threads %}
        <a id="navbar-private-threads" class="btn btn-navbar-icon" href="{% url 'misago:private-threads' %}" title="{% trans 'Open private threads' context 'navbar' %}">
          <span class="material-icon">inbox</span>
        </a>
      {% endif %}
      {% if user.is_authenticated %}
        <div id="navbar-notifications-link">
          <a class="btn btn-navbar-icon" href="{% url 'misago:notifications' %}" title="{% trans 'Open notifications' context 'navbar' %}">
            <span class="material-icon">notifications_none</span>
          </a>
        </div>
        <div id="navbar-user-nav-link">
          <a class="btn-navbar-image" href="{% url 'misago:user' slug=user.slug pk=user.id %}" title="{% trans 'Open your options' context 'navbar' %}">
            <img alt="" class="user-avatar" src="{{ user|avatar:34 }}" srcset="{{ user|avatar:68 }}" width="34" height="34">
          </a>
        </div>
      {% elif settings.enable_oauth2_client %}
        <a class="btn btn-sign-in btn-navbar-sign-in" href="{% url 'misago:oauth2-login' %}">
          {% trans "Sign in" context "cta" %}
        </a>
      {% else %}
        <button class="btn btn-sign-in btn-navbar-sign-in" type="button" disabled>
          {% trans "Sign in" context "cta" %}
        </button>
        <button class="btn btn-register btn-navbar-register" type="button" disabled>
          {% trans "Register" context "cta" %}
        </button>
      {% endif %}
    </div>

  </div>
</nav>