diff --git a/project/common/fields.py b/project/common/fields.py index 332a7ec..ac40f48 100644 --- a/project/common/fields.py +++ b/project/common/fields.py @@ -1,5 +1,7 @@ from wagtail.wagtailcore.fields import StreamField from wagtail.wagtailcore import blocks +from wagtail.wagtailimages.blocks import ImageChooserBlock +from wagtail.wagtaildocs.blocks import DocumentChooserBlock def build_header_fields(): @@ -10,10 +12,15 @@ def build_header_fields(): def build_fixed_fields(): return [ - ('list', blocks.ListBlock(blocks.CharBlock(label="List Item"), label="list-ul")), + ('ansi', blocks.TextBlock(template="blocks/ansi.html")), + ('document', DocumentChooserBlock()), + ('gist', blocks.CharBlock(template="blocks/gist.html")), + ('image', ImageChooserBlock()), + ('ol', blocks.ListBlock(blocks.CharBlock(label="List Item"), label="Ordered List", template='blocks/ordered-list.html')), ('paragraph', blocks.RichTextBlock()), ('raw_html', blocks.RawHTMLBlock(label="Raw HTML")), ('secret', blocks.RichTextBlock(icon="password", template='blocks/secret.html')), + ('ul', blocks.ListBlock(blocks.CharBlock(label="List Item"), label="Unordered List")), ] diff --git a/templates/blocks/ansi.html b/templates/blocks/ansi.html new file mode 100644 index 0000000..68f11a2 --- /dev/null +++ b/templates/blocks/ansi.html @@ -0,0 +1,3 @@ +
+  {{ value }}
+
diff --git a/templates/blocks/gist.html b/templates/blocks/gist.html new file mode 100644 index 0000000..9a41426 --- /dev/null +++ b/templates/blocks/gist.html @@ -0,0 +1 @@ + diff --git a/templates/blocks/ordered-list.html b/templates/blocks/ordered-list.html new file mode 100644 index 0000000..ccca959 --- /dev/null +++ b/templates/blocks/ordered-list.html @@ -0,0 +1,7 @@ +{% load wagtailcore_tags %} + +
    + {% for item in value %} +
  1. {{ item }}
  2. + {% endfor %} +