From cbdf68a58391c92405b2005ba70f7e2fb988f0d4 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 5 Dec 2016 14:23:11 +0000 Subject: [PATCH] add markdown field --- project/common/fields.py | 8 +++++--- requirements.txt | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/project/common/fields.py b/project/common/fields.py index ac40f48..8778ad5 100644 --- a/project/common/fields.py +++ b/project/common/fields.py @@ -2,6 +2,7 @@ from wagtail.wagtailcore.fields import StreamField from wagtail.wagtailcore import blocks from wagtail.wagtailimages.blocks import ImageChooserBlock from wagtail.wagtaildocs.blocks import DocumentChooserBlock +from wagtailmarkdown.blocks import MarkdownBlock def build_header_fields(): @@ -14,13 +15,14 @@ def build_fixed_fields(): return [ ('ansi', blocks.TextBlock(template="blocks/ansi.html")), ('document', DocumentChooserBlock()), - ('gist', blocks.CharBlock(template="blocks/gist.html")), + ('gist', blocks.CharBlock(icon="code", template="blocks/gist.html")), ('image', ImageChooserBlock()), - ('ol', blocks.ListBlock(blocks.CharBlock(label="List Item"), label="Ordered List", template='blocks/ordered-list.html')), + ('markdown', MarkdownBlock()), + ('ol', blocks.ListBlock(blocks.CharBlock(label="List Item"), icon="list-ol", 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")), + ('ul', blocks.ListBlock(blocks.CharBlock(label="List Item"), icon="list-ul", label="Unordered List")), ] diff --git a/requirements.txt b/requirements.txt index 4285676..80888c3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,5 +8,6 @@ psycopg2==2.6.2 pygments-style-github==0.4 safety==0.5.1 wagtail>=1.7,<1.8 +git+https://github.com/RealOrangeOne/wagtail-markdown waitress==1.0.1 whitenoise==3.2.2