X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f5129e7c47fa5fcf0a20f04249b90afcbc54cb9c..201f2a98ead96ca22a02015debdbbd9ac5deeb0f:/src/annoy/admin.py?ds=inline diff --git a/src/annoy/admin.py b/src/annoy/admin.py index 7a82d6867..24e977e2b 100644 --- a/src/annoy/admin.py +++ b/src/annoy/admin.py @@ -7,13 +7,27 @@ from . import models class BannerAdmin(TranslationAdmin): list_display = ['place', 'text', 'priority', 'since', 'until', 'show_members', 'staff_preview'] - + admin.site.register(models.Banner, BannerAdmin) +class DTITForm(forms.ModelForm): + class Meta: + model = models.DynamicTextInsertText + fields = '__all__' + widgets = { + 'background_color': forms.TextInput(attrs={"type": "color"}), + 'text_color': forms.TextInput(attrs={"type": "color"}), + } + + class DynamicTextInsertTextInline(admin.TabularInline): model = models.DynamicTextInsertText - fields = ['text', 'image', 'background_color', 'text_color'] + form = DTITForm + fields = ['text', 'image', 'own_colors', 'background_color', 'text_color'] + extra = 0 + min_num = 1 + class DynamicTextInsertAdmin(admin.ModelAdmin):