0.0.30 3th section main_block_w_subblocks
This commit is contained in:
@@ -119,10 +119,27 @@ class Admin_StaticPage(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
|
||||
admin.site.register(StaticPage,Admin_StaticPage)
|
||||
|
||||
class Admin_Block(Admin_Trans_BaseModelViewPage):
|
||||
fieldsets = [
|
||||
(None, {
|
||||
'classes': [],
|
||||
'fields': [
|
||||
('block_type',
|
||||
# 'title',
|
||||
'name', 'description', 'picture'),
|
||||
('bg_color', 'bg_image'),
|
||||
('but_title', 'but_color', 'but_icon'),
|
||||
('url',),
|
||||
('child_in_row_count', 'order'),
|
||||
]
|
||||
})
|
||||
]
|
||||
|
||||
inlines = [Admin_Inline_WidgetForBlock]
|
||||
|
||||
|
||||
inlines = [Admin_StackedInline_Block]
|
||||
list_display = ['name', 'block_type', 'enable', 'content_type', 'object_id']
|
||||
list_editable = ['enable']
|
||||
search_fields = ['name']
|
||||
list_filter = ['block_type', 'enable', 'content_type']
|
||||
|
||||
def has_delete_permission(self, request, obj=None):
|
||||
if request.user.is_superuser:
|
||||
@@ -131,7 +148,7 @@ class Admin_Block(Admin_Trans_BaseModelViewPage):
|
||||
if obj.name in ('About US', 'machines', 'works'):
|
||||
return False
|
||||
|
||||
admin.site.register(Block,Admin_Block)
|
||||
admin.site.register(Block, Admin_Block)
|
||||
|
||||
class Admin_Option(Admin_Trans_BaseModel):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user