from sets.admin import *
from .models import *
from django.contrib import admin
from django.forms import widgets
# from nested_inline.admin import NestedStackedInline, NestedTabularInline, NestedModelAdmin, NestedInline
from super_inlines.admin import SuperInlineModelAdmin, SuperModelAdmin

class Admin_StackedInline_Slide(Admin_Trans_GenericBaseIconStackedInline):
# class Admin_StackedInline_Block(Admin_Trans_GenericBaseIconStackedInline):

    def formfield_for_dbfield(self, db_field, request, **kwargs):
        field = super(Admin_StackedInline_Slide, self).formfield_for_dbfield(db_field, request, **kwargs)
        return sets_for_formfield_for_dbfield(field, db_field)

    model = Slide
    extra = 0
    fieldsets = [
        (None, {
            'classes': [],
            'fields': [
                (
                    # 'title',
                    'name', 'enable'),
                ('description', 'picture'),
                ('bg_color', ),
                ('but_title', 'but_color'),
                ('url',),
                ('order'),
            ]
        })
    ]



# class Admin_Slide(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
#
#
#     fieldsets = [
#         (None, {
#             'classes': ['wide'],
#             'fields': (
#                 'section', 'parent_service',
#                 'name',
#                 'url',
#                 # 'title',
#                 'description', 'text',
#                 'picture',
#                 'order',
#             )
#         }),
#
#     ]
#
#
#     list_display = [
#         'image_thumb',
#         'id',
#         'content_type', 'content_object',
#         'name', 'url',
#         'enable',
#         # 'title',
#         'order', 'modifiedDT', 'createDT'
#     ]
#
#     ordering = ['order']
#
#     prepopulated_fields = {"url": ("name_en",)}
#
#     list_display_links = ['id', 'name', 'image_thumb']
#     list_editable = ['order', 'enable']
#
#     list_filter = ['modifiedDT', 'createDT', ]
#     search_fields = ['name', 'title']
#     # filter_horizontal = ['options']
#
#
#
# admin.site.register(Slide, Admin_Slide)