import logging

from wagtail.admin.panels import FieldPanel, TabbedInterface, ObjectList

from core.wagtail_utils import StrictHierarchyPage, get_default_settings

logger = logging.getLogger(__name__)


class Book(StrictHierarchyPage):
    class Meta:
        verbose_name = 'Buch'
        verbose_name_plural = 'Bücher'

    content_panels = [
        FieldPanel('title', classname="full title")
    ]

    edit_handler = TabbedInterface([
        ObjectList(content_panels, heading='Content'),
        get_default_settings()
    ])

    template = 'generic_page.html'

    subpage_types = ['books.Topic', 'basicknowledge.BasicKnowledge']
