{% extends "base.html" %}
{% load currency_filters %}
{% load category_tags %}
{% load dashboard_tags %}
{% load i18n %}

{% block mainstylesheet %}
	<link rel="stylesheet" href="{{ STATIC_URL }}oscar/css/dashboard.css" />
{% endblock %}

{% block extrahead %} {% endblock extrahead %}

{% block title %}
{% trans "Dashboard" %} | {{ block.super }}
{% endblock %}

{% block layout %}
	{% block navbar %}
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container" style="width: auto;">
				<a href="{% url promotions:home %}" class="brand">{{ shop_name }}</a>
                <ul class="nav pull-right">
                    {% if user.is_authenticated %}
                        <li><span>Welcome <em>{{ user.username }}</em></span></li>
						<li><a href="{% url customer:summary %}" class="app-ico ico_profile">{% trans "Account" %}</a></li>
						<li><a href="{% url customer:logout %}" class="app-ico ico_logout">{% trans "Logout" %}</a></li>
                    {% else %}
					<li><a href="{% url customer:login %}" class="app-ico ico_logout">{% trans "Login" %}</a></li>
                    {% endif %}
                </ul>
            </div>
        </div><!-- /navbar-inner -->
    </div><!-- /navbar -->
	{% endblock navbar %}

    <div class="container-fluid dashboard">
        <div class="row-fluid">
            {% dashboard_navigation request.user %}
			<div class="subnav subnav-fixed">
                <ul class="nav nav-pills">
                    {% for item in nav_items %}	
                        <li class="{{ item.label }} dropdown">
            			{% if item.is_heading %}
        			        <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ item.label }} <b class="caret"></b></a>
            			{% else %}
            			    <a href="{{ item.url }}">{{ item.label }}</a>
            			{% endif %}
            			{% if item.has_children %}
            			    <ul class="dropdown-menu">
            				    {% for subitem in item.children %}
            				    <li><a href="{{ subitem.url }}">{{ subitem.label }}</a></li>
            				    {% endfor %}
            			    </ul>
            			{% endif %}
            			</li>
        			{% endfor %}
                </ul>
            </div>
			
			{% block breadcrumbs %}
			<ul class="breadcrumb">
				<li><a href="{% url dashboard:index %}">{% trans "Dashboard" %}</a> <span class="divider">/</span></li>
            </ul>
            {% endblock %}
            
            <div class="content">
				{% include 'partials/alert_messages.html' %}
                {% block header %}{% endblock %}
                <div class="page-content">
                    {% block content %}
						{% block dashboard_content %}{% endblock dashboard_content %}
                    {% endblock content %}
                </div>
            </div><!-- /span9 --> 

        </div><!-- /row-fluid -->        
    </div><!-- /container -->       
{% endblock %}

{# Block for additional scripts #}
{% block extrascripts %}
    {{ block.super }}
    <script src="{{ STATIC_URL }}oscar/js/oscar/ui.js" type="text/javascript" charset="utf-8"></script>
    <script src="{{ STATIC_URL }}oscar/js/oscar/dashboard.js" type="text/javascript" charset="utf-8"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
	<script type="text/javascript">$(oscar.dashboard.init);</script>
{% endblock %}
