skillbox/server/book/blocks.py

32 lines
731 B
Python

from wagtail.core import blocks
from wagtail.core.blocks.field_block import RichTextBlock
from wagtail.documents.blocks import DocumentChooserBlock
DEFAULT_RICH_TEXT_FEATURES = ['bold', 'italic', 'link', 'ol', 'ul']
class LinkBlock(blocks.StructBlock):
url = blocks.URLBlock()
description = blocks.CharBlock()
class DocumentBlock(blocks.StructBlock):
document = DocumentChooserBlock()
description = blocks.CharBlock()
class TextBlock(blocks.StructBlock):
text = blocks.CharBlock()
class ModalTextBlock(blocks.StructBlock):
description = blocks.CharBlock()
modal_content = blocks.CharBlock()
class StudentEntryBlock(blocks.StructBlock):
task_text = blocks.CharBlock()
# class ImageBlock