});
}
callback(new Gilbert.lib.ui.DjangoForm(Ext.applyIf(Ext.applyIf(config||{},{
- title: 'Editing '+model.verbose_name+' ('+pk+')',
+ title: 'Editing '+model.verbose_name.capfirst()+' ('+pk+')',
header: false,
iconCls: 'icon-pencil',
baseCls: 'x-plain',
return new_consequences;
};
+ var new_consequences = convert_consequences_array(consequences);
+ var nested_consequences = false;
+ for(var i=0;i<new_consequences.length;i++){
+ if (!new_consequences[i]['leaf']) {
+ nested_consequences = true;
+ break;
+ }
+ }
+
var tree = this.tree = new Ext.tree.TreePanel({
loader: new Ext.tree.TreeLoader(),
enableDD: false,
'text': 'To be deleted',
'iconCls': 'icon-minus',
'leaf': false,
- 'children': convert_consequences_array(consequences),
+ 'children': new_consequences,
},
useArrows: true,
rootVisible: false,
{
region: 'north',
xtype: 'panel',
- html: 'Are you sure you want to delete these ' + model.verbose_name_plural + '?',
+ html: 'Are you sure you want to delete these ' + model.verbose_name_plural + '?' + (nested_consequences ? ' Nested objects will also be deleted.' : ''),
bodyStyle: 'padding: 15px;',
},
tree,
{ xtype: 'tbseparator' },
edit_action,
delete_action,
- '->',
- {
- text: 'Advanced',
- iconCls: 'icon-gear',
- disabled: true,
- menu: [],
- },
+ //'->',
+ //{
+ // text: 'Advanced',
+ // iconCls: 'icon-gear',
+ // disabled: true,
+ // menu: [],
+ //},
],
}),
items: [grid],
class BlogEntryAdmin(ModelAdmin):
search_fields = ('title', 'content',)
- data_columns = ('title', 'author', 'date',)
+ data_columns = ('title', 'author', 'blog', 'date',)
site.register_model(Blog, BlogAdmin, icon_name='blog')