{% extends "hdabo_base.html" %}
    {% block title %}HDA - BO : Fiches pour {{ orga_name }}{% endblock %}

    {% block js_import %}
    {{block.super}}
    <script type="text/javascript" src="{{STATIC_URL}}hdabo/js/jquery-ui.min.js"></script>
    <script type="text/javascript" src="{{STATIC_URL}}hdabo/js/jquery.jeditable.js"></script>
    {% endblock %}
    
    {% block js_declaration %}
    {{block.super}}
    {% if valid != "2" %}
    <script type="text/javascript">
    
    var global_csrf_token = "{{ csrf_token }}";
    var static_url = "{{STATIC_URL}}";
    var tag_up_down_url = "{% url hdabo.views.tag_up_down %}";
    var remove_tag_from_list_url = "{% url hdabo.views.remove_tag_from_list %}";
    var validate_wp_link_url = "{% url hdabo.views.validate_wp_link %}";
    var modify_tag_url = "{% url hdabo.views.modify_tag %}";
    var reset_wp_info_url = "{% url hdabo.views.reset_wikipedia_info %}";
    var add_tag_url = "{% url hdabo.views.add_tag %}";
    var remove_wp_link_url = "{% url hdabo.views.remove_wp_link %}";
    
    $(document).ready(function(){
        init_tags_events();
    });
    </script>
    {% endif %}
    {% endblock %}

    {% block css_import %}
    {{block.super}}
    <link rel="stylesheet" href="{{STATIC_URL}}hdabo/css/smoothness/jquery-ui-1.8.13.custom.css" type="text/css"/>
    {% endblock %}

    {% block css_declaration %}
    {{block.super}}
    <style type="text/css">
    .ui-autocomplete {
        max-height: 100px;
        overflow-y: auto;
        /* prevent horizontal scrollbar */
        overflow-x: hidden;
        /* add padding to account for vertical scrollbar */
        padding-right: 20px;
    }
    </style>
    {% endblock %}
    
    
    {% block content %}
    {{block.super}}
    <p>Fiche(s) pour l'organisation <b>{{ orga_name }}</b> : {{nb_sheets}} fiche(s)</p>
    {% if valid != "2" %}
    <div id="count_nav_top">
        <p><a href="{% url hdabo.views.list_for_orga orga_id=orga_id, valid=valid, start_index=0 %}">&lt;&lt;</a>&nbsp;&nbsp;
           <a href="{% url hdabo.views.list_for_orga orga_id=orga_id, valid=valid, start_index=prev_index %}">&lt;</a>&nbsp;&nbsp;
           {{displayed_index}}/{{nb_sheets}}&nbsp;&nbsp;
           <a href="{% url hdabo.views.list_for_orga orga_id=orga_id, valid=valid, start_index=next_index %}">&gt;</a>&nbsp;&nbsp;
           <a href="{% url hdabo.views.list_for_orga orga_id=orga_id, valid=valid, start_index=last_index %}">&gt;&gt;</a></p>
    </div>
    {% endif %}
    <table>
    {% for ds in datasheets %}
    <tr class="imageline {% cycle 'hdaboevenline' 'hdabooddline' %}"><td>
    {% include "partial/one_sheet.html" %}
    </td></tr>
    {% endfor %}
    </table>
    {% if valid != "2" %}
    <div id="count_nav_bottom">
        <p><a href="{% url hdabo.views.list_for_orga orga_id=orga_id, valid=valid, start_index=0 %}">&lt;&lt;</a>&nbsp;&nbsp;
           <a href="{% url hdabo.views.list_for_orga orga_id=orga_id, valid=valid, start_index=prev_index %}">&lt;</a>&nbsp;&nbsp;
           {{displayed_index}}/{{nb_sheets}}&nbsp;&nbsp;
           <a href="{% url hdabo.views.list_for_orga orga_id=orga_id, valid=valid, start_index=next_index %}">&gt;</a>&nbsp;&nbsp;
           <a href="{% url hdabo.views.list_for_orga orga_id=orga_id, valid=valid, start_index=last_index %}">&gt;&gt;</a></p>
    </div>
    {% endif %}
    {% endblock %}
