]> git.parisson.com Git - mezzo.git/commitdiff
Add photo_card in page_card template
authorJérémy Fabre <blackmagik88@gmail.com>
Wed, 27 Jul 2016 15:32:35 +0000 (17:32 +0200)
committerJérémy Fabre <blackmagik88@gmail.com>
Wed, 27 Jul 2016 15:32:35 +0000 (17:32 +0200)
app/static/src/sass/modules/boxes/_page-box.scss
app/templates/pages/basicpage.html
app/templates/pages/department.html
app/templates/pages/includes/page_card.html
app/templates/pages/team.html

index 81080e314db876f1f9b7e0b5793a43c72189e7f9..fcebba99e84ccfdb73eb6da9412f253f756aef7c 100644 (file)
@@ -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);
 
     }
 
index 821500880f3481bc9518b8418a296f0ff0aee3e6..3b72547511fc5064c8ddc09eb09424d76a8e4c8c 100644 (file)
     {% 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 %}
+            <div class="page__childrens">
+                {% for children in childrens %}
+                    {% with children as object %}
+                        {% include "pages/includes/page_card.html" %}
+                    {% endwith %}
+                {% endfor %}
+            </div>
         {% endif %}
     {% endif %}
 
index 570ca61d5747f955044215ec433b33151cf646af..2421ff4b14094124a953b3d373cd4981e43ad747 100644 (file)
     {% 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 %}
+            <div class="page__childrens">
+                {% for children in childrens %}
+                    {% with children as object %}
+                        {% include "pages/includes/page_card.html" %}
+                    {% endwith %}
+                {% endfor %}
+            </div>
         {% endif %}
     {% endif %}
 
index 40bbd8ccc2fc1b6d2ca1844912f0566edbf9b2eb..e9421603bd0df94112c588ae74e8eb07bb60ff5f 100644 (file)
@@ -1,6 +1,15 @@
+{% load mezzanine_tags %}
 <a href="{{ object.get_absolute_url }}" title="{{ object.title }}" class="page-box">
     <div class="page-box__image">
-        <img src="//placehold.it/900x400" />
+        {% if object.basicpage.photo_card %}
+            <img src="{{ MEDIA_URL }}{% thumbnail object.basicpage.photo_card 900 400 %}" />
+        {% elif object.department.photo_card %}
+            <img src="{{ MEDIA_URL }}{% thumbnail object.department.photo_card 900 400 %}" />
+        {% elif object.team.photo_card %}
+            <img src="{{ MEDIA_URL }}{% thumbnail object.team.photo_card 900 400 %}" />
+        {% else %}
+            
+        {% endif %}
     </div>
     <div class="page-box__content">
         <div>
index d7bf846d15adc92d6773bdf412e9037e35b95d27..98562cbf1049e210c54b82d4a8c9c6d746951d71 100644 (file)
     {% 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 %}
+            <div class="page__childrens">
+                {% for children in childrens %}
+                    {% with children as object %}
+                        {% include "pages/includes/page_card.html" %}
+                    {% endwith %}
+                {% endfor %}
+            </div>
         {% endif %}
     {% endif %}