Permalink
Browse files

feedback in imageset plugin admin

  • Loading branch information...
1 parent 1684d9a commit c521364d2c28cf63606308b7341b7d8f435a78f9 @evildmp committed Oct 22, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 arkestra_image_plugin/cms_plugins.py
View
14 arkestra_image_plugin/cms_plugins.py
@@ -337,6 +337,8 @@ class ImageSetItemEditor(SupplyRequestMixin, admin.StackedInline, AutocompleteMi
# related_search_fields = ['destination_content_type']
model=ImageSetItem
extra=1
+
+
fieldset_basic = ('', {'fields': (('image',),)})
fieldset_advanced = ('Caption', {
'fields': (( 'auto_image_title', 'manual_image_title'), ( 'auto_image_caption', 'manual_image_caption'),),
@@ -378,16 +380,26 @@ class ImageSetPublisher(SupplyRequestMixin, CMSPluginBase):
raw_id_fields = ('image',)
inlines = (ImageSetItemEditor,)
admin_preview = False
- fieldset_basic = ('Size & proportions', {'fields': (('kind', 'width', 'aspect_ratio',),)})
+ fieldset_basic = ('Size & proportions', {'fields': ('notes', ('kind', 'width', 'aspect_ratio',),)})
fieldset_advanced = ('Advanced', {'fields': (( 'float', 'height'),), 'classes': ('collapse',)})
fieldset_items_per_row = ('For Multiple and Lightbox plugins only', {'fields': ('items_per_row',), 'classes': ('collapse',)})
fieldsets = (fieldset_basic, fieldset_items_per_row, fieldset_advanced)
+ readonly_fields = ["notes", ]
def __init__(self, model = None, admin_site = None):
self.admin_preview = False
self.text_enabled = True
super(ImageSetPublisher, self).__init__(model, admin_site)
+ def notes(self,instance):
+ if not instance.imageset_item.count():
+ message = u"There are currently no items in this set."
+ elif instance.imageset_item.count() == 1:
+ message = u"There is currently only one item in this set."
+ else:
+ message = u"There are currently %s items in this set." % instance.imageset_item.count()
+ return message
+
def render(self, context, imageset, placeholder):
# don't do anything if there are no items in the imageset

0 comments on commit c521364

Please sign in to comment.