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)
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']