X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/8952b9530d943655e552ea660c47e850123c5105..18aa8ca52202003e5628a882f3469a04d905cc05:/src/annoy/admin.py diff --git a/src/annoy/admin.py b/src/annoy/admin.py index 24e977e2b..ab7be6aca 100644 --- a/src/annoy/admin.py +++ b/src/annoy/admin.py @@ -1,11 +1,16 @@ from django.contrib import admin from django import forms +from admin_ordering.admin import OrderableAdmin from modeltranslation.admin import TranslationAdmin from . import models class BannerAdmin(TranslationAdmin): - list_display = ['place', 'text', 'priority', 'since', 'until', 'show_members', 'staff_preview'] + list_display = [ + 'place', 'text', + 'text_color', 'background_color', + 'priority', 'since', 'until', + 'show_members', 'staff_preview', 'only_authenticated'] admin.site.register(models.Banner, BannerAdmin) @@ -36,3 +41,16 @@ class DynamicTextInsertAdmin(admin.ModelAdmin): admin.site.register(models.DynamicTextInsert, DynamicTextInsertAdmin) + + +class MediaInsertTextInline(OrderableAdmin, admin.TabularInline): + model = models.MediaInsertText + extra = 0 + min_num = 1 + + +@admin.register(models.MediaInsertSet) +class MediaInsertSetAdmin(admin.ModelAdmin): + list_display = ['file_format', 'etag'] + inlines = [MediaInsertTextInline] + readonly_fields = ['etag']