{% extends "bootstrap2/fluid_view_layout.html" %}

{% load i18n %}

{% block content-before %}
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container-fluid">
            <button data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar" type="button">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="/" class="brand">{{ dashboard_settings.title }}</a>

            <div class="nav-collapse collapse">
                {% comment %}
                <ul class="nav pull-right">
                {% if request.user.is_authenticated %}
                    <li><a href="{% url 'django.contrib.auth.views.logout' %}">{% trans "Log out" %}</a></li>
                {% else %}
                    <li><a href="{% url 'django.contrib.auth.views.login' %}?next={{ request.path }}">{% trans "Log in" %}</a></li>
                {% endif %}
                </ul>
                {% endcomment %}

                <p class="navbar-text pull-right">
                    {% if request.user.is_authenticated %}
                    <a class="navbar-link" href="{% url 'django.contrib.auth.views.logout' %}">{% trans "Log out" %}</a>
                    {% else %}
                    <a class="navbar-link" href="{% url 'django.contrib.auth.views.login' %}?next={{ request.path }}">{% trans "Log in" %}</a>
                    {% endif %}
                </p>                

            </div>
        </div>
    </div>
</div>

<div class="container-fluid">
{% endblock content-before %}

{% block bootstrap2_workspaces %}
    <li class="nav-header">{% trans "Workspaces" %}</li>
    <li class="{% if not current_workspace %} active{% endif %}">
        <a href="{% url 'dash.public_dashboard' user.username %}" title="{% trans 'Default' %}">
            {% trans 'Default' %}
        </a>
    </li>

    {% if workspaces %}    
        {% for ws in workspaces %}
        <li class="{% if ws == current_workspace %} active{% endif %}">
            <a href="{% url 'dash.public_dashboard' user.username ws.slug %}" title="{{ ws.name }}">
                {{ ws.name }}
            </a>
        </li>
        {% endfor %}
    {% endif %}
{% endblock bootstrap2_workspaces %}

{% block bootstrap2_settings %}
    {% if current_workspace.is_clonable %}
                {% if 'dash.add_dashboardworkspace' in perms and 'dash.add_dashboardentry' in perms %}
            <li class="nav-header">{% trans "Options" %}</li>
            <li class="sub-menu-item">
                <a href="{% url 'dash.clone_dashboard_workspace' current_workspace.pk %}" class="menu-dashboard-clone-workspace" title="{% trans 'Clone this workspace' %}">
                    <span class="iconic icon-copy"></span>
                    <span class="textonic">{% trans "Clone this workspace" %}</span>
                </a>
            </li>
                {% endif %}
    {% endif %}
{% endblock bootstrap2_settings %}

{% block bootstrap2_public_dashboard_url %}
{% endblock bootstrap2_public_dashboard_url %}

{% block bootstrap2_auth_url %}
{% endblock bootstrap2_auth_url %}
