From 5ba788c76a22e931119af3b153dcf532d73ae785 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Je=CC=81re=CC=81my=20Fabre?= Date: Fri, 4 Nov 2016 14:47:17 +0100 Subject: [PATCH] Add pattern to page box --- .../src/sass/modules/boxes/_page-box.scss | 31 +++++++++++++++++-- .../pages/page/includes/page_box.html | 16 +++++++--- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/app/static/src/sass/modules/boxes/_page-box.scss b/app/static/src/sass/modules/boxes/_page-box.scss index 24f76636..52ee4cf4 100644 --- a/app/static/src/sass/modules/boxes/_page-box.scss +++ b/app/static/src/sass/modules/boxes/_page-box.scss @@ -21,10 +21,10 @@ $module: ".page-box"; &__image { - @include fluid-aspect(9 4, "img"); + @include fluid-aspect(9 4); @include mq($until: xs) { - @include fluid-aspect(4.5 8, "img"); + @include fluid-aspect(4.5 8); >img { width: 310%; left: -50%; @@ -47,6 +47,33 @@ $module: ".page-box"; } + &__placeholder { + + background: $color-main; + + &.pattern-bg--squares { + background-color: white; + background-image: url(../img/patterns/squares.png); + opacity: 0.4; + } + &.pattern-bg--circles { + background-color: white; + background-image: url(../img/patterns/circles.png); + opacity: 0.2; + } + &.pattern-bg--stripes { + background-color: white; + background-image: url(../img/patterns/stripes.png); + opacity: 0.4; + } + &.pattern-bg--triangles { + background-color: white; + background-image: url(../img/patterns/triangles.png); + opacity: 0.2; + } + + } + &__content { position: absolute; diff --git a/app/templates/pages/page/includes/page_box.html b/app/templates/pages/page/includes/page_box.html index 39f4cdf6..e02485bb 100644 --- a/app/templates/pages/page/includes/page_box.html +++ b/app/templates/pages/page/includes/page_box.html @@ -1,11 +1,17 @@ {% load mezzanine_tags organization_tags %}
- {% with object.get_content_model.images.all|get_type:'card' as images %} - {% if images %} - - {% endif %} - {% endwith %} + {% with object.get_content_model.images.all|get_type:'card' as images %} + {% if images %} + + {% else %} + {% with page.get_ascendants|last as top_level_parent %} + {% if top_level_parent.get_content_model.weaving_css_class %} +
+ {% endif %} + {% endwith %} + {% endif %} + {% endwith %}
-- 2.39.5