{% load shared static %}
{% htmlmin %}
{# Basic menu list #}
<div class="hide-md">
  <a href="{% url 'linkding:bookmarks.new' %}"
     class="btn btn-primary mr-2">Add bookmark</a>
  <ld-dropdown class="dropdown">
    <button class="btn btn-link dropdown-toggle" tabindex="0">Bookmarks</button>
    <ul class="menu" role="list" tabindex="-1">
      <li class="menu-item">
        <a href="{% url 'linkding:bookmarks.index' %}" class="menu-link">Active</a>
      </li>
      <li class="menu-item">
        <a href="{% url 'linkding:bookmarks.archived' %}" class="menu-link">Archived</a>
      </li>
      {% if request.user_profile.enable_sharing %}
        <li class="menu-item">
          <a href="{% url 'linkding:bookmarks.shared' %}" class="menu-link">Shared</a>
        </li>
      {% endif %}
      <li class="menu-item">
        <a href="{% url 'linkding:bookmarks.index' %}?unread=yes"
           class="menu-link">Unread</a>
      </li>
      <li class="menu-item">
        <a href="{% url 'linkding:bookmarks.index' %}?q=!untagged"
           class="menu-link">Untagged</a>
      </li>
    </ul>
  </ld-dropdown>
  <ld-dropdown class="dropdown">
    <button class="btn btn-link dropdown-toggle" tabindex="0">Settings</button>
    <ul class="menu" role="list" tabindex="-1">
      <li class="menu-item">
        <a href="{% url 'linkding:settings.general' %}" class="menu-link">General</a>
      </li>
      <li class="menu-item">
        <a href="{% url 'linkding:settings.integrations' %}" class="menu-link">Integrations</a>
      </li>
      {% if request.user.is_superuser %}
        <li class="menu-item">
          <a href="{% url 'admin:index' %}" class="menu-link" data-turbo="false">Admin</a>
        </li>
      {% endif %}
    </ul>
  </ld-dropdown>
  <form class="d-inline"
        action="{% url 'logout' %}"
        method="post"
        data-turbo="false">
    {% csrf_token %}
    <button type="submit" class="btn btn-link">Logout</button>
  </form>
</div>
{# Menu drop-down for smaller devices #}
<div class="show-md">
  <a href="{% url 'linkding:bookmarks.new' %}"
     aria-label="Add bookmark"
     class="btn btn-primary">
    <svg width="24" height="24">
      <use href="{% static 'icons.svg' %}?v={{ app_version }}#plus"></use>
    </svg>
  </a>
  <ld-dropdown class="dropdown dropdown-right">
    <button class="btn btn-link dropdown-toggle"
            aria-label="Navigation menu"
            tabindex="0">
      <svg width="24" height="24">
        <use href="{% static 'icons.svg' %}?v={{ app_version }}#menu"></use>
      </svg>
    </button>
    <!-- menu component -->
    <ul class="menu" role="list" tabindex="-1">
      <li class="menu-item">
        <a href="{% url 'linkding:bookmarks.index' %}" class="menu-link">Bookmarks</a>
      </li>
      <li class="menu-item">
        <a href="{% url 'linkding:bookmarks.archived' %}" class="menu-link">Archived bookmarks</a>
      </li>
      {% if request.user_profile.enable_sharing %}
        <li class="menu-item">
          <a href="{% url 'linkding:bookmarks.shared' %}" class="menu-link">Shared bookmarks</a>
        </li>
      {% endif %}
      <li class="menu-item">
        <a href="{% url 'linkding:bookmarks.index' %}?unread=yes"
           class="menu-link">Unread</a>
      </li>
      <li class="menu-item">
        <a href="{% url 'linkding:bookmarks.index' %}?q=!untagged"
           class="menu-link">Untagged</a>
      </li>
      <div class="divider"></div>
      <li class="menu-item">
        <a href="{% url 'linkding:settings.general' %}" class="menu-link">Settings</a>
      </li>
      <li class="menu-item">
        <a href="{% url 'linkding:settings.integrations' %}" class="menu-link">Integrations</a>
      </li>
      {% if request.user.is_superuser %}
        <li class="menu-item">
          <a href="{% url 'admin:index' %}" class="menu-link" data-turbo="false">Admin</a>
        </li>
      {% endif %}
      <div class="divider"></div>
      <li class="menu-item">
        <form class="d-inline"
              action="{% url 'logout' %}"
              method="post"
              data-turbo="false">
          {% csrf_token %}
          <button type="submit" class="btn btn-link menu-link">Logout</button>
        </form>
      </li>
    </ul>
  </ld-dropdown>
</div>
{% endhtmlmin %}
