X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d891cd280793404e5d44e0fe0a3d7e0c70564177..6407cf24cd6cf3f9ea6fdf4a8924dad109a590e6:/src/social/admin.py diff --git a/src/social/admin.py b/src/social/admin.py index 91ebcdba0..708d80b0d 100644 --- a/src/social/admin.py +++ b/src/social/admin.py @@ -4,7 +4,6 @@ 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 @@ -23,17 +22,18 @@ class CiteAdmin(admin.ModelAdmin): list_filter = ['group'] readonly_fields = ['created_at'] autocomplete_fields = ['book'] + search_fields = ['text', 'link', 'picture_alt', 'picture_author', 'picture_link', 'image_title', 'image_author', 'image_link'] fieldsets = ( (None, {'fields': ('group', 'sticky', 'created_at', 'book')}), - (_('Content'), {'fields': ('link', 'vip', 'text', 'small')}), - (_('Media box'), {'fields': ( + ('Zawartość', {'fields': ('link', 'vip', 'text', 'small')}), + ('Media', {'fields': ( 'video', 'picture', 'picture_alt', 'picture_title', 'picture_author', 'picture_link', 'picture_license', 'picture_license_link' )}), ( - _('Background'), + 'Tło', {'fields': ( ('background_plain', 'background_color'), 'image', @@ -47,11 +47,11 @@ class CiteAdmin(admin.ModelAdmin): if cite.text.strip(): return cite.text return "(%s)" % (cite.image_title or cite.link or '-').strip() - nonempty_text.short_description = _('text') + nonempty_text.short_description = 'tekst' def has_image(self, cite): return bool(cite.image) - has_image.short_description = _('image') + has_image.short_description = 'obraz' has_image.boolean = True @@ -69,6 +69,7 @@ admin.site.register(BannerGroup, BannerGroupAdmin) class CarouselItemInline(OrderableAdmin, admin.TabularInline): model = CarouselItem ordering_field = 'order' + autocomplete_fields = ['banner'] class CarouselAdmin(admin.ModelAdmin):