Commits

Anonymous committed caa02c2

Nivo default themes. Plugin now allows theme selection, effect, size...

  • Participants
  • Parent commits 1b1f705

Comments (0)

Files changed (28)

cmsplugin_nivoslider/cms_plugins.py

 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
-# author: bcabezas@apsl.net 
+# author: bcabezas@apsl.net
 
 from cms.plugin_base import CMSPluginBase
 from cms.plugin_pool import plugin_pool
     admin_preview = False
 
     def render(self, context, instance, placeholder):
+        if instance.image_height and instance.image_width:
+            size = (instance.image_width, instance.image_height)
+        else:
+            size = None
         context.update({
             'object': instance,
             'placeholder': placeholder,
-            'images': instance.album.images.all()
-        })   
+            'images': instance.album.images.all(),
+            'size': size,
+        })
         return context
 
 plugin_pool.register_plugin(CMSSliderPlugin)

cmsplugin_nivoslider/migrations/0001_initial.pyc

Binary file added.

cmsplugin_nivoslider/migrations/0002_auto__add_field_sliderplugin_theme__add_field_sliderplugin_effect.py

+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+    def forwards(self, orm):
+        
+        # Adding field 'SliderPlugin.theme'
+        db.add_column('cmsplugin_sliderplugin', 'theme', self.gf('django.db.models.fields.CharField')(default='default', max_length=50), keep_default=False)
+
+        # Adding field 'SliderPlugin.effect'
+        db.add_column('cmsplugin_sliderplugin', 'effect', self.gf('django.db.models.fields.CharField')(default='random', max_length=50), keep_default=False)
+
+
+    def backwards(self, orm):
+        
+        # Deleting field 'SliderPlugin.theme'
+        db.delete_column('cmsplugin_sliderplugin', 'theme')
+
+        # Deleting field 'SliderPlugin.effect'
+        db.delete_column('cmsplugin_sliderplugin', 'effect')
+
+
+    models = {
+        'cms.cmsplugin': {
+            'Meta': {'object_name': 'CMSPlugin'},
+            'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
+            'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
+            'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+            'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+            'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+        },
+        'cms.placeholder': {
+            'Meta': {'object_name': 'Placeholder'},
+            'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
+        },
+        'cmsplugin_nivoslider.slideralbum': {
+            'Meta': {'object_name': 'SliderAlbum'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'images': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cmsplugin_nivoslider.SliderImage']", 'symmetrical': 'False', 'blank': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
+        },
+        'cmsplugin_nivoslider.sliderimage': {
+            'Meta': {'ordering': "('order', 'name')", 'object_name': 'SliderImage'},
+            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
+            'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '100'})
+        },
+        'cmsplugin_nivoslider.sliderplugin': {
+            'Meta': {'object_name': 'SliderPlugin', 'db_table': "'cmsplugin_sliderplugin'", '_ormbases': ['cms.CMSPlugin']},
+            'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cmsplugin_nivoslider.SliderAlbum']"}),
+            'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+            'effect': ('django.db.models.fields.CharField', [], {'default': "'random'", 'max_length': '50'}),
+            'theme': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '50'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
+        }
+    }
+
+    complete_apps = ['cmsplugin_nivoslider']

cmsplugin_nivoslider/migrations/0003_auto__add_field_sliderplugin_anim_speed__add_field_sliderplugin_pause_.py

+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+    def forwards(self, orm):
+        
+        # Adding field 'SliderPlugin.anim_speed'
+        db.add_column('cmsplugin_sliderplugin', 'anim_speed', self.gf('django.db.models.fields.PositiveIntegerField')(default=500), keep_default=False)
+
+        # Adding field 'SliderPlugin.pause_time'
+        db.add_column('cmsplugin_sliderplugin', 'pause_time', self.gf('django.db.models.fields.PositiveIntegerField')(default=3000), keep_default=False)
+
+
+    def backwards(self, orm):
+        
+        # Deleting field 'SliderPlugin.anim_speed'
+        db.delete_column('cmsplugin_sliderplugin', 'anim_speed')
+
+        # Deleting field 'SliderPlugin.pause_time'
+        db.delete_column('cmsplugin_sliderplugin', 'pause_time')
+
+
+    models = {
+        'cms.cmsplugin': {
+            'Meta': {'object_name': 'CMSPlugin'},
+            'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
+            'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
+            'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+            'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+            'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+        },
+        'cms.placeholder': {
+            'Meta': {'object_name': 'Placeholder'},
+            'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
+        },
+        'cmsplugin_nivoslider.slideralbum': {
+            'Meta': {'object_name': 'SliderAlbum'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'images': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cmsplugin_nivoslider.SliderImage']", 'symmetrical': 'False', 'blank': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
+        },
+        'cmsplugin_nivoslider.sliderimage': {
+            'Meta': {'ordering': "('order', 'name')", 'object_name': 'SliderImage'},
+            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
+            'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '100'})
+        },
+        'cmsplugin_nivoslider.sliderplugin': {
+            'Meta': {'object_name': 'SliderPlugin', 'db_table': "'cmsplugin_sliderplugin'", '_ormbases': ['cms.CMSPlugin']},
+            'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cmsplugin_nivoslider.SliderAlbum']"}),
+            'anim_speed': ('django.db.models.fields.PositiveIntegerField', [], {'default': '500'}),
+            'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+            'effect': ('django.db.models.fields.CharField', [], {'default': "'random'", 'max_length': '50'}),
+            'pause_time': ('django.db.models.fields.PositiveIntegerField', [], {'default': '3000'}),
+            'theme': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '50'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
+        }
+    }
+
+    complete_apps = ['cmsplugin_nivoslider']

cmsplugin_nivoslider/migrations/0004_auto__add_field_sliderplugin_image_width__add_field_sliderplugin_image.py

+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+    def forwards(self, orm):
+        
+        # Adding field 'SliderPlugin.image_width'
+        db.add_column('cmsplugin_sliderplugin', 'image_width', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True), keep_default=False)
+
+        # Adding field 'SliderPlugin.image_height'
+        db.add_column('cmsplugin_sliderplugin', 'image_height', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True), keep_default=False)
+
+
+    def backwards(self, orm):
+        
+        # Deleting field 'SliderPlugin.image_width'
+        db.delete_column('cmsplugin_sliderplugin', 'image_width')
+
+        # Deleting field 'SliderPlugin.image_height'
+        db.delete_column('cmsplugin_sliderplugin', 'image_height')
+
+
+    models = {
+        'cms.cmsplugin': {
+            'Meta': {'object_name': 'CMSPlugin'},
+            'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
+            'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
+            'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+            'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+            'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+        },
+        'cms.placeholder': {
+            'Meta': {'object_name': 'Placeholder'},
+            'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
+        },
+        'cmsplugin_nivoslider.slideralbum': {
+            'Meta': {'object_name': 'SliderAlbum'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'images': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cmsplugin_nivoslider.SliderImage']", 'symmetrical': 'False', 'blank': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
+        },
+        'cmsplugin_nivoslider.sliderimage': {
+            'Meta': {'ordering': "('order', 'name')", 'object_name': 'SliderImage'},
+            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
+            'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '100'})
+        },
+        'cmsplugin_nivoslider.sliderplugin': {
+            'Meta': {'object_name': 'SliderPlugin', 'db_table': "'cmsplugin_sliderplugin'", '_ormbases': ['cms.CMSPlugin']},
+            'album': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cmsplugin_nivoslider.SliderAlbum']"}),
+            'anim_speed': ('django.db.models.fields.PositiveIntegerField', [], {'default': '500'}),
+            'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+            'effect': ('django.db.models.fields.CharField', [], {'default': "'random'", 'max_length': '50'}),
+            'image_height': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'image_width': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'pause_time': ('django.db.models.fields.PositiveIntegerField', [], {'default': '3000'}),
+            'theme': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '50'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
+        }
+    }
+
+    complete_apps = ['cmsplugin_nivoslider']

cmsplugin_nivoslider/models.py

 from cms.models.fields import PlaceholderField
 from cms.models import CMSPlugin
 from easy_thumbnails.files import get_thumbnailer
+from django.conf import settings
+from django.contrib.staticfiles.finders import find as staticfiles_find
+import os
+import re
 
-    
 class SliderImage(models.Model):
     """Image class that user django-filer"""
     name = models.CharField(max_length=150, blank=True)
     def __unicode__(self):
         if self.name:
             name = self.name
-        else:                    
+        else:
             try:
                 name = self.image.file.name.split("/")[-1]
             except:
-                name = unicode(self.image)    
+                name = unicode(self.image)
         return "%s"  % name
-    
+
     def thumb(self):
         thumbnail_options = dict(size=(92, 37), crop=True)
         url =  get_thumbnailer(self.image).get_thumbnail(thumbnail_options).url
         return '<img src="%s">' % url
     thumb.allow_tags = True
-    thumb.short_description = 'Image'    
-    
-    
+    thumb.short_description = 'Image'
+
+
 class SliderAlbum(models.Model):
     """Image gallery for slider"""
     name = models.CharField(max_length=150)
     def __unicode__(self):
         return self.name
 
-class SliderPlugin(CMSPlugin):   
+EFFECTS = """
+    sliceDown
+    sliceDownLeft
+    sliceUp
+    sliceUpLeft
+    sliceUpDown
+    sliceUpDownLeft
+    fold
+    fade
+    random
+    slideInRight
+    slideInLeft
+    boxRandom
+    boxRain
+    boxRainReverse
+    boxRainGrow
+    boxRainGrowReverse
+"""
+EFFECT_CHOICES = [(e,e) for e in EFFECTS.split()]
+
+def find_themes():
+    themedirs = staticfiles_find("nivo/themes/", all=True)
+    for dir in themedirs:
+        for theme in os.listdir(dir):
+            yield theme
+
+THEME_CHOICES = ((t,t) for t in find_themes())
+
+class SliderPlugin(CMSPlugin):
     title = models.CharField('Titulo', max_length=255, null=True, blank=True)
     album = models.ForeignKey(SliderAlbum)
-            
+    theme = models.CharField(choices=THEME_CHOICES, max_length=50, default="default")
+    effect = models.CharField(choices=EFFECT_CHOICES, max_length=50, default="random")
+    anim_speed = models.PositiveIntegerField(default=500, help_text="Animation Speed (ms)")
+    pause_time = models.PositiveIntegerField(default=3000, help_text="Pause time (ms)")
+    image_width = models.PositiveIntegerField(null=True, blank=True,
+            help_text="Width for images. Only requided for flexible theme types. Blank for theme spec auto.detection")
+    image_height = models.PositiveIntegerField(null=True, blank=True,
+            help_text="Height for images. Only requided for flexible theme types. Blank for theme spec auto.detection")
+
     def __unicode__(self):
-        if self.title: 
+        if self.title:
             return self.title
 
+    def read_theme_css(self):
+        cssfile = staticfiles_find("nivo/themes/%(theme)s/%(theme)s.css" % self.__dict__)
+        return open(cssfile).read()
+
+    def get_theme_type(self):
+        """ Get geometry type from the doc header of css theme file"""
+        css = self.read_theme_css()
+        rawstr = r""".*Skin Type: (?P<gtype>\w+?)\s"""
+        match_obj = re.search(rawstr, css,  re.MULTILINE| re.DOTALL)
+        gtype = match_obj.group('gtype')
+        return gtype
+
+    def get_theme_geometry(self):
+        """ Get with and heigth from the doc header of css theme file"""
+        css = self.read_theme_css()
+        rawstr = r"""Image Width: (?P<width>\d+).*Image Height: (?P<height>\d+)"""
+        match_obj = re.search(rawstr, css,  re.MULTILINE| re.DOTALL)
+        width = match_obj.group('width')
+        height = match_obj.group('height')
+        return (width, height)
+
+    def save(self, *args, **kwargs):
+        if self.get_theme_type() != 'flexible':
+            width, height = self.get_theme_geometry()
+            self.image_width = width
+            self.image_height = height
+        super(SliderPlugin, self).save(*args, **kwargs)
+
     search_fields = ('title',)

cmsplugin_nivoslider/static/nivo/nivo-slider.css

+/*
+ * jQuery Nivo Slider v2.7.1
+ * http://nivo.dev7studios.com
+ *
+ * Copyright 2011, Gilbert Pellegrom
+ * Free to use and abuse under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+ * 
+ * March 2010
+ */
+ 
+ 
+/* The Nivo Slider styles */
+.nivoSlider {
+	position:relative;
+}
+.nivoSlider img {
+	position:absolute;
+	top:0px;
+	left:0px;
+}
+/* If an image is wrapped in a link */
+.nivoSlider a.nivo-imageLink {
+	position:absolute;
+	top:0px;
+	left:0px;
+	width:100%;
+	height:100%;
+	border:0;
+	padding:0;
+	margin:0;
+	z-index:6;
+	display:none;
+}
+/* The slices and boxes in the Slider */
+.nivo-slice {
+	display:block;
+	position:absolute;
+	z-index:5;
+	height:100%;
+}
+.nivo-box {
+	display:block;
+	position:absolute;
+	z-index:5;
+}
+/* Caption styles */
+.nivo-caption {
+	position:absolute;
+	left:0px;
+	bottom:0px;
+	background:#000;
+	color:#fff;
+	opacity:0.8; /* Overridden by captionOpacity setting */
+	width:100%;
+	z-index:8;
+}
+.nivo-caption p {
+	padding:5px;
+	margin:0;
+}
+.nivo-caption a {
+	display:inline !important;
+}
+.nivo-html-caption {
+    display:none;
+}
+/* Direction nav styles (e.g. Next & Prev) */
+.nivo-directionNav a {
+	position:absolute;
+	top:45%;
+	z-index:9;
+	cursor:pointer;
+}
+.nivo-prevNav {
+	left:0px;
+}
+.nivo-nextNav {
+	right:0px;
+}
+/* Control nav styles (e.g. 1,2,3...) */
+.nivo-controlNav a {
+	position:relative;
+	z-index:9;
+	cursor:pointer;
+}
+.nivo-controlNav a.active {
+	font-weight:bold;
+}

cmsplugin_nivoslider/static/nivo/themes/default/arrows.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/default/bullets.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/default/default.css

+/*
+Skin Name: Nivo Slider Default Theme
+Skin URI: http://nivo.dev7studios.com
+Skin Type: flexible
+Description: The default skin for the Nivo Slider.
+Version: 1.0
+Author: Gilbert Pellegrom
+Author URI: http://dev7studios.com
+*/
+
+.theme-default .nivoSlider {
+	position:relative;
+	background:#fff url(loading.gif) no-repeat 50% 50%;
+    margin-bottom:50px;
+    -webkit-box-shadow: 0px 1px 5px 0px #4a4a4a;
+    -moz-box-shadow: 0px 1px 5px 0px #4a4a4a;
+    box-shadow: 0px 1px 5px 0px #4a4a4a;
+}
+.theme-default .nivoSlider img {
+	position:absolute;
+	top:0px;
+	left:0px;
+	display:none;
+}
+.theme-default .nivoSlider a {
+	border:0;
+	display:block;
+}
+
+.theme-default .nivo-controlNav {
+	position:absolute;
+	left:50%;
+	bottom:-42px;
+    margin-left:-40px; /* Tweak this to center bullets */
+}
+.theme-default .nivo-controlNav a {
+	display:block;
+	width:22px;
+	height:22px;
+	background:url(bullets.png) no-repeat;
+	text-indent:-9999px;
+	border:0;
+	margin-right:3px;
+	float:left;
+}
+.theme-default .nivo-controlNav a.active {
+	background-position:0 -22px;
+}
+
+.theme-default .nivo-directionNav a {
+	display:block;
+	width:30px;
+	height:30px;
+	background:url(arrows.png) no-repeat;
+	text-indent:-9999px;
+	border:0;
+}
+.theme-default a.nivo-nextNav {
+	background-position:-30px 0;
+	right:15px;
+}
+.theme-default a.nivo-prevNav {
+	left:15px;
+}
+
+.theme-default .nivo-caption {
+    font-family: Helvetica, Arial, sans-serif;
+}
+.theme-default .nivo-caption a {
+    color:#fff;
+    border-bottom:1px dotted #fff;
+}
+.theme-default .nivo-caption a:hover {
+    color:#fff;
+}

cmsplugin_nivoslider/static/nivo/themes/default/loading.gif

Added
New image

cmsplugin_nivoslider/static/nivo/themes/orman/arrows.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/orman/bullets.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/orman/loading.gif

Added
New image

cmsplugin_nivoslider/static/nivo/themes/orman/orman.css

+/*
+Skin Name: Orman Theme
+Skin URI: http://nivo.dev7studios.com
+Skin Type: fixed
+Image Width: 568
+Image Height: 268
+Description: A light and green skin for the Nivo Slider.
+Version: 1.0
+Author: Gilbert Pellegrom & Orman Clark
+Author URI: http://dev7studios.com
+*/
+
+.theme-orman.slider-wrapper {
+    background:url(slider.png) no-repeat;
+    width:722px;
+    height:337px;
+    margin:0 auto;
+    padding-top:18px;
+    position:relative;
+}
+
+.theme-orman .nivoSlider {
+    position:relative;
+    width:568px;
+    height:268px;
+    margin-left:77px;
+    background:url(loading.gif) no-repeat 50% 50%;
+}
+.theme-orman .nivoSlider img {
+    position:absolute;
+    top:0px;
+    left:0px;
+    display:none;
+    width:568px; /* Make sure your images are the same size */
+    height:268px; /* Make sure your images are the same size */
+}
+.theme-orman .nivoSlider a {
+    border:0;
+    display:block;
+}
+
+.theme-orman .nivo-controlNav {
+    position:absolute;
+	left:50%;
+	bottom:-60px;
+    margin-left:-30px; /* Tweak this to center bullets */
+}
+.theme-orman .nivo-controlNav a {
+    display:block;
+    width:10px;
+    height:10px;
+    background:url(bullets.png) no-repeat;
+    text-indent:-9999px;
+    border:0;
+    margin-right:7px;
+    float:left;
+}
+.theme-orman .nivo-controlNav a.active {
+    background-position:0 -10px;
+}
+
+.theme-orman .nivo-directionNav a {
+	display:block;
+	width:25px;
+	height:200px;
+	background:url(arrows.png) no-repeat 0% 50%;
+	text-indent:-9999px;
+	border:0;
+    top:40px;
+}
+.theme-orman a.nivo-nextNav {
+	background-position:100% 50%;
+	right:-40px;
+    padding-right:20px;
+}
+.theme-orman a.nivo-prevNav {
+	left:-40px;
+    padding-left:20px;
+}
+
+.theme-orman .nivo-caption {
+    font-family: Helvetica, Arial, sans-serif;
+}
+.theme-orman .nivo-caption a { 
+    color:#fff;
+    border-bottom:1px dotted #fff;
+}
+.theme-orman .nivo-caption a:hover { 
+    color:#fff;
+}
+
+.theme-orman .ribbon {
+    background:url(ribbon.png) no-repeat;
+    width:111px;
+    height:111px;
+    position:absolute;
+    top:-3px;
+    left:56px;
+    z-index:300;
+}

cmsplugin_nivoslider/static/nivo/themes/orman/readme.txt

+Note: Images used in the slider for the Orman Theme should have the dimensions 568px x 268px

cmsplugin_nivoslider/static/nivo/themes/orman/ribbon.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/orman/slider.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/pascal/bullets.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/pascal/controlnav.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/pascal/featured.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/pascal/loading.gif

Added
New image

cmsplugin_nivoslider/static/nivo/themes/pascal/pascal.css

+/*
+Skin Name: Pascal Theme
+Skin URI: http://nivo.dev7studios.com
+Skin Type: fixed
+Image Width: 630
+Image Height: 235
+Description: A nice, light skin for the Nivo Slider.
+Version: 1.0
+Author: Gilbert Pellegrom & Pascal Gartner
+Author URI: http://dev7studios.com
+*/
+
+.theme-pascal.slider-wrapper {
+    background:url(slider.png) no-repeat;
+    width:668px;
+    height:299px;
+    margin:0 auto;
+    padding-top:17px;
+    position:relative;
+}
+
+.theme-pascal .nivoSlider {
+    position:relative;
+    width:630px;
+    height:235px;
+    margin-left:19px;
+    background:url(loading.gif) no-repeat 50% 50%;
+}
+.theme-pascal .nivoSlider img {
+    position:absolute;
+    top:0px;
+    left:0px;
+    display:none;
+    width:630px; /* Make sure your images are the same size */
+    height:235px; /* Make sure your images are the same size */
+}
+.theme-pascal .nivoSlider a {
+    border:0;
+    display:block;
+}
+
+.theme-pascal .nivo-controlNav {
+    background:url(controlnav.png) no-repeat;
+    width:251px;
+    height:40px;
+    position:absolute;
+    left:200px; /* Tweak this to center bullets */
+    bottom:-42px;
+    padding:8px 0 0 82px;
+    z-index:20;
+}
+.theme-pascal .nivo-controlNav a {
+    display:block;
+    width:22px;
+    height:22px;
+    background:url(bullets.png) no-repeat;
+    text-indent:-9999px;
+    border:0;
+    margin-right:3px;
+    float:left;
+}
+.theme-pascal .nivo-controlNav a.active {
+    background-position:0 -22px;
+}
+
+.theme-pascal .nivo-directionNav a {
+	display:none;
+}
+
+.theme-pascal .nivo-caption {
+    bottom:40%;
+    left:auto;
+    right:0px;
+    width:auto;
+    max-width:630px;
+    overflow:hidden;
+    background:#fff;
+    text-shadow:none;
+    font-family: arial, serif;
+    color:#4c4b4b;
+}
+.theme-pascal .nivo-caption p {
+    padding:5px 15px;
+    color:#333;
+    font-weight:bold;
+    font-size:27px;
+    text-transform:uppercase;
+}
+.theme-pascal .nivo-caption a { 
+    color:#333;
+    font-weight:bold;
+    font-size:27px;
+    text-transform:uppercase;
+}
+
+.theme-pascal .ribbon {
+    background:url(ribbon.png) no-repeat;
+    width:111px;
+    height:111px;
+    position:absolute;
+    top:-8px;
+    left:-8px;
+    z-index:300;
+}

cmsplugin_nivoslider/static/nivo/themes/pascal/readme.txt

+Note: Images used in the slider for the Pascal Theme should have the dimensions 630px x 235px

cmsplugin_nivoslider/static/nivo/themes/pascal/ribbon.png

Added
New image

cmsplugin_nivoslider/static/nivo/themes/pascal/slider.png

Added
New image

cmsplugin_nivoslider/templates/nivo/slider.html

 {% load i18n sekizai_tags thumbnail  %}
 
-<div class="slider-wrapper theme-orman">
-    <div class="logo"></div>
+<div class="slider-wrapper theme-{{object.theme}}">
+    <div class="ribbon"></div>
     <div id="slider" class="nivoSlider">
         {% for img in images %}
-            <img src="{% thumbnail img.image 928x378 crop %}" alt="{{img.name}}" title="{{img.description}}" />
+            {% if size %}
+                <img src="{% thumbnail img.image size crop %}" alt="{{img.name}}" title="{{img.description}}" />
+            {% else %}
+                <img src="{{img.image.url}}" alt="{{img.name}}" title="{{img.description}}" />
+            {% endif %}
         {% endfor %}
     </div>
 </div> <!-- end slider-wrapper -->
 
+
+
 {% addtoblock "css" %}
-<link rel="stylesheet" href="{{STATIC_URL}}nivo/css/orman.css" type="text/css" media="screen" />
+<link rel="stylesheet" href="{{STATIC_URL}}nivo/nivo-slider.css" type="text/css" media="screen" />
+{% endaddtoblock %}
+
+{% addtoblock "css" %}
+<link rel="stylesheet" href="{{STATIC_URL}}nivo/themes/{{object.theme}}/{{object.theme}}.css" type="text/css" media="screen" />
 {% endaddtoblock %}
 
 {% addtoblock "js" %}
 <script type="text/javascript">
     $(function() {
         $('#slider').nivoSlider({
-            effect: 'boxRainGrow',
-            animSpeed: 1500,
-            pauseTime: 8000
+            effect: '{{object.effect}}',
+            animSpeed: {{object.anim_speed}},
+            pauseTime: {{object.pause_time}}
         });
     });
 </script>
 
 setup(
     name='cmsplugin-nivoslider',
-    version='0.1.2',
+    version='0.2.0',
     author='APSL · Bernardo Cabezas Serra',
     author_email='bcabezas@apsl.net',
     packages = find_packages(),
-    license='GPL',
+    license='MIT',
     description = "Simple Nivo Slider plugin for django-cms",
     long_description=open('README.rst').read(),
     install_requires = ['django',],