{% load bootstrap3 %} {% comment %} Render object list as collapsible panels Parameters: object_list Collection of objects to render inside the panels (e.g. queryset or list) attributes.class Class attribute for wrapping div attributes.panel_class Default is "panel panel-default" attributes.text Display a paragraph of text (usually instructions and help) attributes.links Display link buttons above list. Sequence of sequences with (name,url,[arg0,arg1,...]) Each item in the object_list can then have the following parameters: label name of child object to display in panel title bar widget widget for rendering children objects inside panel object_list passed to widget as 'object_list' attributes passed to widget as 'attributes' {% endcomment %}
{% if attributes.text %} {% include "simplecrud/widget/text.html" with object_list=attributes.text %} {% endif %} {% if attributes.links %} {% include "simplecrud/widget/links.html" with object_list=attributes.links %} {% endif %}
{% for panel in object_list %}
{% include panel.widget with object_list=panel.object_list attributes=panel.attributes %}
{% endfor %}