migrations

This commit is contained in:
2018-03-15 12:42:13 +01:00
parent 29e19deebc
commit 25001e38c9
419 changed files with 44849 additions and 2142 deletions

View File

@@ -0,0 +1,6 @@
{
"installed-apps": [
"djangocms_style"
],
"package-name": "djangocms-style"
}

View File

@@ -0,0 +1,43 @@
# -*- 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,
)
class_names = forms.CharField(
'List of classes (comma separated)',
required=False,
)
tag_types = forms.CharField(
'List of HTML tags (comma separated)',
required=False,
)
def clean(self):
data = super(Form, self).clean()
# prettify
data['templates'] = ', '.join(split_and_strip(data['templates']))
data['class_names'] = ', '.join(split_and_strip(data['class_names']))
data['tag_types'] = ', '.join(split_and_strip(data['tag_types']))
return data
def to_settings(self, data, settings):
if data['templates']:
settings['DJANGOCMS_STYLE_TEMPLATES'] = [
(item, item)
for item in split_and_strip(data['templates'])
]
if data['class_names']:
settings['DJANGOCMS_STYLE_CHOICES'] = split_and_strip(data['class_names'])
if data['tag_types']:
settings['DJANGOCMS_STYLE_TAGS'] = split_and_strip(data['tag_types'])
return settings

View File

@@ -0,0 +1,5 @@
{
"class_names": null,
"tag_types": null,
"templates": null
}