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