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:47 UTC

[airavata-django-portal] branch develop updated (6d2bd4e -> c5532b3)

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

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


    from 6d2bd4e  Log ObjectDoesNotExist errors at warning level
     add 13fe2f2  Update blocks.py
     add 1086c90  Merge pull request #64 from musecian/patch-1
     add ed90e2f  Create buttonmore.html
     add 4b28189  Merge pull request #65 from musecian/patch-2
     add 76cb794  Update settings.py
     add 0906deb  Merge pull request #66 from musecian/patch-3
     new 2e9c963  AIRAVATA-3499 RawHTMLBlock integration
     new e3ca58f  AIRAVATA-3500 Update label and icon of CodeBlock
     new 64e96ff  AIRAVATA-3488 Removing unused css
     new 87eaf40  AIRAVATA-3488 Adding classes to style rendered blockquote
     new fc24908  AIRAVATA-3488 Update Wagtail to 2.11.8 (security fix)
     new c5532b3  AIRAVATA-3501 more button name changes for clarity

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 django_airavata/settings.py                        | 200 +++++++++++++++++++++
 django_airavata/static/css/draft-colors.css        |   3 -
 .../templates/blocks/bootstrap/buttonmore.html     |   7 +
 django_airavata/templates/includes/head.html       |   2 -
 django_airavata/wagtailapps/base/blocks.py         |  46 +++++
 django_airavata/wagtailapps/base/wagtail_hooks.py  |  17 ++
 requirements.txt                                   |   3 +-
 7 files changed, 272 insertions(+), 6 deletions(-)
 delete mode 100644 django_airavata/static/css/draft-colors.css
 create mode 100644 django_airavata/templates/blocks/bootstrap/buttonmore.html

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

Posted by ma...@apache.org.
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

[airavata-django-portal] 02/06: AIRAVATA-3500 Update label and icon of CodeBlock

Posted by ma...@apache.org.
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 e3ca58ff45317cdc95816f22436ecc2764fadfd2
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Aug 20 09:58:20 2021 -0400

    AIRAVATA-3500 Update label and icon of CodeBlock
---
 django_airavata/wagtailapps/base/blocks.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/django_airavata/wagtailapps/base/blocks.py b/django_airavata/wagtailapps/base/blocks.py
index 3fbb022..762e1b7 100644
--- a/django_airavata/wagtailapps/base/blocks.py
+++ b/django_airavata/wagtailapps/base/blocks.py
@@ -524,7 +524,8 @@ class BaseStreamBlock(StreamBlock):
     bootstrap_embed_video = BootstrapEmbedVideo()
     buttonmore_block = BootstrapButtonMore()
     HTML_code = RawHTMLBlock()
-    code_to_copy = CodeBlock()
+    # Using 'snippet' icon for uniqueness (RawHTMLBlock already uses 'code' icon)
+    code_snippet = CodeBlock(icon="snippet")
 
 
 class CssStreamBlock(StreamBlock):

[airavata-django-portal] 06/06: AIRAVATA-3501 more button name changes for clarity

Posted by ma...@apache.org.
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 c5532b36ec1fcf3b05f2a3290dc7b4ffeb06c6f8
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Aug 20 13:51:10 2021 -0400

    AIRAVATA-3501 more button name changes for clarity
---
 .../templates/blocks/bootstrap/buttonmore.html       |  9 ++++++---
 django_airavata/wagtailapps/base/blocks.py           | 20 ++++++++++----------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/django_airavata/templates/blocks/bootstrap/buttonmore.html b/django_airavata/templates/blocks/bootstrap/buttonmore.html
index d0bbab1..1726541 100644
--- a/django_airavata/templates/blocks/bootstrap/buttonmore.html
+++ b/django_airavata/templates/blocks/bootstrap/buttonmore.html
@@ -1,4 +1,7 @@
-<a class="btn {{self.button_color}} {{self.button_size}} {{self.custom_class}}" data-toggle="collapse" href="#{{ self.button_link }}">{{self.button_text}}</a>
-<div id="{% if self.button_link %}{{ self.button_link }}{% endif %}" class="collapse {% if self.custom_class1 %}{{self.custom_class1}}{% endif %}" style="{% if self.custom_class2 %}{{self.custom_class2}}{% endif %}">
-    {{ self.body }} 
+
+<a class="btn {{self.button_color}} {{self.button_size}} {{self.button_class}}" data-toggle="collapse" href="#{{ self.button_id | slugify }}">{{self.button_text}}</a>
+<div id="{{ self.button_id | slugify }}"
+     class="collapse {% if self.body_class %}{{self.body_class}}{% endif %}"
+     {% if self.body_inline_style %}style="{{self.body_inline_style}}"{% endif %}>
+    {{ self.body }}
 </div>
diff --git a/django_airavata/wagtailapps/base/blocks.py b/django_airavata/wagtailapps/base/blocks.py
index 762e1b7..fe25196 100644
--- a/django_airavata/wagtailapps/base/blocks.py
+++ b/django_airavata/wagtailapps/base/blocks.py
@@ -258,10 +258,11 @@ class BootstrapButton(StructBlock):
 
 class BootstrapButtonMore(StructBlock):
     """
-    Custom 'StructBlock' that allows the user to make a bootstrap button
+    Custom 'StructBlock' that allows the user to make a bootstrap button that
+    toggles collapsible rich text block
     """
     button_text = TextBlock()
-    button_link = TextBlock()
+    button_id = TextBlock(help_text="Unique name for this collapsible")
     button_color = ChoiceBlock(choices=[
         ('btn-primary', 'DEFAULT'),
         ('btn-danger', 'RED'),
@@ -274,27 +275,26 @@ class BootstrapButtonMore(StructBlock):
         ('btn-lg', 'LARGE'),
         ('btn-sm', 'SMALL')
     ], blank=True, required=False, help_text="select a button size")
-    custom_class = TextBlock(
+    button_class = TextBlock(
         required=False,
         blank=True,
         help_text="control the look of this button by giving unique class names "
                   "separated by space and styling the class in css")
-    custom_class1 = TextBlock(
+    body_class = TextBlock(
         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")
-    custom_class2 = TextBlock(
+    body_inline_style = 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")
+        help_text="apply inline CSS styles to body")
     body = RichTextBlock()
 
     class Meta:
-        icon = "fa-bold"
+        icon = "collapse-up"
         template = "blocks/bootstrap/buttonmore.html"
-        help_text = "Create a bootstrap button"
+        help_text = "Create a button that will toggle the display of a rich text body of text"
 
 
 class BootstrapAlert(StructBlock):
@@ -522,7 +522,7 @@ class BaseStreamBlock(StreamBlock):
     font_awesome_icon_block = FontAwesomeIcon()
     iu_footer_block = IuFooter()
     bootstrap_embed_video = BootstrapEmbedVideo()
-    buttonmore_block = BootstrapButtonMore()
+    expandable_rich_text_block = BootstrapButtonMore()
     HTML_code = RawHTMLBlock()
     # Using 'snippet' icon for uniqueness (RawHTMLBlock already uses 'code' icon)
     code_snippet = CodeBlock(icon="snippet")

[airavata-django-portal] 04/06: AIRAVATA-3488 Adding classes to style rendered blockquote

Posted by ma...@apache.org.
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 87eaf40f292691ca90537caf3bca2c6b6262a8ec
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Aug 20 13:04:19 2021 -0400

    AIRAVATA-3488 Adding classes to style rendered blockquote
---
 django_airavata/wagtailapps/base/wagtail_hooks.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/django_airavata/wagtailapps/base/wagtail_hooks.py b/django_airavata/wagtailapps/base/wagtail_hooks.py
index 11e211a..9adc032 100644
--- a/django_airavata/wagtailapps/base/wagtail_hooks.py
+++ b/django_airavata/wagtailapps/base/wagtail_hooks.py
@@ -2,6 +2,7 @@ import logging
 
 from django.shortcuts import redirect
 from wagtail.core import hooks
+from wagtail.admin.rich_text.converters.html_to_contentstate import BlockElementHandler
 
 logger = logging.getLogger(__name__)
 
@@ -18,6 +19,22 @@ def register_custom_style_feature(features):
     features.default_features.append('blockquote')
     # logger.debug(f"default_features={features.default_features}")
 
+    # Add classes to style the rendered blockquote element
+    features.register_converter_rule('contentstate', 'blockquote', {
+        'from_database_format': {'blockquote[class]': BlockElementHandler('blockquote')},
+        'to_database_format': {
+            'block_map': {
+                'blockquote': {
+                    'element': 'blockquote',
+                    'props': {
+                        # Bootstrap styling: 'blockquote' base style plus margin-left
+                        'class': 'blockquote ml-3',
+                    },
+                },
+            },
+        },
+    })
+
 
 DIRECT_SERVE_FILE_EXTENSIONS = ["pdf"]
 

[airavata-django-portal] 03/06: AIRAVATA-3488 Removing unused css

Posted by ma...@apache.org.
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 64e96ff476154b2ecca9a7273b34068854eed096
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Aug 20 13:03:55 2021 -0400

    AIRAVATA-3488 Removing unused css
---
 django_airavata/static/css/draft-colors.css  | 3 ---
 django_airavata/templates/includes/head.html | 2 --
 2 files changed, 5 deletions(-)

diff --git a/django_airavata/static/css/draft-colors.css b/django_airavata/static/css/draft-colors.css
deleted file mode 100644
index 6e1cb97..0000000
--- a/django_airavata/static/css/draft-colors.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.purple {
-  color: purple;
-}
diff --git a/django_airavata/templates/includes/head.html b/django_airavata/templates/includes/head.html
index ba5098d..1ae1285 100644
--- a/django_airavata/templates/includes/head.html
+++ b/django_airavata/templates/includes/head.html
@@ -24,8 +24,6 @@
     <!-- Bootstrap Core + Font awesome CSS (see common/js/cms.js) -->
     {% render_bundle 'chunk-vendors' 'css' 'COMMON' %}
 
-    <link rel=stylesheet type=text/css href="{% static 'css/draft-colors.css' %}">
-
     {% block head-extra %}
       {% include "includes/head-extra.html" %}
     {% endblock head-extra %}

[airavata-django-portal] 05/06: AIRAVATA-3488 Update Wagtail to 2.11.8 (security fix)

Posted by ma...@apache.org.
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 fc249086c5da022ef4648bea9316b3e6d83a4c15
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Aug 20 13:12:13 2021 -0400

    AIRAVATA-3488 Update Wagtail to 2.11.8 (security fix)
---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index e03eaae..0fb6815 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,7 +7,7 @@ thrift_connector==0.24
 djangorestframework==3.11.2
 django-webpack-loader==0.6.0
 
-wagtail==2.11.7
+wagtail==2.11.8
 wagtailfontawesome==1.2.1
 wagtail-draftail-anchors==0.2.0
 wagtailcodeblock==1.17.1.0