diff --git a/categories/admin.py b/categories/admin.py
index ac4712a..8310df3 100644
--- a/categories/admin.py
+++ b/categories/admin.py
@@ -3,7 +3,7 @@ from django.contrib import admin
from django import forms
from django.template.defaultfilters import slugify
from mptt.forms import TreeNodeChoiceField
-from editor import TreeEditorMixin
+from editor.tree_editor import TreeEditor
class NullTreeNodeChoiceField(forms.ModelChoiceField):
"""A ModelChoiceField for tree nodes."""
@@ -57,7 +57,7 @@ class CategoryAdminForm(forms.ModelForm):
return self.cleaned_data
-class CategoryAdmin(TreeEditorMixin, admin.ModelAdmin):
+class CategoryAdmin(TreeEditor, admin.ModelAdmin):
form=CategoryAdminForm
list_display = ('__unicode__',)
search_fields = (('name',))
diff --git a/categories/models.py b/categories/models.py
index 2b253f5..2f89377 100644
--- a/categories/models.py
+++ b/categories/models.py
@@ -24,7 +24,7 @@ class Category(models.Model):
class Meta:
verbose_name_plural = 'categories'
unique_together = ('parent', 'name')
- ordering = ('name',)
+ ordering = ('tree_id','lft')
def __unicode__(self):
ancestors = self.get_ancestors()
diff --git a/categories/templates/admin/editor/_messages.html b/categories/templates/admin/editor/_messages.html
deleted file mode 100644
index 609c643..0000000
--- a/categories/templates/admin/editor/_messages.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{% load i18n %}
-
- DELETE_MESSAGES = ["{% trans "Really delete item?" %}", "{% trans "Confirm to delete item" %}",
- "{% trans "Item deleted successfully." %}", "{% trans "Cannot delete item" %}",
- "{% trans "Cannot delete item, because it is parent of at least one other item." %}"];
- TREE_SAVED_MESSAGE = "{% trans "Tree saved successfully." %}";
- CHANGE_TEMPLATE_MESSAGES = ["{% trans "Change template" %}",
- "{% trans "Really change template?
All content will be moved to main region." %}"];
diff --git a/categories/templates/admin/editor/box.html b/categories/templates/admin/editor/box.html
deleted file mode 100644
index 9d08e3b..0000000
--- a/categories/templates/admin/editor/box.html
+++ /dev/null
@@ -1 +0,0 @@
-
- {% trans "Expand all" %} - {% trans "Collapse all" %} -
-| {{ header.text|capfirst }} - {% endfor %} - | {% trans "Delete" %} | -
|---|