{% extends "admin/base.html" %}
{% load i18n %}{% load admin_static bootstrapped_goodies_tags %}

{% block extrahead %}
<link rel="stylesheet" href="{{STATIC_URL}}base/css/base.css" />
<script src="{{ STATIC_URL }}base/js/fontawesome.js"></script>

{% endblock %}

{% block title %}{{admin_site_title}}{% endblock %}

{% block branding %}
<a class="navbar-brand" href="/"><img src="/static/{{logo}}" height="25" /></a>
{% endblock %}

{% block welcome-msg %}{% endblock %}

{% block logs %}{% endblock %}
{% block userlinks %}{% endblock %}

{% block nav-global %}
    {% block menu_items %}
        {% for key, value, icon in menu_items.items %} 
          <li>
            <a class="btn-sm" type="button" href={{value}}>
              <span class="{{icon}}"></span>
              {{key}}
            </a>
          </li>
        {% endfor %}
        
        <li class="btn-group">
            <a class="btn btn-sm dropdown-toggle" data-toggle="dropdown"> Forecasts <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            {% block forecasts_items %}
              {% for key, value in forecasts_items.items %} 
                <li><a class="btn-sm" type="button" href={{value}}>{{key}}</a></li>
              {% endfor %}
            {% endblock %}
          </ul>
        </li>
    {% endblock %}
      
    {% if user.is_superuser %}
        <li class="btn-group">
            <a class="btn btn-sm dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-wrench"></span> POWER USERS <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            {% block power_menu_items %}
              {% for key, value in power_menu_items.items %} 
                <li><a class="btn-sm" type="button" href={{value}}>{{key}}</a></li>
              {% endfor %}
            {% endblock %}
          </ul>
        </li>
    {% endif %}
    
        <li class="btn-group">
            <a class="btn btn-sm dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-book"></span> {{ company_id }} <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            {% for cmpny in company_list %}
              <li><a href="/choose_company/{{cmpny}}">{{cmpny}}</a></li>
            {% endfor %}
          </ul>
        </li>


      {% if user.username %}
      <li class="btn-group"><a class="btn dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> <strong>{% firstof user.get_full_name user.username user.email %}</strong> <span class="caret"></span></a>
      <ul class="dropdown-menu" role="menu">
          {% block loggedin_options %}{% endblock%}
          {% if HAS_PROFILE %}<li><a href="{% url 'accounts_profile' %}">My profile</a></li>{% endif %}
          <li><a href='/accounts/change_password/'>Change Password</a></li>
          <li><a href='{% url 'accounts_logout' %}'>Logout</a></li>
      </ul>
      </li>
      {% else %}
          <li><a href="{% url 'accounts_login'%}">Login</a></li>
      {% endif %}
{% endblock %}


