{% extends 'ClarolineCoreBundle::layout.html.twig' %}

{% block title %}{{ 'desktop' | trans({}, 'platform') | striptags | raw }}{% endblock %}

{% block breadcrumb %}
    <div id="resource-breadcrumb">
        {% if _resource is defined %}
            <div id="twig-resource-attributes"
                 data-resource-id="{{ _resource.getId() }}"
                 data-resource-name="{{ _resource.getName() }}"
                    >
            </div>
            {% if not is_path_mode  %}
                <ul class="breadcrumb">
                    <li><a href="{{ path('claro_desktop_open') }}"><i class="fa fa-briefcase"></i> {{ 'desktop'|trans({}, 'platform') }}</a></li>
                    <li><a href="{{ path('claro_desktop_open_tool', {'toolName': 'resource_manager'}) }}">{{ 'resources'|trans({}, 'platform') }}</a></li>
                    {% render controller("ClarolineCoreBundle:Resource:renderBreadcrumbs",
                    {'node': _resource.getResourceNode(), '_breadcrumbs': app.request.query.get('_breadcrumbs', {})})
                    %}
                    {% block resourceBreadcrumb %}
                        <li class="active">{{ _resource.getResourceNode().getName() }}</li>
                    {% endblock %}
                </ul>
            {% endif %}
        {% endif %}
    </div>
{% endblock %}

{% block leftbar %}
    {% if not is_path_mode %}
        <div class="list-group menu">
            <div class="list-group-item disabled">{{ 'desktop'|trans({}, 'platform') }}</div>
            {% render controller("ClarolineCoreBundle:Desktop:renderToolList") %}
        </div>
    {% endif %}
{% endblock %}

{% block content %}
    <div class="visible-xs">
        {{ block("leftbar") }}
    </div>
    <div class="section-content">
        <div class="panel panel-default">
            {% block section_content %}{% endblock %}
        </div>
    </div>
    {% block section_after_content %}{% endblock %}

{% endblock %}

{% block javascripts %}
    {{ parent() }}
    <script type="text/javascript">
        window.Workspace = {};
        {% if _resource is defined %}
        window.Workspace.id = {{ _resource.getResourceNode().getWorkspace().getId() }};
        {% else %}
        window.Workspace.id = null;
        {% endif %}
    </script>
{% endblock %}
