1 # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from django.contrib import admin
9 class SiteBookInline(admin.TabularInline):
10 model = depot.models.SiteBook
14 class BookAdmin(admin.ModelAdmin):
15 inlines = [SiteBookInline]
16 list_display = ['title', 'public', '_published', '_new_publishable', 'project']
17 list_filter = ['public', '_published', '_new_publishable', 'project']
18 prepopulated_fields = {'slug': ['title']}
19 search_fields = ['title']
22 class TagAdmin(admin.ModelAdmin):
23 list_display = ['name', 'ordering']
24 list_editable = ['ordering']
26 admin.site.register(models.Project)
27 admin.site.register(models.Book, BookAdmin)
28 admin.site.register(models.Chunk)
29 admin.site.register(models.Chunk.tag_model, TagAdmin)
31 admin.site.register(models.Image)
32 admin.site.register(models.Image.tag_model, TagAdmin)