Added extra check for object when sorting self-referential models.
parent
612c4f8031
commit
e521d5c8ad
|
|
@ -3,22 +3,25 @@
|
||||||
{% if regrouped_objects %}
|
{% if regrouped_objects %}
|
||||||
<ul {% if sortable_by_class_is_sortable %}class="sortable"{% endif %}>
|
<ul {% if sortable_by_class_is_sortable %}class="sortable"{% endif %}>
|
||||||
{% for regrouped_object in regrouped_objects %}
|
{% for regrouped_object in regrouped_objects %}
|
||||||
<li>
|
{% with object=regrouped_object.grouper %}
|
||||||
{% with object=regrouped_object.grouper %}
|
{% if object %}
|
||||||
{% if sortable_by_class_is_sortable %}
|
<li>
|
||||||
{% render_object_rep object %}
|
{% if sortable_by_class_is_sortable %}
|
||||||
{% else %}
|
{% render_object_rep object %}
|
||||||
{{ object }}
|
{% else %}
|
||||||
{% endif %}
|
{{ object }}
|
||||||
{% endwith %}
|
{% endif %}
|
||||||
{% if regrouped_object.list %}
|
|
||||||
{% with regrouped_object_list_length=regrouped_object.list|length %}
|
{% if regrouped_object.list %}
|
||||||
<ul {% if regrouped_object_list_length > 1 %}class="sortable"{% endif %}>
|
{% with regrouped_object_list_length=regrouped_object.list|length %}
|
||||||
{% render_list_items regrouped_object.list %}
|
<ul {% if regrouped_object_list_length > 1 %}class="sortable"{% endif %}>
|
||||||
</ul>
|
{% render_list_items regrouped_object.list %}
|
||||||
{% endwith %}
|
</ul>
|
||||||
|
{% endwith %}
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
{% endwith %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue