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 django.utils.translation import gettext_lazy as _
from admin_ordering.admin import OrderableAdmin
from social.models import Cite, BannerGroup, Carousel, CarouselItem
list_display = ['nonempty_text', 'created_at', 'sticky', 'vip', 'small', 'has_image']
list_filter = ['group']
readonly_fields = ['created_at']
- raw_id_fields = ['book']
+ 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')}),
'picture', 'picture_alt',
'picture_title', 'picture_author', 'picture_link',
'picture_license', 'picture_license_link'
-
- #'banner',
)}),
(
_('Background'),
{'fields': (
('background_plain', 'background_color'),
- 'image', 'image_shift',
- 'banner',
+ 'image',
'image_title', 'image_author', 'image_link',
'image_license', 'image_license_link'
)},
class CarouselItemInline(OrderableAdmin, admin.TabularInline):
model = CarouselItem
ordering_field = 'order'
+ autocomplete_fields = ['banner']
class CarouselAdmin(admin.ModelAdmin):
+ list_display = ['placement', 'priority', 'language']
inlines = [CarouselItemInline]