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

{% block title %}{{ parent() ~ ' - ' ~ "agenda" | trans({}, "tools") | striptags | raw }}{% endblock %}

{% set calendarPath = 'bundles/frontend/jquery/plugin/calendar/' %}

{% block stylesheets %}
    {{ parent() }}
    <link rel='stylesheet' type='text/css' href='{{ asset(calendarPath ~ 'css/fullcalendar.css') }}'/>
    <link rel='stylesheet' type='text/css' href='{{ asset('bundles/frontend/jquery/jquery-ui-1.9.2.custom/css/ui-lightness/jquery-ui-1.9.2.custom.css') }}'/>
    <link rel='stylesheet' type='text/css' href='{{ asset(calendarPath ~ 'css/fullcalendar.print.css') }}' media='print' />
    <link rel='stylesheet'type='text/css' href='{{ asset('bundles/frontend/jquery/plugin/datepicker/css/datepicker.css') }}' />
{% endblock %}
{% block breadcrumb %}
    {{
        macros.workspaceBreadcrumbs(
        workspace,
            [
                {
                'name': 'agenda'|trans({}, 'tools'),
                'href': ''
                }
            ]
        )
    }}
{% endblock %}
{% block section_content %}
    <div class="panel-heading">
        <h3 class="panel-title">{{ 'agenda'|trans({}, 'platform') }} - {{workspace.getName()}}</h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div id='calendar' class="col-md-9"></div>

            <div class="col-md-3">
                <div class="panel text-center">
                    <a href="{{ path('claro_workspace_agenda_export',{workspace: workspace.getId()}) }}" class="btn btn-default btn-xs"  role="button">
                        {{ 'export'|trans({}, 'agenda') }}
                    </a>
                    <a id="import-ics-btn" href="{{ path('claro_workspace_agenda_import_form', {'workspace': workspace.getId()}) }}"
                       class="btn btn-default btn-xs"
                       role="button"
                            >
                        {{ 'import_agenda_file_file'|trans({}, 'agenda') }}
                    </a>
                </div>

                <div class="panel panel-default">
                    <div data-toggle="collapse" data-target="#panel-tasks" class="panel-heading">{{'tasks'|trans({}, 'agenda')}}</div>
                    <div id="panel-tasks" class="panel-body list-group in" style="padding:0">
                        {% render controller('ClarolineCoreBundle:Tool\\Agenda\\WorkspaceAgenda:tasks', {'workspace': workspace}) %}
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">{{ 'agenda_form_priority'|trans({}, 'agenda') }}</div>
                    <div class="panel-body list-group" style="padding:0">
                        <li class="list-group-item" style="color:#FF0000">  {{ 'high'|trans({}, 'agenda') }} </li>
                        <li class="list-group-item" style="color:#01A9DB"> {{ 'medium'|trans({}, 'agenda') }} </li>
                        <li class="list-group-item" style="color:#848484"> {{ 'low'|trans({}, 'agenda') }} </li>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    <script type='text/javascript' src='{{ asset(calendarPath ~ 'js/fullcalendar.js') }}' ></script>
    <script type='text/javascript'src='{{ asset('bundles/clarolinecore/js/tool/calendar.js') }}'></script>
    <script type='text/javascript'src='{{ asset('bundles/frontend/date.js') }}'></script>
    <script type='text/javascript'>
        $(function () {
            Claroline.Calendar.initialize('workspace', {{ workspace.getId() }}, {{ canCreate }});
        });
    </script>
    <script type="text/javascript" src="{{ url('bazinga_exposetranslation_js', { 'domain_name': 'agenda' }) }}"></script>
    <script type="text/javascript" src="{{ asset('bundles/clarolinecore/js/tool/calendarDatePicker.js') }}"> </script>
    <script type="text/javascript" src="{{ asset('bundles/frontend/jquery/jquery-ui-1.9.2/components/jquery.ui.draggable.min.js') }}"> </script>
    <script type="text/javascript" src="{{ asset('bundles/frontend/jquery/jquery-ui-1.9.2/components/jquery.ui.resizable.min.js') }}"> </script>
{% endblock javascripts %}