{% extends "webclient/data/containers.html" %}
{% load i18n %}

{% comment %}
<!--
  Copyright (C) 2016 University of Dundee & Open Microscopy Environment.
  All rights reserved.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.

  Author: Aleksandra Tarkowska <A(dot)Tarkowska(at)dundee(dot)ac(dot)uk>,

  Version: 1.0
-->
{% endcomment %}

{% block link %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'mapr/css/ome.mapr.css'|add:url_suffix %}" type="text/css" />
{% endblock %}

{% block script %}
    
    {{ block.super }}

    <script type="text/javascript">

        {% if map_value %}
            WEBCLIENT.URLS.api_experimenter = "{% url 'mapannotations_api_experimenters' menu map_value %}";
        {% else %}
            WEBCLIENT.URLS.api_experimenter = "{% url 'mapannotations_api_experimenters' menu %}";
        {% endif %}

        WEBCLIENT.URLS.tree_top_level = "{% url 'mapannotations_api_mapannotations' menu %}";
        WEBCLIENT.URLS.tree_map_level = WEBCLIENT.URLS.tree_top_level;
        
        WEBCLIENT.URLS.api_tags_and_tagged = WEBCLIENT.URLS.tree_top_level;
        
        WEBCLIENT.URLS.api_datasets = "{% url 'mapannotations_api_datasets' menu %}";
        WEBCLIENT.URLS.api_images = "{% url 'mapannotations_api_images' menu %}";
        WEBCLIENT.URLS.api_plates = "{% url 'mapannotations_api_plates' menu %}";
        WEBCLIENT.URLS.api_plate_acquisitions = WEBCLIENT.URLS.api_images;

        {% if map_value %}
            WEBCLIENT.URLS.api_paths_to_object = "{% url 'mapannotations_api_paths_to_object' menu map_value %}";
        {% else %}
            WEBCLIENT.URLS.api_paths_to_object = "{% url 'mapannotations_api_paths_to_object' menu %}";
        {% endif %}

        var MAPANNOTATIONS = {}
        MAPANNOTATIONS.URLS = {'static_webclient': "{% static 'mapr' %}/"};
        MAPANNOTATIONS.URLS.autocomplete = "{% url 'mapannotations_autocomplete' menu %}";
        MAPANNOTATIONS.URLS.autocomplete_default = "{% url 'mapannotations_api_experimenters' menu %}";

        MAPANNOTATIONS.MENU = {'label': "{{ menu }}"};
        MAPANNOTATIONS.VALUE = "{{ value }}";

    </script>

    <script src="{% static 'mapr/javascript/ome.mapr.js'|add:url_suffix %}" type="text/javascript"></script>
    <script src="{% static 'mapr/javascript/ome.mapr.ui.autocomplete.js'|add:url_suffix %}" type="text/javascript"></script>
    
    <!-- include code to handle primary 'thumbs' middle plugin -->
    <script src="{% static 'mapr/javascript/center_plugin.thumbs.js'|add:url_suffix %}" type="text/javascript"></script>

{% endblock %}


{% block left %}

    <div id="left_panel_tabs" class="absolute_fill ui-tabs">

        <!-- toolbar above tree -->
        <div>

            <!-- Show Tags toolbar for tag page... -->
            <ul class="toolbar">

                <li><input id="refreshButton" class="button" type="image" src="{% static "webclient/image/icon_toolbar_refresh.png" %}" alt="Refresh" title="Refresh" /></li>

                <li class="seperator"></li>

                <li>
                    <div class="search filtersearch autocompletesearch" id="autocompletesearch">
                        <label for="id_autocomplete">Type {{ menu_default }}...</label>
                        <input type="text" name="id_autocomplete" id="id_autocomplete" title="Search using a {{ menu_default }} ({{ menu_all }}).">
                    </div>
                </li>

                <li style="float:right">
                    <input id="search_hints" type="image" class="button" src="{% static "webgateway/img/help16.png" %}" data-content="Please start typing to search for {{ menu_default }}. Autocomplete will help you to enter {{ menu_default }} ({{ menu_all }}) by automatically filling information in as you type."/>
                </li>
            </ul>

            <div class="clear"></div>

            <div id="tree_details" class="left_panel_inner">
                <div class="dataTree" id="dataTree"></div>
            </div>
        </div>

    </div>
{% endblock %}
