Commits

Ian Lewis  committed 6833b63

A bit more design updates.

  • Participants
  • Parent commits d51f9fe
  • Branches bootstrap

Comments (0)

Files changed (5)

File homepage/blog/templatetags/blog_tags.py

 def to_lead(obj, max_len=None):
     if obj.lead:
         return obj.lead
-    else:
+    elif obj.content:
         if not max_len:
             max_len = 300 if obj.locale == "jp" else 600
         html = to_html(obj)
                 e,
                 html,
             ))
-            return ""
+    
+    return ""
          
 register.filter("to_lead", to_lead)

File static/css/style.css

     /* text-rendering: optimizeLegibility; */
 }
 
+body, p {
+    font-size: 16px;
+}
+
 /* =========== Header ============== */
 
 .header {
     left: -9999999px;
 }
 
+/* =========== Footer ============== */
+
+.footer {
+    color: white;
+    background: black;
+    padding: 10px;
+    overflow: hidden;
+}
+
 /* =========== Content ============== */
 
 .content {
-    max-width: 900px;
-    margin: 0 auto;
+    max-width: 800px;
+    margin: 2em auto;
 }
 
 /* =========== Index ============== */
     font-weight: bold;
 }
 
-/* =========== Blog List ============== */
-
-.content .blog-list ol {
+.content #index .blog-list {
+    margin-top: 2em;
+}
+.content #index .blog-list ol {
     list-style: none;
     margin: 0;
 }
+
+.content #index .blog-list .blog-post {
+    margin-top: 0;
+}
+.content #index .blog-list .blog-post::after {
+    margin-top: 3em;
+}
+/* =========== Blog List ============== */
+
+.content #blog-list .blog-list {
+    margin: 0px 6em;
+}
+.content #blog-list .blog-list .post-content {
+    margin: 2em 0;
+}
+
 .content .blog-list .blog-post {
-    padding: 1em;
+    padding: 0 1em 1em 1em;
     margin-top: 2em;
 
+    /*
     -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
     -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
     box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
+    */
 }
 
-.content .blog-list .blog-post h3 a {
+.content .blog-list .blog-post::after {
+    display: block;
+    content: '';
+    width: 100px;
+    height: 1px;
+    margin: 20px auto;
+    background-color: #EEE;
+    margin-top: 4em;
+}
+
+
+.content .blog-list .post-content p {
+    line-height: 1.5em;
+}
+
+/* =========== Blog Post ============== */
+
+.content .blog-post h3 a {
     color: #333;
 }
-.content .blog-list .blog-post h1 a {
+.content .blog-post h1 a {
     color: #333;
 }
-
-#postlist.blog-list {
-    margin-top: 3em;
-}

File templates/blog/post_detail.html

 {% block blog_content %}
 {% tags_for_object object as item_tags %}
 <div class="blog-post">
-  <h1 class="post-title" itemprop="title"><a href="{{ object.get_absolute_url }}">{{ object.title }}</a></h1>
-  <div class="post-date">{{ object.pub_date }}</div>
-  <div class="post-tags">{% for tag in item_tags %}<a href="{% url blog_tag_page locale tag.name %}">{{ tag.name }}</a> {% endfor %}</div>
+  <h1 itemprop="title"><a href="{{ object.get_absolute_url }}">{{ object.title }}</a></h1>
+  <div class="post-content">
+    <div class="post-date">{{ object.pub_date|date:"DATE_FORMAT" }}</div>
+    <div class="post-tags">{% for tag in item_tags %}<i class="icon-tag"></i> <a href="{% url blog_tag_page locale tag.name %}">{{ tag.name }}</a> {% endfor %}</div>
+  </div>
   <div class="post-body">
   {% if object.content %}
     {{ object|to_html|safe }}

File templates/blog/post_list.html

 {% endblock %}
 
 {% block blog_content %}
+<div id="blog-list">
   {% autopaginate object_list 10 %}
 
-  <div id="postlist" class="blog-list">
+  <div class="blog-list">
   {% if object_list %}
     {% for post in object_list %}
       {% tags_for_object post as post_tags %}
       <div class="blog-post clearfix">
-        <h1><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h1>
+        <div class="post-header">
+          <h1><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h1>
+          <div class="post-date">{{ post.pub_date|date:"DATE_FORMAT" }}</div>
+        </div>
         <div class="post-content">
-          <div class="post-date">{{ post.pub_date|date:"DATE_FORMAT" }}</div>
-          {% if post.content %}
-          <p>{{ post|to_lead:400 }}</p>
+          <p>{{ post|to_lead:400|default:"&nbsp;" }}</p>
+        </div>
+        <div class="post-footer">
           <p class="pull-right"><a class="btn" href="{{ post.get_absolute_url }}">Read More &raquo;</a></p>
-          {% else %}
-          <p>&nbsp;</p>
-          {% endif %}
           <div class="post-tags">{% for tag in post_tags %}<i class="icon-tag"></i> <a href="{% url blog_tag_page "en" tag.name %}">{{ tag.name }}</a> {% endfor %}</div>
         </div>
         {% comment %}
     {% endfor %}
   {% endif %}
   </div>
-<br/>
+  <br/>
 
 {% paginate %}
 
+</div>
 {% endblock %}
 
 {% block js_footer %}

File templates/index.html

           <img src="{{ STATIC_URL }}img/usa_flag.png" /><br />
           <!--<div class="blog-hero-text">English Blog</div>-->
           <h2>English Blog</h2>
-          <p>For those of you from the English speaking world.</p>
+          <p>For those from the English speaking world.</p>
           <p><a class="btn btn-primary" href="{% url blog_page "en" %}">View all posts &raquo;</a></p>
         </div>
       </div>
           <img src="{{ STATIC_URL }}img/japan_flag.png" style="border: 1px solid #DDD;"/><br />
           <h2>日本語ブログ</h2>
           <p>日本語の世界の皆様はこちらへ</p>
-          <p><a class="btn btn-success" href="{% url blog_page "ja" %}">すべての記事を読む &raquo;</a></p>
+          <p><a class="btn btn-success" href="{% url blog_page "jp" %}">すべての記事を読む &raquo;</a></p>
         </div>
       </div>
     </div>
       {% for post in en_posts %}
       {% tags_for_object post as post_tags %}
       <div class="blog-post clearfix">
-        <h3><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
+        <div class="post-header">
+          <h3><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
+          <div class="post-date">{{ post.pub_date|date:"DATE_FORMAT" }}</div>
+        </div>
         <div class="post-content">
-          <div class="post-date">{{ post.pub_date|date:"DATE_FORMAT" }}</div>
-          {% if post.content %}
-          <p>{{ post|to_lead:400 }}</p>
+          <p>{{ post|to_lead:200|default:"&nbsp;" }}</p>
+        </div>
+        <div class="post-footer">
           <p class="pull-right"><a class="btn" href="{{ post.get_absolute_url }}">Read More &raquo;</a></p>
-          {% else %}
-          <p>&nbsp;</p>
-          {% endif %}
           <div class="post-tags">{% for tag in post_tags %}<i class="icon-tag"></i> <a href="{% url blog_tag_page "en" tag.name %}">{{ tag.name }}</a> {% endfor %}</div>
         </div>
         {% comment %}
       {% for post in jp_posts %}
       {% tags_for_object post as post_tags %}
       <div class="blog-post clearfix">
-        <h3><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
+        <div class="post-header">
+          <h3><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
+          <div class="post-date">{{ post.pub_date|date:"DATE_FORMAT" }}</div>
+        </div>
         <div class="post-content">
-          <div class="post-date">{{ post.pub_date|date:"DATE_FORMAT" }}</div>
-          {% if post.content %}
-          <p>{{ post|to_lead:200 }}</p>
+          <p>{{ post|to_lead:100|default:"&nbsp;" }}</p>
+        </div>
+        <div class="post-footer">
           <p class="pull-right"><a class="btn" href="{{ post.get_absolute_url }}">もっと読む&raquo;</a></p>
-          {% else %}
-          <p>&nbsp;</p>
-          {% endif %}
           <div class="post-tags">{% for tag in post_tags %}<i class="icon-tag"></i> <a href="{% url blog_tag_page "jp" tag.name %}">{{ tag.name }}</a> {% endfor %}</div>
         </div>
         {% comment %}