X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/71209be8f9c399340bddb819f71e99ecf116187b..a1edf3f1a7cff6e6f4d85a4288ca9b1d5cd3b254:/apps/social/admin.py diff --git a/apps/social/admin.py b/apps/social/admin.py index f32f42612..01b4c6578 100755 --- a/apps/social/admin.py +++ b/apps/social/admin.py @@ -3,12 +3,27 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.contrib import admin +from django.utils.translation import ugettext_lazy as _ from social.models import Cite class CiteAdmin(admin.ModelAdmin): - list_display = ['text', 'vip', 'small'] + list_display = ['text', 'sticky', 'vip', 'small', 'has_image'] + fieldsets = ( + (None, {'fields': ('book', 'text', 'small', 'vip', 'link', 'sticky')}), + ( + _('Background'), + {'fields': ('image', 'image_shift', 'image_title', 'image_author', + 'image_link', 'image_license', 'image_license_link') + } + ) + ) + + def has_image(self, cite): + return bool(cite.image) + has_image.description = _('image') + has_image.boolean = True admin.site.register(Cite, CiteAdmin)