fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix in librarian
[wolnelektury.git]
/
apps
/
social
/
admin.py
diff --git
a/apps/social/admin.py
b/apps/social/admin.py
index
bc0ac0b
..
3da4ae8
100755
(executable)
--- a/
apps/social/admin.py
+++ b/
apps/social/admin.py
@@
-9,20
+9,26
@@
from social.models import Cite
class CiteAdmin(admin.ModelAdmin):
class CiteAdmin(admin.ModelAdmin):
- list_display = ['text', 'sticky', 'vip', 'small', 'has_image']
+ list_display = ['
nonempty_
text', 'sticky', 'vip', 'small', 'has_image']
fieldsets = (
(None, {'fields': ('book', 'text', 'small', 'vip', 'link', 'sticky')}),
(
_('Background'),
fieldsets = (
(None, {'fields': ('book', 'text', 'small', 'vip', 'link', 'sticky')}),
(
_('Background'),
- {'fields': ('image', 'image_title', 'image_author',
+ {'fields': ('image', 'image_
shift', 'image_
title', 'image_author',
'image_link', 'image_license', 'image_license_link')
}
)
)
'image_link', 'image_license', 'image_license_link')
}
)
)
+ def nonempty_text(self, cite):
+ if cite.text.strip():
+ return cite.text
+ return "(%s)" % (cite.image_title.strip() or cite.link)
+ nonempty_text.short_description = _('text')
+
def has_image(self, cite):
return bool(cite.image)
def has_image(self, cite):
return bool(cite.image)
- has_image.description = _('image')
+ has_image.
short_
description = _('image')
has_image.boolean = True
has_image.boolean = True