# -*- coding: utf-8 -*-
from django.utils.translation import gettext_lazy as _

from wagtail.admin.panels import FieldPanel
from wagtail.fields import StreamField

from ocyan.main.loading import get_ocyan_class
from ocyan.plugin.wagtail.models import AbstractBasePage

streamfields = get_ocyan_class("wagtail_content_page.utils", "streamfields")


class AbstractContentPage(AbstractBasePage):
    body = StreamField(streamfields(), use_json_field=True)

    content_panels = AbstractBasePage.content_panels + [FieldPanel("body")]

    page_description = _("Plain vanilla page with all available blocks.")

    class Meta:
        verbose_name = _("Content page")
        verbose_name_plural = _("Content pages")
        abstract = True
