from django.contrib import admin
from models import *
# from forms import ArticleForm

class TabsInline(admin.StackedInline):
    model = ModuleTab
    extra = 4

class ModuleAdmin(admin.ModelAdmin):
    inlines = [TabsInline]
    prepopulated_fields = {'slug': ('title',)}
    save_on_top = True
#    list_display = ('name', 'order',)
#    list_editable = ['order']    

class ButtonsInline(admin.StackedInline):
    model = ModelExtra.buttons.through
    extra = 3

class SortInline(admin.StackedInline):
    model = ModelSort
    extra = 4

class ModelExtraAdmin(admin.ModelAdmin):
    inlines = [SortInline, ButtonsInline]

admin.site.register(Module, ModuleAdmin)
admin.site.register(ModelExtra, ModelExtraAdmin)
admin.site.register(ModelButton)
#admin.site.register(SliderBox, SliderBoxAdmin)

