From 736c47137aed1e5c9f425b58d31e186b66b2e523 Mon Sep 17 00:00:00 2001 From: Erik Stein Date: Mon, 20 Aug 2018 19:49:23 +0200 Subject: [PATCH] Made SectionBase plugin filesystem based. --- CHANGES | 2 ++ content_plugins/base.py | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) create mode 100644 CHANGES diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..c981675 --- /dev/null +++ b/CHANGES @@ -0,0 +1,2 @@ +0.3.2 2018-08-20 +Made SectionBase plugin filesystem based. diff --git a/content_plugins/base.py b/content_plugins/base.py index 0e33780..a4d509a 100644 --- a/content_plugins/base.py +++ b/content_plugins/base.py @@ -145,13 +145,15 @@ class RichTextBase(StyleMixin, FilesystemTemplateRendererPlugin): return Truncator(strip_tags(self.richtext)).words(10, truncate=" ...") -class SectionBase(StyleMixin, BasePlugin): +class SectionBase(StyleMixin, FilesystemTemplateRendererPlugin): if USE_TRANSLATABLE_FIELDS: subheading = TranslatableCharField(_("subheading"), null=True, blank=True, max_length=500) else: subheading = models.CharField(_("subheading"), null=True, blank=True, max_length=500) slug = AutoSlugField(_("slug"), max_length=200, blank=True, populate_from='subheading', unique_slug=False) + template_name = '_sectionbreak.html' + class Meta: abstract = True verbose_name = _("section") @@ -160,14 +162,6 @@ class SectionBase(StyleMixin, BasePlugin): def __str__(self): return Truncator(strip_tags(self.subheading)).words(10, truncate=" ...") - def get_template(self): - return Template(""" - - -
-

{{ subheading }}

- """) - def get_plugin_context(self, context=None, **kwargs): context = super().get_plugin_context(context=None, **kwargs) context['slug'] = self.slug