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 2020/06/24 19:36:54 UTC

[airavata-django-portal] 01/02: AIRAVATA-3347 Add `interval` to BootstrapCarousel block

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 27b2667ca0f104256a4808c830b6e98beeaf47bd
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jun 24 15:36:08 2020 -0400

    AIRAVATA-3347 Add `interval` to BootstrapCarousel block
---
 django_airavata/static/common/js/cms.js            |  4 --
 .../templates/blocks/bootstrap/carousel.html       |  2 +-
 django_airavata/wagtailapps/base/blocks.py         |  4 ++
 .../base/migrations/0024_auto_20200624_1925.py     | 50 ++++++++++++++++++++++
 4 files changed, 55 insertions(+), 5 deletions(-)

diff --git a/django_airavata/static/common/js/cms.js b/django_airavata/static/common/js/cms.js
index 45583b2..7e6153e 100644
--- a/django_airavata/static/common/js/cms.js
+++ b/django_airavata/static/common/js/cms.js
@@ -7,7 +7,3 @@ import "@fortawesome/fontawesome-free/css/all.css";
 $(function() {
   $('[data-toggle="tooltip"]').tooltip();
 });
-
-$('.carousel').carousel({
-  interval: 2000
-})
diff --git a/django_airavata/templates/blocks/bootstrap/carousel.html b/django_airavata/templates/blocks/bootstrap/carousel.html
index ef76efe..284973d 100755
--- a/django_airavata/templates/blocks/bootstrap/carousel.html
+++ b/django_airavata/templates/blocks/bootstrap/carousel.html
@@ -1,7 +1,7 @@
 
 {% load wagtailimages_tags %}
 
-<div id="carouselExampleIndicators" class="carousel slide {%if self.custom_class %}{{self.custom_class}}{% endif %}" data-ride="carousel">
+<div id="carouselExampleIndicators" class="carousel slide {%if self.custom_class %}{{self.custom_class}}{% endif %}" data-ride="carousel" data-interval="{{self.interval}}">
   <ol class="carousel-indicators">
     <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
     {% if self.c_image2 %}<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>{% endif %}
diff --git a/django_airavata/wagtailapps/base/blocks.py b/django_airavata/wagtailapps/base/blocks.py
index bbb8a6d..729d7e2 100644
--- a/django_airavata/wagtailapps/base/blocks.py
+++ b/django_airavata/wagtailapps/base/blocks.py
@@ -338,6 +338,10 @@ class BootstrapCarousel(StructBlock):
     """
     Custom 'StructBlock' that allows the user to make a bootstrap carousel
     """
+    interval = IntegerBlock(default=2000, help_text="""
+    The amount of time to delay between automatically cycling an item. If
+    false, carousel will not automatically cycle.
+    """)
     c_image1 = ImageChooserBlock(required=True)
     c_image1_title = TextBlock(
         required=False, blank=True, help_text="Give a title for image 1")
diff --git a/django_airavata/wagtailapps/base/migrations/0024_auto_20200624_1925.py b/django_airavata/wagtailapps/base/migrations/0024_auto_20200624_1925.py
new file mode 100644
index 0000000..bc4064b
--- /dev/null
+++ b/django_airavata/wagtailapps/base/migrations/0024_auto_20200624_1925.py
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.21 on 2020-06-24 19:25
+from __future__ import unicode_literals
+
+from django.db import migrations
+import wagtail.core.blocks
+import wagtail.core.fields
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.images.blocks
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('django_airavata_wagtail_base', '0023_rowblankpagerelation_container'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='cybergatewayhomepage',
+            name='contact',
+            field=wagtail.core.fields.StreamField((('paragraph_block', wagtail.core.blocks.StructBlock((('custom_class', wagtail.core.blocks.TextBlock(blank=True, help_text='control this element by giving unique class names separated by space and styling the class in css', required=False)), ('body', wagtail.core.blocks.RichTextBlock())))), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.Ch [...]
+        ),
+        migrations.AlterField(
+            model_name='cybergatewayhomepage',
+            name='footer',
+            field=wagtail.core.fields.StreamField((('paragraph_block', wagtail.core.blocks.StructBlock((('custom_class', wagtail.core.blocks.TextBlock(blank=True, help_text='control this element by giving unique class names separated by space and styling the class in css', required=False)), ('body', wagtail.core.blocks.RichTextBlock())))), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.Ch [...]
+        ),
+        migrations.AlterField(
+            model_name='footertext',
+            name='footer',
+            field=wagtail.core.fields.StreamField((('paragraph_block', wagtail.core.blocks.StructBlock((('custom_class', wagtail.core.blocks.TextBlock(blank=True, help_text='control this element by giving unique class names separated by space and styling the class in css', required=False)), ('body', wagtail.core.blocks.RichTextBlock())))), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.Ch [...]
+        ),
+        migrations.AlterField(
+            model_name='homepage',
+            name='body',
+            field=wagtail.core.fields.StreamField((('paragraph_block', wagtail.core.blocks.StructBlock((('custom_class', wagtail.core.blocks.TextBlock(blank=True, help_text='control this element by giving unique class names separated by space and styling the class in css', required=False)), ('body', wagtail.core.blocks.RichTextBlock())))), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.Ch [...]
+        ),
+        migrations.AlterField(
+            model_name='rowblankpagerelation',
+            name='body',
+            field=wagtail.core.fields.StreamField((('paragraph_block', wagtail.core.blocks.StructBlock((('custom_class', wagtail.core.blocks.TextBlock(blank=True, help_text='control this element by giving unique class names separated by space and styling the class in css', required=False)), ('body', wagtail.core.blocks.RichTextBlock())))), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.Ch [...]
+        ),
+        migrations.AlterField(
+            model_name='rowcybergatewayhomepagerelation',
+            name='body',
+            field=wagtail.core.fields.StreamField((('paragraph_block', wagtail.core.blocks.StructBlock((('custom_class', wagtail.core.blocks.TextBlock(blank=True, help_text='control this element by giving unique class names separated by space and styling the class in css', required=False)), ('body', wagtail.core.blocks.RichTextBlock())))), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.Ch [...]
+        ),
+    ]