from django.contrib import admin
# from django.contrib.auth.models import User
from models import *

class ProjectImageInline(admin.TabularInline):
    model = ProjectImage
    extra = 20


class NoteworthyImageInline(admin.TabularInline):
    model = NoteworthyImage
    extra = 3


class ProjectAdmin(admin.ModelAdmin):
    class Media:
        js = (
            'js/jquery-ui-1.8.16.custom.min.js',
            'js/admin_list_reorder.js',
        )

    prepopulated_fields = {'slug': ('title',)}
    inlines = [ProjectImageInline]
    list_display = ('__unicode__', 'position',)
    list_editable = ('position',)
    exclude = ('position',)
    list_per_page = 500


class NoteworthyAdmin(admin.ModelAdmin):
    class Media:
        js = (
            'js/jquery-ui-1.8.16.custom.min.js',
            'js/admin_list_reorder.js',
        )
    inlines = [NoteworthyImageInline]
    list_display = ('__unicode__', 'position',)
    list_editable = ('position',)
    exclude = ('position',)
    list_per_page = 500

    

#class SliderImageAdmin(admin.ModelAdmin):
#    list_display = ('__unicode__', 'order',)
#    list_editable = ('order',)


admin.site.register(Project, ProjectAdmin)
#admin.site.register(SliderImage, SliderImageAdmin)
admin.site.register(Link)
admin.site.register(Noteworthy, NoteworthyAdmin)
