{% block object-tools %}
-
- {% endblock %}
+
+ {% endblock %}
{% if objects %}
{% if group_expression %}
- {% render_nested_sortable_objects objects group_expression %}
+ {% include "adminsortable/shared/nested_objects.html" %}
{% else %}
- {% render_sortable_objects objects %}
+ {% include "adminsortable/shared/objects.html" %}
{% endif %}
{% csrf_token %}
diff --git a/adminsortable/templates/adminsortable/csrf/jquery.django-csrf.html b/adminsortable/templates/adminsortable/csrf/jquery.django-csrf.html
index 24fb6c3..b9488a8 100644
--- a/adminsortable/templates/adminsortable/csrf/jquery.django-csrf.html
+++ b/adminsortable/templates/adminsortable/csrf/jquery.django-csrf.html
@@ -16,7 +16,7 @@
return cookieValue;
}
- var csrftoken = getCookie('{{ csrf_cookie_name }}');
+ var csrftoken = '{{ csrf_token }}' || getCookie('{{ csrf_cookie_name }}');
function csrfSafeMethod(method) {
// these HTTP methods do not require CSRF protection
diff --git a/adminsortable/templates/adminsortable/edit_inline/stacked-1.5.x.html b/adminsortable/templates/adminsortable/edit_inline/stacked-1.5.x.html
deleted file mode 100644
index c34182d..0000000
--- a/adminsortable/templates/adminsortable/edit_inline/stacked-1.5.x.html
+++ /dev/null
@@ -1,92 +0,0 @@
-{% load i18n admin_modify adminsortable_tags admin_urls %}
-{% load static from staticfiles %}
-
-
-
diff --git a/adminsortable/templates/adminsortable/edit_inline/tabular-1.5.x.html b/adminsortable/templates/adminsortable/edit_inline/tabular-1.5.x.html
deleted file mode 100644
index bdc8348..0000000
--- a/adminsortable/templates/adminsortable/edit_inline/tabular-1.5.x.html
+++ /dev/null
@@ -1,136 +0,0 @@
-{% load i18n admin_modify adminsortable_tags admin_urls %}
-{% load static from staticfiles %}
-
-
-
diff --git a/adminsortable/templates/adminsortable/shared/list_items.html b/adminsortable/templates/adminsortable/shared/list_items.html
index 29df030..21f9005 100644
--- a/adminsortable/templates/adminsortable/shared/list_items.html
+++ b/adminsortable/templates/adminsortable/shared/list_items.html
@@ -1,9 +1,8 @@
-{% load adminsortable_tags %}
{% with list_objects_length=list_objects|length %}
{% for object in list_objects %}
{% if list_objects_length > 1 %}
- {% render_object_rep object forloop %}
+ {% include "adminsortable/shared/object_rep.html" %}
{% else %}
{{ object }}
{% endif %}
diff --git a/adminsortable/templates/adminsortable/shared/nested_objects.html b/adminsortable/templates/adminsortable/shared/nested_objects.html
index 8ef74d9..cf0483b 100644
--- a/adminsortable/templates/adminsortable/shared/nested_objects.html
+++ b/adminsortable/templates/adminsortable/shared/nested_objects.html
@@ -1,4 +1,4 @@
-{% load django_template_additions adminsortable_tags %}
+{% load django_template_additions %}
{% dynamic_regroup objects by group_expression as regrouped_objects %}
{% if regrouped_objects %}
@@ -6,7 +6,7 @@
{% with object=regrouped_object.grouper %}
{% if object %}
- {% if sortable_by_class_is_sortable %}
- {% render_object_rep object forloop %}
+ {% include "adminsortable/shared/object_rep.html" %}
{% else %}
{{ object }}
{% endif %}
@@ -14,7 +14,7 @@
{% if regrouped_object.list %}
{% with regrouped_object_list_length=regrouped_object.list|length %}
1 %}class="sortable"{% endif %}>
- {% render_list_items regrouped_object.list %}
+ {% include "adminsortable/shared/list_items.html" with list_objects=regrouped_object.list %}
{% endwith %}
{% endif %}
diff --git a/adminsortable/templates/adminsortable/shared/object_rep.html b/adminsortable/templates/adminsortable/shared/object_rep.html
index 72c13cd..88e6c6f 100644
--- a/adminsortable/templates/adminsortable/shared/object_rep.html
+++ b/adminsortable/templates/adminsortable/shared/object_rep.html
@@ -1,4 +1,4 @@
-{% load adminsortable_tags admin_urls %}
+{% load admin_urls %}