From cb6d3408841386baf5745b59c3216066a5cc2028 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Je=CC=81re=CC=81my=20Fabre?= Date: Wed, 27 Jul 2016 17:32:35 +0200 Subject: [PATCH] Add photo_card in page_card template --- app/static/src/sass/modules/boxes/_page-box.scss | 7 ++++++- app/templates/pages/basicpage.html | 12 +++++++----- app/templates/pages/department.html | 12 +++++++----- app/templates/pages/includes/page_card.html | 11 ++++++++++- app/templates/pages/team.html | 12 +++++++----- 5 files changed, 37 insertions(+), 17 deletions(-) diff --git a/app/static/src/sass/modules/boxes/_page-box.scss b/app/static/src/sass/modules/boxes/_page-box.scss index 81080e31..fcebba99 100644 --- a/app/static/src/sass/modules/boxes/_page-box.scss +++ b/app/static/src/sass/modules/boxes/_page-box.scss @@ -8,6 +8,12 @@ $module: ".page-box"; @include margin-bottom(1); + &:first-of-type { + + @include margin-top(3); + + } + &__image { @include fluid-aspect(9 4, "img"); @@ -59,7 +65,6 @@ $module: ".page-box"; font-weight: weight(bold); @include font-size(m); - @include margin(0 0 1 0); } diff --git a/app/templates/pages/basicpage.html b/app/templates/pages/basicpage.html index 82150088..3b725475 100644 --- a/app/templates/pages/basicpage.html +++ b/app/templates/pages/basicpage.html @@ -44,11 +44,13 @@ {% if page.get_ascendants|length == 1 %} {% children_pages page.id as childrens %} {% if childrens %} - {% for children in childrens %} - {% with children as object %} - {% include "pages/includes/page_card.html" %} - {% endwith %} - {% endfor %} +
+ {% for children in childrens %} + {% with children as object %} + {% include "pages/includes/page_card.html" %} + {% endwith %} + {% endfor %} +
{% endif %} {% endif %} diff --git a/app/templates/pages/department.html b/app/templates/pages/department.html index 570ca61d..2421ff4b 100644 --- a/app/templates/pages/department.html +++ b/app/templates/pages/department.html @@ -48,11 +48,13 @@ {% if page.get_ascendants|length == 1 %} {% children_pages page.id as childrens %} {% if childrens %} - {% for children in childrens %} - {% with children as object %} - {% include "pages/includes/page_card.html" %} - {% endwith %} - {% endfor %} +
+ {% for children in childrens %} + {% with children as object %} + {% include "pages/includes/page_card.html" %} + {% endwith %} + {% endfor %} +
{% endif %} {% endif %} diff --git a/app/templates/pages/includes/page_card.html b/app/templates/pages/includes/page_card.html index 40bbd8cc..e9421603 100644 --- a/app/templates/pages/includes/page_card.html +++ b/app/templates/pages/includes/page_card.html @@ -1,6 +1,15 @@ +{% load mezzanine_tags %}
- + {% if object.basicpage.photo_card %} + + {% elif object.department.photo_card %} + + {% elif object.team.photo_card %} + + {% else %} + + {% endif %}
diff --git a/app/templates/pages/team.html b/app/templates/pages/team.html index d7bf846d..98562cbf 100644 --- a/app/templates/pages/team.html +++ b/app/templates/pages/team.html @@ -44,11 +44,13 @@ {% if page.get_ascendants|length == 1 %} {% children_pages page.id as childrens %} {% if childrens %} - {% for children in childrens %} - {% with children as object %} - {% include "pages/includes/page_card.html" %} - {% endwith %} - {% endfor %} +
+ {% for children in childrens %} + {% with children as object %} + {% include "pages/includes/page_card.html" %} + {% endwith %} + {% endfor %} +
{% endif %} {% endif %} -- 2.39.5