From 407e6d5386a6c687f83f2a5e16205ee966b20bd4 Mon Sep 17 00:00:00 2001 From: Loriana Indelicato Date: Wed, 27 Apr 2016 14:20:14 +0200 Subject: [PATCH 1/6] updates history --- HISTORY | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY b/HISTORY index 48c6d683..d9726e29 100644 --- a/HISTORY +++ b/HISTORY @@ -7,6 +7,8 @@ Changelog for django-filer-cmsplugins * Move migrations to proper layout * Put django's AppConfig for nice name in django admin * Add swappable dependency to initial migration +* Add img-responsive class if automatic scaling +* Add center image alignment 1.0.1 (2016-01-14) ------------------ From fd0661149240aa8119fa087e8c737627e7a4527c Mon Sep 17 00:00:00 2001 From: Loriana Indelicato Date: Wed, 27 Apr 2016 14:20:30 +0200 Subject: [PATCH 2/6] adds center alignment --- cmsplugin_filer_image/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmsplugin_filer_image/models.py b/cmsplugin_filer_image/models.py index 81c0d740..4b669473 100644 --- a/cmsplugin_filer_image/models.py +++ b/cmsplugin_filer_image/models.py @@ -16,8 +16,10 @@ class FilerImage(CMSPlugin): LEFT = "left" RIGHT = "right" + CENTER = "center" FLOAT_CHOICES = ((LEFT, _("left")), (RIGHT, _("right")), + (CENTER, _("center")), ) STYLE_CHOICES = settings.CMSPLUGIN_FILER_IMAGE_STYLE_CHOICES DEFAULT_STYLE = settings.CMSPLUGIN_FILER_IMAGE_DEFAULT_STYLE From 3481fd2dc0ffaeeb2b622a1035523c6db169fd2a Mon Sep 17 00:00:00 2001 From: Loriana Indelicato Date: Wed, 27 Apr 2016 14:21:01 +0200 Subject: [PATCH 3/6] adds img-responsive class --- .../cmsplugin_filer_image/plugins/image/default.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmsplugin_filer_image/templates/cmsplugin_filer_image/plugins/image/default.html b/cmsplugin_filer_image/templates/cmsplugin_filer_image/plugins/image/default.html index 4d5ecebb..b80b3164 100644 --- a/cmsplugin_filer_image/templates/cmsplugin_filer_image/plugins/image/default.html +++ b/cmsplugin_filer_image/templates/cmsplugin_filer_image/plugins/image/default.html @@ -15,14 +15,14 @@ {% if link %}{% endif %} {% if instance.image %} {% if instance.use_original_image %} - {% if instance.alt %}{{ instance.alt }}{% endif %} + {% if instance.alt %}{{ instance.alt }}{% endif %} {% else %} {% thumbnail instance.image size crop=opts.crop upscale=opts.upscale subject_location=opts.subject_location as thumbnail %} - {% if instance.alt %}{{ instance.alt }}{% endif %} + {% if instance.alt %}{{ instance.alt }}{% endif %} {% endif %} {% else %} {# just a plain link to some external image #} - {% if instance.alt %}{{ instance.alt }}{% endif %} + {% if instance.alt %}{{ instance.alt }}{% endif %} {% endif %} {% if instance.caption or instance.description %} From 8bef3d56f72693ffb66d29dd59e321f54f13322a Mon Sep 17 00:00:00 2001 From: Loriana Indelicato Date: Wed, 27 Apr 2016 14:53:12 +0200 Subject: [PATCH 4/6] updates readme --- README.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.rst b/README.rst index 42a692b6..0497e999 100644 --- a/README.rst +++ b/README.rst @@ -146,3 +146,9 @@ be used in the template as ``{{ instance.style }}``. For backwards compatibility the plugin will always use ``cmsplugin_filer_image/image.html`` if it exists. Remove that template after migrating to the new structure. + + +Classes +------- + +Classes like left, center, right and img-responsive are given by the plugin to use in your own projects. \ No newline at end of file From 8b3ef7dd28c7f451c77cb21b8491a33f7c49153f Mon Sep 17 00:00:00 2001 From: Loriana Indelicato Date: Wed, 27 Apr 2016 15:39:57 +0200 Subject: [PATCH 5/6] adds migration --- .../migrations/0006_auto_20160427_1438.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cmsplugin_filer_image/migrations/0006_auto_20160427_1438.py diff --git a/cmsplugin_filer_image/migrations/0006_auto_20160427_1438.py b/cmsplugin_filer_image/migrations/0006_auto_20160427_1438.py new file mode 100644 index 00000000..d4ee630a --- /dev/null +++ b/cmsplugin_filer_image/migrations/0006_auto_20160427_1438.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cmsplugin_filer_image', '0005_auto_20160224_1457'), + ] + + operations = [ + migrations.AlterField( + model_name='filerimage', + name='alignment', + field=models.CharField(blank=True, max_length=10, null=True, verbose_name='image alignment', choices=[('left', 'left'), ('right', 'right'), ('center', 'center')]), + ), + ] From cdc3cf88cde7808661171fc7cecf4dcf01f4797f Mon Sep 17 00:00:00 2001 From: Loriana Indelicato Date: Wed, 27 Apr 2016 15:54:24 +0200 Subject: [PATCH 6/6] highlight classes in readme --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0497e999..07ef1372 100644 --- a/README.rst +++ b/README.rst @@ -151,4 +151,4 @@ template after migrating to the new structure. Classes ------- -Classes like left, center, right and img-responsive are given by the plugin to use in your own projects. \ No newline at end of file +Classes like ``left``, ``center``, ``right`` and ``img-responsive`` are given by the plugin to use in your own projects. \ No newline at end of file