浏览代码

Use common content-header for all site sections

Scot Hacker 8 年之前
父节点
当前提交
ed07adc2e0

+ 1 - 6
bakerydemo/templates/base/home_page.html

@@ -2,12 +2,7 @@
 {% load wagtailimages_tags %}
 
 {% block content-header %}
-    {{ page.title }}
-
-    <div class="image">
-        {% image page.image width-500 as photo %}
-        <img src="{{ photo.url }}" width="{{ photo.width }}" height="{{ photo.height }}" alt="{{ photo.alt }}" />
-    </div>
+    {% include "base/include/header.html" %}
 {% endblock content-header %}
 
 {% block content-body %}

+ 0 - 1
bakerydemo/templates/base/include/footer.html

@@ -1,4 +1,3 @@
 {% load wagtailcore_tags %}
 
-
 {{ footer_text|richtext }}

+ 16 - 0
bakerydemo/templates/base/include/header.html

@@ -0,0 +1,16 @@
+{% load wagtailcore_tags %}
+{% load wagtailimages_tags %}
+
+<div class="container">
+
+    <div class="image">
+        {% image page.image width-500 as photo %}
+        <img src="{{ photo.url }}" width="{{ photo.width }}" height="{{ photo.height }}" alt="{{ photo.alt }}" />
+    </div>
+
+    <div class="row">
+        <div class="col-md-7 col-md-offset-2">
+            <h2>{{ page.title }}</h2>
+        </div>
+    </div>
+</div>

+ 1 - 7
bakerydemo/templates/blog/blog_index_page.html

@@ -2,13 +2,7 @@
 {% load wagtailimages_tags %}
 
 {% block content-header %}
-<div class="container">
-    <div class="row">
-        <div class="col-md-7 col-md-offset-2">
-            <h2>{{ page.title }}</h2>
-        </div>
-    </div>
-</div>
+    {% include "base/include/header.html" %}
 {% endblock content-header %}
 
 {% block content-body %}

+ 12 - 8
bakerydemo/templates/breads/breads_index_page.html

@@ -2,17 +2,21 @@
 {% load wagtailimages_tags %}
 
 {% block content-header %}
-    {{ page.title }}
-    {% for bread in resources %}
-		<div>
-			<div class="col-xs-12">
-				<div><a href="{{ bread.slug }}">{{ bread.title }}</a></div>
-			</div>
-		</div>
-	{% endfor %}
+    {% include "base/include/header.html" %}
 {% endblock content-header %}
 
 {% block content-body %}
+
+    <p>{{ page.introduction}}</p>
+
+    {% for bread in resources %}
+        <div>
+            <div class="col-xs-12">
+                <div><a href="{{ bread.slug }}">{{ bread.title }}</a></div>
+            </div>
+        </div>
+    {% endfor %}
+
 	{% if resources.has_other_pages %}
 	<div class="clearfix">
 	  <div class="pagination-wrapper">

+ 1 - 2
bakerydemo/templates/locations/locations_index_page.html

@@ -2,9 +2,8 @@
 {% load wagtailcore_tags %}
 {% load wagtailimages_tags %}
 
-
 {% block content-header %}
-    {{ page.title }}
+    {% include "base/include/header.html" %}
 {% endblock content-header %}
 
 {% block content-body %}