install djangocms-link 2.1.2
parent
3669cb5cb3
commit
95e33b7dc2
@ -0,0 +1,6 @@
|
||||
{
|
||||
"installed-apps": [
|
||||
"djangocms_link"
|
||||
],
|
||||
"package-name": "djangocms-link"
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
# -*- 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,
|
||||
)
|
||||
"""
|
||||
The following settings need to be configured on your project separately
|
||||
as we don't want to expose them as aldryn configurations yet:
|
||||
DJANGOCMS_LINK_INTRANET_HOSTNAME_PATTERN
|
||||
DJANGOCMS_LINK_USE_SELECT2
|
||||
"""
|
||||
|
||||
def clean(self):
|
||||
data = super(Form, self).clean()
|
||||
|
||||
# prettify
|
||||
data['templates'] = ', '.join(split_and_strip(data['templates']))
|
||||
return data
|
||||
|
||||
def to_settings(self, data, settings):
|
||||
if data['templates']:
|
||||
settings['DJANGOCMS_LINK_TEMPLATES'] = [
|
||||
(item, item)
|
||||
for item in split_and_strip(data['templates'])
|
||||
]
|
||||
|
||||
return settings
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"templates": null
|
||||
}
|
||||
Loading…
Reference in New Issue