Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cmsplugin_gridloading/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='GridloadingItemFolderPlugin',
fields=[
('cmsplugin_ptr', models.OneToOneField(related_name='cmsplugin_gridloading_gridloadingitemfolderplugin', to='cms.CMSPlugin', auto_created=True, primary_key=True, serialize=False, parent_link=True)),
('folder', filer.fields.folder.FilerFolderField(help_text='Show all the image(s) include in the selected folder.', to='filer.Folder', verbose_name='Folder')),
('cmsplugin_ptr', models.OneToOneField(related_name='cmsplugin_gridloading_gridloadingitemfolderplugin', to='cms.CMSPlugin', auto_created=True, primary_key=True, serialize=False, parent_link=True, on_delete=models.CASCADE)),
('folder', filer.fields.folder.FilerFolderField(help_text='Show all the image(s) include in the selected folder.', to='filer.Folder', verbose_name='Folder', on_delete=models.CASCADE)),
],
options={
'abstract': False,
Expand All @@ -30,11 +30,11 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='GridloadingItemPlugin',
fields=[
('cmsplugin_ptr', models.OneToOneField(related_name='cmsplugin_gridloading_gridloadingitemplugin', to='cms.CMSPlugin', auto_created=True, primary_key=True, serialize=False, parent_link=True)),
('cmsplugin_ptr', models.OneToOneField(related_name='cmsplugin_gridloading_gridloadingitemplugin', to='cms.CMSPlugin', auto_created=True, primary_key=True, serialize=False, parent_link=True, on_delete=models.CASCADE)),
('content', djangocms_text_ckeditor.fields.HTMLField(default='', verbose_name='Content', blank=True)),
('link_url', models.URLField(null=True, verbose_name='Link', blank=True)),
('link_target', models.CharField(verbose_name='Target', max_length=100, blank=True, choices=[('_blank', 'Open in new window'), ('_self', 'Open in same window'), ('_parent', 'Delegate to parent'), ('_top', 'Delegate to top')])),
('image', filer.fields.image.FilerImageField(to='filer.Image', null=True, verbose_name='Image', blank=True)),
('image', filer.fields.image.FilerImageField(to='filer.Image', null=True, verbose_name='Image', blank=True, on_delete=models.CASCADE)),
('link_page', cms.models.fields.PageField(help_text='A link to a page has priority over a text link.', to='cms.Page', null=True, verbose_name='Page', blank=True)),
],
options={
Expand All @@ -45,7 +45,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='GridloadingPlugin',
fields=[
('cmsplugin_ptr', models.OneToOneField(related_name='cmsplugin_gridloading_gridloadingplugin', to='cms.CMSPlugin', auto_created=True, primary_key=True, serialize=False, parent_link=True)),
('cmsplugin_ptr', models.OneToOneField(related_name='cmsplugin_gridloading_gridloadingplugin', to='cms.CMSPlugin', auto_created=True, primary_key=True, serialize=False, parent_link=True, on_delete=models.CASCADE)),
('effect', models.CharField(default='opacity', max_length=255, verbose_name='Loading effect', choices=[('opacity', 'Opacity'), ('move-up', 'Move Up'), ('scale-up', 'Scale Up'), ('fall-perspective', 'Fall Perspective'), ('fly', 'Fly'), ('flip', 'Flip'), ('helix', 'Helix'), ('pop-up', 'Pop Up')])),
('aspect_ratio', models.CharField(help_text='Determines width and height of the image according to the selected ratio. All images will be with same size. Not select ratio to maintain portrait/landscape of image.', default='', choices=[('1x1', '1x1'), ('4x3', '4x3'), ('16x9', '16x9'), ('16x10', '16x10'), ('21x9', '21x9'), ('3x4', '3x4'), ('9x16', '9x16'), ('10x16', '10x16'), ('9x21', '9x21')], verbose_name='Aspect ratio', blank=True, max_length=255)),
('extra_styles', models.CharField(help_text='An arbitrary string of CSS classes to add', verbose_name='Extra styles', blank=True, max_length=50)),
Expand Down
4 changes: 2 additions & 2 deletions cmsplugin_gridloading/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class GridloadingItemPlugin(CMSPlugin):
"""
Gridloading: "Item" Model
"""
image = FilerImageField(verbose_name=_('Image'), blank=True, null=True)
image = FilerImageField(verbose_name=_('Image'), blank=True, null=True, on_delete=models.CASCADE)
content = HTMLField(verbose_name=_('Content'), blank=True, default='')
link_url = models.URLField(_("Link"), blank=True, null=True)
link_page = PageField(
Expand Down Expand Up @@ -153,7 +153,7 @@ class GridloadingItemFolderPlugin(CMSPlugin):
#cmsplugin_ptr = CMSPluginField()

folder = FilerFolderField(verbose_name=_('Folder'), \
help_text=_('Show all the image(s) include in the selected folder.'))
help_text=_('Show all the image(s) include in the selected folder.'), on_delete=models.CASCADE)

def __str__(self):
if self.folder_id:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load cms_tags shuffle sekizai_tags staticfiles %}
{% load cms_tags shuffle sekizai_tags static %}

<ul id="gridloading-{{ instance.pk }}"
class="gridloading {{ instance.effect }} {{ instance.extra_styles }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load staticfiles %}
{% load static %}
{# Item for a ItemCMSPlugin instance #}
<li>
{% with link=instance.get_link instance=instance.image content=instance.content link_target=instance.link_target %}
Expand Down
4 changes: 2 additions & 2 deletions cmsplugin_gridloading/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ def get_additional_effects():
choices = []
raw = getattr(settings, 'GRIDLOADING_EFFECTS', False)
if raw:
if isinstance(raw, basestring):
if isinstance(raw, str):
raw = raw.split(',')
for choice in raw:
clean = choice.strip()
clean = str(choice).strip()
choices.append((clean.lower(), clean.title()))
return choices