Skip to content

Commit

Permalink
configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
fivethreeo committed Sep 14, 2011
1 parent 6de63f3 commit 145816f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmsplugin_filer_gallery/cms_plugins.py
Expand Up @@ -14,7 +14,7 @@ class FilerGalleryPlugin(CMSPluginBase):

def render(self, context, instance, placeholder):
config = simplejson.dumps({
'animation': instance.animation.get_display(), # fade, horizontal-slide, vertical-slide, horizontal-push
'animation': instance.get_animation_display(), # fade, horizontal-slide, vertical-slide, horizontal-push
'animationSpeed': instance.speed, # how fast animations are
'timer': instance.timer, # True or False to have the timer
'advanceSpeed': instance.advanced_speed, # if timer is enabled, time between transitions
Expand All @@ -23,12 +23,13 @@ def render(self, context, instance, placeholder):
'startClockOnMouseOutAfter': instance.start_after, # how long after MouseOut should the timer start again
'directionalNav': instance.directional_nav, # manual advancing directional navs
'captions': instance.captions, # do you want captions?
'captionAnimation': instance.caption_animation.get_display(), # fade, slideOpen, none
'captionAnimation': instance.get_caption_animation_display(), # fade, slideOpen, none
'captionAnimationSpeed': instance.caption_speed, # if so how quickly should they animate in
'bullets': instance.bullets # True or False to activate the bullet navigation
})
context.update({
'instance': instance,
'size': (instance.height, instance.width),
'orbit_config': config
})
return context
Expand Down
4 changes: 3 additions & 1 deletion cmsplugin_filer_gallery/models.py
Expand Up @@ -5,6 +5,8 @@

ANIMATION_CHOICES=('fade', 'horizontal-slide', 'vertical-slide', 'horizontal-push')
ANIMATION_CHOICES=tuple(enumerate(ANIMATION_CHOICES))
CAPTION_ANIMATION_CHOICES=('fade', 'slideOpen')
CAPTION_ANIMATION_CHOICES=tuple(enumerate(CAPTION_ANIMATION_CHOICES))

class FilerGallery(CMSPlugin):

Expand All @@ -20,7 +22,7 @@ class FilerGallery(CMSPlugin):
start_after = models.IntegerField(default=1000)
directional_nav = models.BooleanField(default=False)
captions = models.BooleanField(default=False)
caption_animation = models.SmallIntegerField(choices=ANIMATION_CHOICES)
caption_animation = models.SmallIntegerField(choices=CAPTION_ANIMATION_CHOICES, null=True, blank=True)
caption_speed = models.SmallIntegerField(default=800)
bullets = models.BooleanField(default=False)

Expand Down

0 comments on commit 145816f

Please sign in to comment.