1 from django.contrib import admin
2 from django import forms
3 from admin_ordering.admin import OrderableAdmin
4 from modeltranslation.admin import TranslationAdmin
8 class BannerAdmin(TranslationAdmin):
11 'text_color', 'background_color',
12 'priority', 'since', 'until',
13 'show_members', 'staff_preview', 'only_authenticated']
16 admin.site.register(models.Banner, BannerAdmin)
19 class DTITForm(forms.ModelForm):
21 model = models.DynamicTextInsertText
24 'background_color': forms.TextInput(attrs={"type": "color"}),
25 'text_color': forms.TextInput(attrs={"type": "color"}),
29 class DynamicTextInsertTextInline(admin.TabularInline):
30 model = models.DynamicTextInsertText
32 fields = ['text', 'image', 'own_colors', 'background_color', 'text_color']
38 class DynamicTextInsertAdmin(admin.ModelAdmin):
39 list_display = ['paragraphs']
40 inlines = [DynamicTextInsertTextInline]
43 admin.site.register(models.DynamicTextInsert, DynamicTextInsertAdmin)
46 class MediaInsertTextInline(OrderableAdmin, admin.TabularInline):
47 model = models.MediaInsertText
52 @admin.register(models.MediaInsertSet)
53 class MediaInsertSetAdmin(admin.ModelAdmin):
54 list_display = ['file_format', 'etag']
55 inlines = [MediaInsertTextInline]
56 readonly_fields = ['etag']