general: remove blurps (#20914)
This commit is contained in:
parent
273f1b0032
commit
aff45d1a0e
4
README
4
README
|
@ -81,10 +81,6 @@ Details on these options and additional SAML settings are available in the
|
||||||
documentation of django-mellon.
|
documentation of django-mellon.
|
||||||
|
|
||||||
|
|
||||||
Blurps (from cmsplugin-blurp module) can be used to define additional cell
|
|
||||||
types, the CMS_PLUGIN_BLURP_RENDERERS variable is used to hold them, details
|
|
||||||
can be found in the cmsplugin-blurp documentation.
|
|
||||||
|
|
||||||
In addition to common attributes Combo supports a 'private' attribute, that can
|
In addition to common attributes Combo supports a 'private' attribute, that can
|
||||||
be used to exclude the given blurp from selectable cells. The blurp itself can
|
be used to exclude the given blurp from selectable cells. The blurp itself can
|
||||||
still be referenced manually in a template file. This is useful to avoid
|
still be referenced manually in a template file. This is useful to avoid
|
||||||
|
|
|
@ -363,7 +363,7 @@ class WcsFormsOfCategoryCell(WcsCommonCategoryCell, WcsBlurpMixin):
|
||||||
try:
|
try:
|
||||||
context['forms'] = list(context['forms'][self.wcs_site]['data'])
|
context['forms'] = list(context['forms'][self.wcs_site]['data'])
|
||||||
except (KeyError, TypeError) as e:
|
except (KeyError, TypeError) as e:
|
||||||
# an error occured in the blurp
|
# an error occured when getting the data
|
||||||
context['forms'] = []
|
context['forms'] = []
|
||||||
|
|
||||||
# default sort is alphabetical, it's always done as this will serve as
|
# default sort is alphabetical, it's always done as this will serve as
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('data', '0030_externallinksearchitem'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='blurpcell',
|
||||||
|
name='groups',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='blurpcell',
|
||||||
|
name='page',
|
||||||
|
),
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='BlurpCell',
|
||||||
|
),
|
||||||
|
]
|
|
@ -45,7 +45,6 @@ from django.template import Context, engines
|
||||||
from django.test.client import RequestFactory
|
from django.test.client import RequestFactory
|
||||||
|
|
||||||
from .fields import RichTextField
|
from .fields import RichTextField
|
||||||
import cmsplugin_blurp.utils
|
|
||||||
|
|
||||||
from jsonfield import JSONField
|
from jsonfield import JSONField
|
||||||
|
|
||||||
|
@ -597,46 +596,6 @@ class UnlockMarkerCell(CellBase):
|
||||||
def render(self, context):
|
def render(self, context):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
@register_cell_class
|
|
||||||
class BlurpCell(CellBase):
|
|
||||||
blurp_key = models.CharField(max_length=50)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_cell_types(cls):
|
|
||||||
try:
|
|
||||||
blurp_renderers = settings.CMS_PLUGIN_BLURP_RENDERERS
|
|
||||||
except AttributeError:
|
|
||||||
return []
|
|
||||||
l = []
|
|
||||||
for blurp_key, blurp_value in blurp_renderers.items():
|
|
||||||
if blurp_value.get('private'):
|
|
||||||
continue
|
|
||||||
l.append({
|
|
||||||
'name': blurp_value.get('name'),
|
|
||||||
'cell_type_str': cls.get_cell_type_str(),
|
|
||||||
'group': _('Extra'),
|
|
||||||
'variant': blurp_key,
|
|
||||||
})
|
|
||||||
l.sort(lambda x, y: cmp(x.get('name'), y.get('name')))
|
|
||||||
return l
|
|
||||||
|
|
||||||
def get_label(self):
|
|
||||||
return settings.CMS_PLUGIN_BLURP_RENDERERS[self.blurp_key]['name']
|
|
||||||
|
|
||||||
def set_variant(self, variant):
|
|
||||||
self.blurp_key = variant
|
|
||||||
|
|
||||||
def render(self, context):
|
|
||||||
if settings.CMS_PLUGIN_BLURP_RENDERERS[self.blurp_key].get('ajax') and not context.get('synchronous'):
|
|
||||||
raise NothingInCacheException()
|
|
||||||
renderer = cmsplugin_blurp.utils.resolve_renderer(self.blurp_key)
|
|
||||||
template = renderer.render_template()
|
|
||||||
context = renderer.render(context)
|
|
||||||
return template.render(context)
|
|
||||||
|
|
||||||
def get_default_form_class(self):
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
@register_cell_class
|
@register_cell_class
|
||||||
class MenuCell(CellBase):
|
class MenuCell(CellBase):
|
||||||
|
|
|
@ -58,7 +58,6 @@ INSTALLED_APPS = (
|
||||||
'ckeditor',
|
'ckeditor',
|
||||||
'gadjo',
|
'gadjo',
|
||||||
'sorl.thumbnail',
|
'sorl.thumbnail',
|
||||||
'cmsplugin_blurp',
|
|
||||||
'combo.data',
|
'combo.data',
|
||||||
'combo.profile',
|
'combo.profile',
|
||||||
'combo.manager',
|
'combo.manager',
|
||||||
|
|
|
@ -14,7 +14,6 @@ Depends: ${misc:Depends}, ${python:Depends},
|
||||||
python-gadjo,
|
python-gadjo,
|
||||||
python-requests,
|
python-requests,
|
||||||
python-feedparser,
|
python-feedparser,
|
||||||
python-django-cmsplugin-blurp,
|
|
||||||
python-xstatic-chartnew-js,
|
python-xstatic-chartnew-js,
|
||||||
python-xstatic-josefinsans,
|
python-xstatic-josefinsans,
|
||||||
python-xstatic-leaflet,
|
python-xstatic-leaflet,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
Django>=1.8, <1.9
|
Django>=1.8, <1.9
|
||||||
django-ckeditor<4.5.3
|
django-ckeditor<4.5.3
|
||||||
gadjo
|
gadjo
|
||||||
django-cmsplugin-blurp
|
|
||||||
feedparser
|
feedparser
|
||||||
django-jsonfield
|
django-jsonfield
|
||||||
requests
|
requests
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -106,7 +106,6 @@ setup(
|
||||||
install_requires=['django>=1.8, <1.9',
|
install_requires=['django>=1.8, <1.9',
|
||||||
'django-ckeditor<4.5.3',
|
'django-ckeditor<4.5.3',
|
||||||
'gadjo',
|
'gadjo',
|
||||||
'django-cmsplugin-blurp',
|
|
||||||
'feedparser',
|
'feedparser',
|
||||||
'django-jsonfield',
|
'django-jsonfield',
|
||||||
'requests',
|
'requests',
|
||||||
|
|
Loading…
Reference in New Issue