From 3887bf542963b79d979ad5ef79bc1c4306670f90 Mon Sep 17 00:00:00 2001 From: octavioamu Date: Mon, 14 Sep 2020 15:04:22 -0300 Subject: [PATCH] styles for banners and grid fixes --- app/assets/v2/css/grants/grant.css | 1 - app/assets/v2/js/grants/funding.js | 16 +++------------- app/grants/templates/grants/index.html | 6 +++--- app/grants/views.py | 14 ++++++++++++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app/assets/v2/css/grants/grant.css b/app/assets/v2/css/grants/grant.css index 16348d2e37e..bff38719a32 100644 --- a/app/assets/v2/css/grants/grant.css +++ b/app/assets/v2/css/grants/grant.css @@ -630,7 +630,6 @@ background: linear-gradient(85.75deg, #03008D -17.8%, #000000 139.56%); /* W3C, } .grants_hero_img{ - background-size: contain !important; background-position-x: 50%; background-color: #030118; } diff --git a/app/assets/v2/js/grants/funding.js b/app/assets/v2/js/grants/funding.js index e28aa4baf58..169a1afadda 100644 --- a/app/assets/v2/js/grants/funding.js +++ b/app/assets/v2/js/grants/funding.js @@ -239,19 +239,9 @@ function hideSideCart() { } function toggleSideCart() { - $('#grants-details').toggleClass('col-12'); - $('#grants-details').toggleClass('col-md-8'); - $('#grants-details').toggleClass('col-lg-9'); - $('#grants-details').toggleClass('d-none'); - $('#grants-details').toggleClass('d-md-block'); + $('#grants-details > div').toggleClass('col-12 col-md-8 col-lg-9 d-none d-md-block'); $('#side-cart').toggle(); - $('#side-cart').toggleClass('col-12'); - $('#side-cart').toggleClass('col-md-4'); - $('#side-cart').toggleClass('col-lg-3'); - - $('#funding-card').toggleClass('mr-md-5'); - $('#funding-card').toggleClass('mr-md-3'); - $('#funding-card').toggleClass('d-none'); - $('#funding-card').toggleClass('d-lg-block'); + $('#side-cart').toggleClass('col-12 col-md-4 col-lg-3'); + $('#funding-card').toggleClass('mr-md-5 mr-md-3 d-none d-lg-block'); } diff --git a/app/grants/templates/grants/index.html b/app/grants/templates/grants/index.html index bc51b3b90ee..e68c2b97162 100644 --- a/app/grants/templates/grants/index.html +++ b/app/grants/templates/grants/index.html @@ -44,12 +44,12 @@ {% include 'shared/tag_manager_2.html' %} {% include 'shared/top_nav.html' with class='d-md-flex' %} {% include 'grants/nav.html' %} -
+
{% include 'shared/grant_thanks_modal.html' %} {% include 'grants/shared/landing_hero.html' %} -
-
+
+
diff --git a/app/grants/views.py b/app/grants/views.py index e52a8137def..154d7ba44ca 100644 --- a/app/grants/views.py +++ b/app/grants/views.py @@ -453,6 +453,8 @@ def get_bg(grant_type): bg = 4 bg = f"{bg}.jpg" mid_back = 'bg14.png' + bg_size = 'contain' + bg_color = '#030118' bottom_back = 'bg13.gif' if grant_type == 'tech': bottom_back = 'bg20-2.png' @@ -468,9 +470,12 @@ def get_bg(grant_type): if grant_type != 'matic': bg = '../grants/grants_header_donors_round_7.png' if grant_type == 'matic': + # bg = '../grants/matic-banner.png' bg = '../grants/matic-banner.png' + bg_size = 'cover' + bg_color = '#0c1844' - return bg, mid_back, bottom_back + return bg, mid_back, bottom_back, bg_size, bg_color def grants_by_grant_type(request, grant_type): @@ -491,7 +496,7 @@ def grants_by_grant_type(request, grant_type): category = '' profile = get_profile(request) _grants = None - bg, mid_back, bottom_back = get_bg(grant_type) + bg, mid_back, bottom_back, bg_size, bg_color = get_bg(grant_type) show_past_clr = False sort_by_index = None @@ -602,6 +607,11 @@ def grants_by_grant_type(request, grant_type): 'can_pin': can_pin(request, what), 'pinned': pinned, 'target': f'/activity?what=all_grants', + 'styles': { + 'bg': bg, + 'bg_size': bg_size, + 'bg_color': bg_color + }, 'bg': bg, 'keywords': get_keywords(), 'grant_amount': grant_amount,