From b94a8f7eea28c37a84d705a405112a4ba45adf12 Mon Sep 17 00:00:00 2001 From: melinath Date: Wed, 16 Jun 2010 14:29:36 -0400 Subject: [PATCH 1/1] Fixed collapse classes --- admin.py | 15 +++++++++------ .../admin/philo/edit_inline/tabular_collapse.html | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/admin.py b/admin.py index 61a1fb8..e5b93b4 100644 --- a/admin.py +++ b/admin.py @@ -12,6 +12,9 @@ from django.core.exceptions import ValidationError, ObjectDoesNotExist from validators import TreeParentValidator, TreePositionValidator +COLLAPSE_CLASSES = ('collapse', 'collapse-closed', 'closed',) + + class AttributeInline(generic.GenericTabularInline): ct_field = 'entity_content_type' ct_fk_field = 'entity_object_id' @@ -39,7 +42,7 @@ class CollectionMemberInline(admin.TabularInline): fk_name = 'collection' model = CollectionMember extra = 1 - classes = ('collapse-closed',) + classes = COLLAPSE_CLASSES allow_add = True fields = ('member_content_type', 'member_object_id', 'index',) @@ -91,14 +94,14 @@ class TemplateAdmin(admin.ModelAdmin): 'fields': ('parent', 'name', 'slug') }), ('Documentation', { - 'classes': ('collapse', 'collapse-closed'), + 'classes': COLLAPSE_CLASSES, 'fields': ('documentation',) }), (None, { 'fields': ('code',) }), ('Advanced', { - 'classes': ('collapse','collapse-closed'), + 'classes': COLLAPSE_CLASSES, 'fields': ('mimetype',) }), ) @@ -168,7 +171,7 @@ class RedirectAdmin(NodeAdmin): 'fields': ('slug', 'target', 'status_code') }), ('URL/Tree/Hierarchy', { - 'classes': ('collapse', 'collapse-closed'), + 'classes': COLLAPSE_CLASSES, 'fields': ('parent',) }), ) @@ -184,7 +187,7 @@ class FileAdmin(NodeAdmin): 'fields': ('file', 'slug', 'mimetype') }), ('URL/Tree/Hierarchy', { - 'classes': ('collapse', 'collapse-closed'), + 'classes': COLLAPSE_CLASSES, 'fields': ('parent',) }), ) @@ -200,7 +203,7 @@ class PageAdmin(NodeAdmin): 'fields': ('title', 'slug', 'template') }), ('URL/Tree/Hierarchy', { - 'classes': ('collapse', 'collapse-closed'), + 'classes': COLLAPSE_CLASSES, 'fields': ('parent',) }), ) diff --git a/templates/admin/philo/edit_inline/tabular_collapse.html b/templates/admin/philo/edit_inline/tabular_collapse.html index c457297..6aecaf5 100644 --- a/templates/admin/philo/edit_inline/tabular_collapse.html +++ b/templates/admin/philo/edit_inline/tabular_collapse.html @@ -2,7 +2,7 @@