X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/019dfd7e87efcf03b08decb7af6552df3e3df215..05cca019b7dba62e457feb47df10e7a41dd939ef:/src/social/admin.py?ds=sidebyside diff --git a/src/social/admin.py b/src/social/admin.py old mode 100755 new mode 100644 index 75c7156ef..6e5bf3ab5 --- a/src/social/admin.py +++ b/src/social/admin.py @@ -2,23 +2,44 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.contrib import admin +from django.forms import ModelForm +from django.forms.widgets import TextInput from django.utils.translation import ugettext_lazy as _ from admin_ordering.admin import OrderableAdmin from social.models import Cite, BannerGroup, Carousel, CarouselItem +class CiteForm(ModelForm): + class Meta: + model = Cite + fields = '__all__' + widgets = { + 'background_color': TextInput(attrs={'type': 'color'}), + } + class CiteAdmin(admin.ModelAdmin): + form = CiteForm list_display = ['nonempty_text', 'created_at', 'sticky', 'vip', 'small', 'has_image'] list_filter = ['group'] readonly_fields = ['created_at'] + autocomplete_fields = ['book'] fieldsets = ( - (None, {'fields': ('group', 'sticky', 'created_at')}), - (_('Content'), {'fields': ('book', 'text', 'small', 'vip', 'link', 'video', 'picture', 'banner')}), + (None, {'fields': ('group', 'sticky', 'created_at', 'book')}), + (_('Content'), {'fields': ('link', 'vip', 'text', 'small')}), + (_('Media box'), {'fields': ( + 'video', + 'picture', 'picture_alt', + 'picture_title', 'picture_author', 'picture_link', + 'picture_license', 'picture_license_link' + )}), ( _('Background'), {'fields': ( - 'image', 'image_shift', 'image_title', 'image_author', - 'image_link', 'image_license', 'image_license_link')}, + ('background_plain', 'background_color'), + 'image', + 'image_title', 'image_author', 'image_link', + 'image_license', 'image_license_link' + )}, ) )