You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/08/20 17:53:48 UTC

[airavata-django-portal] 01/06: AIRAVATA-3499 RawHTMLBlock integration

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 2e9c9637dcab3989062867eb8ac346ab54f18fbf
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Aug 20 09:11:58 2021 -0400

    AIRAVATA-3499 RawHTMLBlock integration
---
 django_airavata/settings.py                |  6 ++++--
 django_airavata/wagtailapps/base/blocks.py | 13 +++++++------
 requirements.txt                           |  1 +
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/django_airavata/settings.py b/django_airavata/settings.py
index 2df6278..68ba46c 100644
--- a/django_airavata/settings.py
+++ b/django_airavata/settings.py
@@ -69,6 +69,7 @@ INSTALLED_APPS = [
     'taggit',
     'wagtailfontawesome',
     'wagtail_draftail_anchors',
+    'wagtailcodeblock',
 
     # wagtail custom apps
     'django_airavata.wagtailapps.base.apps.BaseConfig',
@@ -422,8 +423,8 @@ LOGGING = {
     },
 }
 
-#wagtailcodeblock theme and languages
-WAGTAIL_CODE_BLOCK_THEME=None
+# wagtailcodeblock theme and languages
+WAGTAIL_CODE_BLOCK_THEME = None
 WAGTAIL_CODE_BLOCK_LANGUAGES = (
     ('abap', 'ABAP'),
     ('abnf', 'Augmented Backus–Naur form'),
@@ -621,6 +622,7 @@ WAGTAIL_CODE_BLOCK_LANGUAGES = (
     ('zig', 'Zig'),
 )
 
+
 def merge_setting(default, custom_setting):
     # FIXME: only handles dict settings, doesn't handle lists
     if isinstance(custom_setting, dict):
diff --git a/django_airavata/wagtailapps/base/blocks.py b/django_airavata/wagtailapps/base/blocks.py
index 6761351..3fbb022 100644
--- a/django_airavata/wagtailapps/base/blocks.py
+++ b/django_airavata/wagtailapps/base/blocks.py
@@ -13,7 +13,6 @@ from wagtail.core.blocks import (
 from wagtail.documents.blocks import DocumentChooserBlock
 from wagtail.embeds.blocks import EmbedBlock
 from wagtail.images.blocks import ImageChooserBlock
-from wagtailmarkdownblock.blocks import MarkdownBlock
 from wagtailcodeblock.blocks import CodeBlock
 
 
@@ -256,6 +255,7 @@ class BootstrapButton(StructBlock):
         template = "blocks/bootstrap/button.html"
         help_text = "Create a bootstrap button"
 
+
 class BootstrapButtonMore(StructBlock):
     """
     Custom 'StructBlock' that allows the user to make a bootstrap button
@@ -283,19 +283,20 @@ class BootstrapButtonMore(StructBlock):
         required=False,
         blank=True,
         help_text="control the look of this body by giving unique class names "
-                  "separated by space and styling the class in css")   
+                  "separated by space and styling the class in css")
     custom_class2 = TextBlock(
         required=False,
         blank=True,
         help_text="control the look of this body by giving unique style names "
-                  "separated by space and styling the class in css")            
-    body = blocks.RichTextBlock(features=['h1','h2','h3','h4','h5','h6','code','blockquote','bold','italic','ol','ul','hr','link','document-link','image','embed'])
+                  "separated by space and styling the class in css")
+    body = RichTextBlock()
+
     class Meta:
         icon = "fa-bold"
         template = "blocks/bootstrap/buttonmore.html"
-        help_text = "Create a bootstrap button"        
+        help_text = "Create a bootstrap button"
+
 
-        
 class BootstrapAlert(StructBlock):
     """
     Custom 'StructBlock' that allows the user to make a bootstrap alert
diff --git a/requirements.txt b/requirements.txt
index 46808fe..e03eaae 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,6 +10,7 @@ django-webpack-loader==0.6.0
 wagtail==2.11.7
 wagtailfontawesome==1.2.1
 wagtail-draftail-anchors==0.2.0
+wagtailcodeblock==1.17.1.0
 
 jupyter==1.0.0
 papermill==1.0.1