From: Jérémy Fabre Date: Wed, 27 Jul 2016 15:32:35 +0000 (+0200) Subject: Add photo_card in page_card template X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=cb6d3408841386baf5745b59c3216066a5cc2028;p=mezzo.git Add photo_card in page_card template --- 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 %}