{% extends master_template %}

{% load i18n %}

{% block page-title %}{% if current_workspace %}{{ current_workspace.name }}{% else %}{% trans "Default" %}{% endif %} - {% trans "Public dashboard" %}{% endblock page-title %}

{% block site-title %}{{ dashboard_settings.title }}{% endblock site-title %}

{% block top-nav-menu-wrapper %}
    {% if current_workspace.is_clonable %}
                {% if 'dash.add_dashboardworkspace' in perms and 'dash.add_dashboardentry' in perms %}
            <ul class="menu nav">
                <li class="menu-item">
                    <a href="javascript:;" class="menu-dashboard-settings" title="{% trans 'Menu' %}">
                        <span class="iconic icon-reorder icon-2x"></span>
                    </a>
                    <ul class="submenu">
                        <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" title="{% trans 'Clone this workspace' %}"></span>
                                <span class="textonic">{% trans 'Clone this workspace' %}</span>
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
                {% endif %}
    {% endif %}
{% endblock top-nav-menu-wrapper %}

{% block workspaces-wrapper %}
            {% if workspaces %}
            <ul class="workspaces">
                <li class="menu-item{% if not current_workspace %} active{% endif %}">
                    <a href="{% url 'dash.public_dashboard' user.username %}" title="{% trans 'Default' %}">
                        <span class="iconic {% if not current_workspace %}icon-circle{% else %}icon-circle-blank{% endif %}"></span>
                    </a>
                </li>
                {% for ws in workspaces %}
                <li class="menu-item{% if ws == current_workspace %} active{% endif %}">
                    <a href="{% url 'dash.public_dashboard' user.username ws.slug %}" title="{{ ws.name }}">
                        <span class="iconic {% if ws == current_workspace %}icon-circle{% else %}icon-circle-blank{% endif %}"></span>
                    </a>
                </li>
                {% endfor %}
            </ul>
            {% endif %}
{% endblock workspaces-wrapper %}
