summaryrefslogtreecommitdiff
path: root/templates/chimere/blocks/categories.html
blob: 0fe73dfb11d3e9670d653a5ce525811e7d5cb2c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{% load i18n %}
    <ul id='ul_categories'>
        {% for category, lst_sub_categories in sub_categories %}
        <li class='main_category {% if category.selected %}toggle_minus{%else%}toggle_plus{%endif%}'>
            <span id='main_category_{{category.pk}}'>
                <i class="triangle"></i>
                <label>{% trans category.name %}</label>
                <img class="control_image toggle_category" id="maincategory_img_{{category.id}}" alt="control" src="{{ STATIC_URL }}saclay/images/{% if category.selected %}minus.png{% else %}plus.png{% endif %}" />
            </span>
            <ul class='subcategories' id='maincategory_{{category.id}}'{% if not category.selected %} style='display:None'{% endif %}>
                {% for sub_category in lst_sub_categories %}
                <li id='li_sub_{{sub_category.id}}' class='subcategory'>
                    <span>
                    <label for='category_{{sub_category.id}}'>
                        {% trans sub_category.name %}
                    </label>
                    <input type='checkbox' name='category_{{sub_category.id}}' id='category_{{sub_category.id}}'{% if sub_category.selected %} checked='checked'{% endif %}/>
                    </span>
                </li>
                {% endfor %}
            </ul>
        </li>
        {% endfor %}
    </ul>
<script type='text/javascript'>
<!--
$(function() {
    if(chimere_init_options && chimere_init_options['checked_categories']){
        for (k=0;k<chimere_init_options['checked_categories'].length;k++){
            $('#li_sub_'+chimere_init_options['checked_categories'][k]+' span'
                                ).addClass('selected');
        }
        chimere_init_options['checked_categories'] = null;
    }
});
// -->
</script>