{% 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 title %}
{% trans "Dashboard" %} | {{ block.super }}
{% endblock %}

{% block layout %}
    {% block navbar %}
    <div class="navbar navbar-fixed-top navbar-inverse">
        <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>{% trans "Welcome" %} <em>{{ request.user.get_full_name|default:'Guest' }}</em></span></li>
						<li><a href="{% url customer:summary %}"><i class="icon-user"></i> {% trans "Account" %}</a></li>
						<li><a href="{% url customer:logout %}"><i class="icon-signout"></i> {% trans "Logout" %}</a></li>
                    {% endif %}
                </ul>
            </div>
        </div><!-- /navbar-inner -->
    </div><!-- /navbar -->
    {% endblock navbar %}

    <div class="container-fluid dashboard">
        {% block dashboard_nav %}
        <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>
		</div>
		{% endblock %}

        {% 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 %}
            <div class="page-header action">
                <h1>{% block headertext %}{% endblock %}</h1>
            </div>
            {% endblock %}
            <div class="page-content">
                {% block content %}
                    {% block dashboard_content %}{% endblock dashboard_content %}
                {% endblock content %}
            </div>
        </div>
    </div><!-- /container -->       
{% endblock %}

{% block extrahead %}
	<link rel="stylesheet" href="{{ STATIC_URL }}oscar/js/bootstrap-wysihtml5/bootstrap-wysihtml5-0.0.2.css" />
{% endblock %}

{% block extrascripts %}
    {{ block.super }}
    <script src="{{ STATIC_URL }}oscar/js/plugins/plugins.js" type="text/javascript" charset="utf-8"></script>

	{# WYSIHTML5 #}
    <script src="{{ STATIC_URL }}oscar/js/bootstrap-wysihtml5/wysihtml5-0.3.0_rc2.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="{{ STATIC_URL }}oscar/js/bootstrap-wysihtml5/bootstrap-wysihtml5-0.0.2.js" type="text/javascript" charset="utf-8"></script>

    <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.8.23/jquery-ui.min.js"></script>

	{# Trigger dashboard javascript initialisation #}
    <script type="text/javascript">$(oscar.dashboard.init);</script>
{% endblock %}
