install djangocms-picture 2.0.6
This commit is contained in:
6
addons/djangocms-picture/addon.json
Normal file
6
addons/djangocms-picture/addon.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"installed-apps": [
|
||||
"djangocms_picture"
|
||||
],
|
||||
"package-name": "djangocms-picture"
|
||||
}
|
||||
59
addons/djangocms-picture/aldryn_config.py
Normal file
59
addons/djangocms-picture/aldryn_config.py
Normal file
@@ -0,0 +1,59 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from aldryn_client import forms
|
||||
|
||||
|
||||
def split_and_strip(string):
|
||||
return [item.strip() for item in string.split(',') if item]
|
||||
|
||||
|
||||
class Form(forms.BaseForm):
|
||||
templates = forms.CharField(
|
||||
'List of additional templates (comma separated)',
|
||||
required=False,
|
||||
)
|
||||
alignment = forms.CharField(
|
||||
'List of alignment types, default "left, center, right" (comma separated)',
|
||||
required=False,
|
||||
)
|
||||
ratio = forms.CharField(
|
||||
'The ratio used to calculate the missing width or height, default "1.618"',
|
||||
required=False,
|
||||
)
|
||||
nesting = forms.CheckboxField(
|
||||
'Allow plugins to be nested inside the picture plugin.',
|
||||
required=False,
|
||||
initial=False,
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
data = super(Form, self).clean()
|
||||
|
||||
# older versions of this addon had a bug where the values would be
|
||||
# saved to settings.json as a list instead of a string.
|
||||
if isinstance(data['templates'], list):
|
||||
data['templates'] = ', '.join(data['templates'])
|
||||
if isinstance(data['alignment'], list):
|
||||
data['alignment'] = ', '.join(data['alignment'])
|
||||
|
||||
# prettify
|
||||
data['templates'] = ', '.join(split_and_strip(data['templates']))
|
||||
data['alignment'] = ', '.join(split_and_strip(data['alignment']))
|
||||
return data
|
||||
|
||||
def to_settings(self, data, settings):
|
||||
if data['templates']:
|
||||
settings['DJANGOCMS_PICTURE_TEMPLATES'] = [
|
||||
(item, item)
|
||||
for item in split_and_strip(data['templates'])
|
||||
]
|
||||
if data['alignment']:
|
||||
settings['DJANGOCMS_PICTURE_ALIGN'] = [
|
||||
(item, item)
|
||||
for item in split_and_strip(data['alignment'])
|
||||
]
|
||||
if data['ratio']:
|
||||
settings['DJANGOCMS_PICTURE_RATIO'] = float(data['ratio'])
|
||||
if data['nesting']:
|
||||
settings['DJANGOCMS_PICTURE_NESTING'] = data['nesting']
|
||||
|
||||
return settings
|
||||
6
addons/djangocms-picture/settings.json
Normal file
6
addons/djangocms-picture/settings.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"alignment": null,
|
||||
"nesting": false,
|
||||
"ratio": null,
|
||||
"templates": null
|
||||
}
|
||||
@@ -5,6 +5,7 @@ https://control.divio.com/api/v1/apps/serve/aldryn-sso/1.1.16/dbe0c45a-c981-4beb
|
||||
https://control.divio.com/api/v1/apps/serve/djangocms-file/2.0.2/f0e22a3c-8890-4013-93bc-02f0e937a570/djangocms-file-2.0.2.tar.gz#egg=djangocms-file==2.0.2
|
||||
https://control.divio.com/api/v1/apps/serve/djangocms-googlemap/1.1.0/829bcfeb-0edc-4074-9483-88c27410d154/djangocms-googlemap-1.1.0.tar.gz#egg=djangocms-googlemap==1.1.0
|
||||
https://control.divio.com/api/v1/apps/serve/djangocms-link/2.1.2/35b986c1-fafb-46ee-b665-aa36603f233a/djangocms-link-2.1.2.tar.gz#egg=djangocms-link==2.1.2
|
||||
https://control.divio.com/api/v1/apps/serve/djangocms-picture/2.0.6/005e8663-d1cc-4667-936c-30709edad076/djangocms-picture-2.0.6.tar.gz#egg=djangocms-picture==2.0.6
|
||||
https://control.divio.com/api/v1/apps/serve/djangocms-snippet/2.0.0/03734ae6-5d3e-44aa-8641-8f764dbced64/djangocms-snippet-2.0.0.tar.gz#egg=djangocms-snippet==2.0.0
|
||||
https://control.divio.com/api/v1/apps/serve/djangocms-text-ckeditor/3.5.3/a7b5179f-cea5-4af8-b235-6b7f709c4e6a/djangocms-text-ckeditor-3.5.3.tar.gz#egg=djangocms-text-ckeditor==3.5.3
|
||||
https://control.divio.com/api/v1/apps/serve/django-filer/1.3.0.1/bcb7d25b-6922-48a9-a252-9bc165f6403e/django-filer-1.3.0.1.tar.gz#egg=django-filer==1.3.0.1
|
||||
|
||||
@@ -8,6 +8,7 @@ INSTALLED_ADDONS = [
|
||||
'djangocms-file',
|
||||
'djangocms-googlemap',
|
||||
'djangocms-link',
|
||||
'djangocms-picture',
|
||||
'djangocms-snippet',
|
||||
'djangocms-text-ckeditor',
|
||||
'django-filer',
|
||||
|
||||
Reference in New Issue
Block a user