浏览代码

Merge pull request #91 from wagtail/90-blog-page-inconsistency

Blog page inconsistency
David Ray 8 年之前
父节点
当前提交
2575b46397

+ 6 - 0
bakerydemo/templates/base/include/header-hero.html

@@ -8,6 +8,9 @@
             <div class="row">
                 <div class="col-md-7">
                     <h1>{{ page.title }}</h1>
+                    {% if page.subtitle %}
+                        <p class="stand-first">{{ page.subtitle }}</p>
+                    {% endif %}
                 </div>
             </div>
         </div>
@@ -17,6 +20,9 @@
         <div class="row">
             <div class="col-md-7">
                 <h1>{{ page.title }}</h1>
+                {% if page.subtitle %}
+                    <p class="stand-first">{{ page.subtitle }}</p>
+                {% endif %}
             </div>
         </div>
     </div>

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

@@ -35,7 +35,9 @@
                                 <p>{{ blog.introduction|truncatewords:15 }}</p>
                             </div>
                             <div class="small footer">
-                                {{ blog.date_published }} by
+                                {% if blog.date_published %}
+                                    {{ blog.date_published }} by 
+                                {% endif %}
                                 {% for author in blog.authors %}
                                     {{ author }}{% if not forloop.last %}, {% endif %}
                                 {% endfor %}

+ 3 - 13
bakerydemo/templates/blog/blog_page.html

@@ -4,28 +4,18 @@
 {% block content %}
 
 {% image self.image fill-1920x600 as hero_img %}
-<div class="container-fluid hero" style="background-image:url('{{ hero_img.url }}')">
-<div class="hero-gradient-mask"></div>
-    <div class="container">
-        <div class="row">
-            <div class="col-md-7 col-md-offset-2">
-                <h1>{{ page.title }}</h1>
-                <p class="stand-first">{{ page.subtitle }}</p>
-            </div>
-        </div>
-    </div>
-</div>
+    {% include "base/include/header-hero.html" %}
 
 <div class="container">
     <div class="row">
-        <div class="col-md-7 col-md-offset-2">
+        <div class="col-md-8">
             {% if page.introduction %}
                 <p class="intro">{{ page.introduction }}</p>
             {% endif %}
 
             {# TODO These two loops could be consolidated into one, with styling #}
             <div class="blog-byline">
-            {{ page.date_published }} by {% for author in page.authors %}
+            {% if page.date_published %}{{ page.date_published }} by {% else %}By: {% endif %}{% for author in page.authors %}
                 {{ author }}{% if not forloop.last %}, {% endif %}
             {% endfor %}
             </div>