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 <[email protected]> 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")
