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 2019/04/01 19:34:23 UTC

[airavata-django-portal] branch master updated: Support image overlay backgrounds for bootstrap cards

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 7253527  Support image overlay backgrounds for bootstrap cards
7253527 is described below

commit 7253527726971969ed502ef5b92500719a116275
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Apr 1 15:34:13 2019 -0400

    Support image overlay backgrounds for bootstrap cards
---
 django_airavata/templates/blocks/bootstrap/card.html | 4 ++++
 django_airavata/wagtailapps/base/blocks.py           | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/django_airavata/templates/blocks/bootstrap/card.html b/django_airavata/templates/blocks/bootstrap/card.html
index 21b59ee..74ceea9 100755
--- a/django_airavata/templates/blocks/bootstrap/card.html
+++ b/django_airavata/templates/blocks/bootstrap/card.html
@@ -6,7 +6,11 @@
       {% image self.card_img original as tmp_photo %}
       <img src="{{tmp_photo.url}}" style="width:{{self.card_img_width}};height:{{self.card_img_height}};margin:auto" alt="image" class="card-img-top img-fluid"/>
     {% endif %}
+    {% if self.is_card_img_overlay %}
+    <div class="card-img-overlay">
+    {% else %}
     <div class="card-body">
+    {% endif %}
       <h5 class="card-title">{{self.card_title}}</h5>
       <p class="card-text">{{self.card_text}}</p>
       {% if value.buttons %}
diff --git a/django_airavata/wagtailapps/base/blocks.py b/django_airavata/wagtailapps/base/blocks.py
index e8e5d64..7b22bbb 100644
--- a/django_airavata/wagtailapps/base/blocks.py
+++ b/django_airavata/wagtailapps/base/blocks.py
@@ -290,6 +290,11 @@ class BootstrapCard(StructBlock):
     card_width = IntegerBlock(
         help_text="18 works best for card", required=False, blank=True)
     is_card_img = BooleanBlock(required=False)
+    is_card_img_overlay = BooleanBlock(
+        required=False,
+        default=False,
+        help_text="Use image as background for card",
+        label="Image Overlay?")
     card_img = ImageChooserBlock(required=False)
     card_img_width = IntegerBlock(
         required=False, help_text="provide an image width")