{% load static i18n %}
<header class="main-header">

    <a href="/" class="logo">
        <span class="logo-mini"><b>{{ TX_LOGO_NAME_SMALL_START }}</b>{{ TX_LOGO_NAME_SMALL_END }}</span>
        <span class="logo-lg"><b>{{ TX_LOGO_NAME_START }}</b>{{ TX_LOGO_NAME_END }}</span>
    </a>

    <nav class="navbar navbar-static-top">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
            <span class="sr-only">{% trans "Toggle navigation" %}</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>

        {% include 'trionyx/base/global_search.html' %}

        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">

                <li id="trionyx-app-tasks" class="dropdown tasks-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
                      <i class="fa fa-tasks"></i>
                      <span class="label label-danger" v-cloak="">[[openTasks]]</span>
                    </a>
                    <ul class="dropdown-menu">
                      <li>
                        <!-- inner menu: contains the actual data -->
                        <ul class="menu">
                          <li v-for="task in tasks"><!-- Task item -->
                            <a v-bind:href="task.url">
                              <h3>
                                  <span class="label" v-bind:class="getLabelClass(task)">[[task.status_display]]</span>
                                  [[task.description]]
                                <small class="pull-right"> [[task.progress]]%</small>
                              </h3>
                              <div class="progress xs">
                                <div
                                    class="progress-bar progress-bar-theme"
                                    role="progressbar"
                                    aria-valuemin="0"
                                    aria-valuemax="100"
                                    v-bind:aria-valuenow="task.progress"
                                    v-bind:style="{ width: task.progress + '%' }"
                                >
                                  <span class="sr-only">[[task.progress]]% {% trans 'Complete' %}</span>
                                </div>
                              </div>
                            </a>
                          </li>
                        </ul>
                      </li>
                      <li class="footer">
                        <a href="{{ tx_tasks_url }}">{% trans 'View all tasks' %}</a>
                      </li>
                    </ul>
                </li>

                <!-- User Account: style can be found in dropdown.less -->
                <li class="dropdown user user-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <img src="{%if user.avatar %}{{ MEDIA_URL }}{{ user.avatar }}{% else %}{% static 'img/avatar.png'%}{% endif %}" class="user-image" alt="User Image">
                        <span class="hidden-xs">
                            {{ user.get_full_name }}
                        </span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-header">
                            <img src="{%if user.avatar %}{{ MEDIA_URL }}{{ user.avatar }}{% else %}{% static 'img/avatar.png'%}{% endif %}" class="img-circle" alt="User Image">

                            <p>
                                {{ user.get_full_name }}
                                <small>{% trans "Member since" %} {{ user.date_joined|date:"M: Y" }}</small>
                            </p>
                        </li>
                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <div class="pull-left">
                                <a href="{% url 'trionyx:view-account' %}" class="btn btn-flat btn-default btn-flat">
                                    {% trans "Profile" %}
                                </a>
                            </div>
                            <div class="pull-right">
                                <a href="{% url 'trionyx:logout' %}" class="btn btn-flat btn-default btn-flat">
                                    {% trans "Sign out" %}
                                </a>
                            </div>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
</header>