{% load category_tags %}
<div id="{{attrs.id}}_container" class="tree-container">
<ul {{ attrs_str }}>
{% if display_root %}
	{% for object in roots %}
	{% render_node root=object %}
	{% endfor %}
{% else %}
	{% for object in roots %}
	{% for child in object.children %}
	{% render_node root=child %}
	{% endfor %}
	{% endfor %}
{% endif %}
</ul>
<script>
$(document).ready(function(){
	$("ul#{{ attrs.id }}").treeview({
		persist: "location",
		collapsed: {% if collapse %}true{% else %}false{% endif %},
		cookieId: '{{ attrs.id }}',
		unique: true,
	});
});
</script>
</div>