diff --git a/cmsplugin_filer_image/cms_plugins.py b/cmsplugin_filer_image/cms_plugins.py index 0c7673d7..336ed410 100644 --- a/cmsplugin_filer_image/cms_plugins.py +++ b/cmsplugin_filer_image/cms_plugins.py @@ -29,6 +29,8 @@ class FilerImagePlugin(CMSPluginBase): (None, { 'fields': [ 'caption_text', + 'caption_alignment', + 'attribution_text', 'image', 'image_url', 'alt_text', diff --git a/cmsplugin_filer_image/migrations/0010_auto_20170118_1713.py b/cmsplugin_filer_image/migrations/0010_auto_20170118_1713.py new file mode 100644 index 00000000..1a8e4260 --- /dev/null +++ b/cmsplugin_filer_image/migrations/0010_auto_20170118_1713.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cmsplugin_filer_image', '0009_auto_20160713_1853'), + ] + + operations = [ + migrations.AddField( + model_name='filerimage', + name='attribution_text', + field=models.CharField(max_length=255, null=True, verbose_name='attribution text', blank=True), + ), + migrations.AddField( + model_name='filerimage', + name='caption_alignment', + field=models.CharField(blank=True, max_length=10, null=True, verbose_name='caption alignment', choices=[('left', 'left'), ('right', 'right')]), + ), + ] 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 798e3dcb..0d2ec24f 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 @@ -1,35 +1,39 @@ {% load thumbnail filer_tags filer_image_tags %}{% spaceless %} {% comment %} - You may change the image size for special cases in your project by overriding - this template. There are a few size manipulation filters for this in - `filer_image_tags`: + You may change the image size for special cases in your project by overriding + this template. There are a few size manipulation filters for this in + `filer_image_tags`: - {% if placeholder == 'my_special_sidebar' %} - {% thumbnail instance.image opts.size|extra_padding_y:10 crop=opts.crop upscale=opts.upscale as thumbnail %} - {% else %} - {% thumbnail instance.image opts.size crop=opts.crop upscale=opts.upscale as thumbnail %} - {% endif %} - {% if link %}{% endif %}{% if link %}{% endif %} + {% if placeholder == 'my_special_sidebar' %} + {% thumbnail instance.image opts.size|extra_padding_y:10 crop=opts.crop upscale=opts.upscale as thumbnail %} + {% else %} + {% thumbnail instance.image opts.size crop=opts.crop upscale=opts.upscale as thumbnail %} + {% endif %} + {% if link %}{% endif %}{% if link %}{% endif %} {% endcomment %} - -{% if link %}{% endif %} -{% if instance.image %} - {% if instance.use_original_image %} - {% 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 %} - {% endif %} -{% else %} - {# just a plain link to some external image #} - {% if instance.alt %}{{ instance.alt }}{% endif %} -{% endif %} -{% if instance.caption or instance.description %} - - {% if instance.caption %}{{ instance.caption }}{% endif %} - {% if instance.description %}{{ instance.description }}{% endif %} - -{% endif %} -{% if link %}{% endif %} - +
+ {% if link %}{% endif %} + {% if instance.image %} + {% if instance.use_original_image %} + {% 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 %} + {% endif %} + {% else %} + {# just a plain link to some external image #} + {% if instance.alt %}{{ instance.alt }}{% endif %} + {% endif %} + {% if instance.caption or instance.attribution or instance.description %} +
+ {% if instance.caption %} + {{ instance.caption }} + {% if instance.attribution %}{{ instance.attribution }}{% endif %} + {% if instance.description %}
{% endif %} + {% endif %} + {% if instance.description %}{{ instance.description }}{% endif %} +
+ {% endif %} + {% if link %}
{% endif %} +
{% endspaceless %}