Fixed up blog posts a bit

This commit is contained in:
2013-10-01 21:17:41 +02:00
parent 0d7ed47d5a
commit 6ada4d0a5d
5 changed files with 21 additions and 12 deletions

View File

@@ -3,7 +3,9 @@
{% block content %}
{% if posts %}
{% for post in posts %}
{{ post.title }}
{% with title_links=True %}
{% include 'blog/post.html' %}
{% endwith %}
{% endfor %}
{% else %}
<p>No posts are returned for your query.</p>

View File

@@ -0,0 +1,8 @@
<div class="post">
<h3>{% if title_links %}<a href="{% url 'blog:read' post.created_at.year post.created_at.month post.created_at.day post.slug %}">{% endif %}{{ post.title }}{% if title_links %}</a>{% else %}<div class="plusone-container"><div class="g-plusone" data-annotation="inline" data-size="small" data-width="300"></div></div>{% endif %}</h3>
<p class="article-date">{{ post.created_at|date:'m-d-Y :: H:i' }} by {{ post.user.first_name }} {{ post.user.last_name }}</p>
{{ post.content|safe }}
{% if not title_links %}
<div class="g-plus" data-action="share" data-height="15"></div>
{% endif %}
</div>

View File

@@ -1,5 +1,5 @@
{% extends "front_base.html" %}
<div class="post">
<h3><a href="{% url 'read' post.created_at.year post.created_at.month post.created_at.day post.slug %}">{{ post.title }}</a></h3>
</div>
{% block content %}
{% include 'blog/post.html' %}
{% endblock %}