Only show a truncated version of the news item in the archive

This removes the need for a separate include file for item contents,
so remove that one as well.
This commit is contained in:
Magnus Hagander
2011-06-15 20:00:11 +02:00
parent c53d9b30a0
commit 9ca92ca5eb
3 changed files with 14 additions and 12 deletions

View File

@ -1,10 +0,0 @@
{%load markup%}
<div class="newsdate">Posted on <b>{{obj.date}}</b></div>
<p>
{{obj.content|markdown:"safe"}}
</p>
{%if obj.is_migrated%}
<p><i>This post has been migrated from a previous version of the PostgreSQL
website. We apologise for any formatting issues caused by the migration.</i></p>
{%endif%}

View File

@ -1,7 +1,15 @@
{%extends "base/page.html"%}
{%load markup%}
{%block title%}{{obj.title}}{%endblock%}
{%block contents%}
<h1>{{obj.title}}</h1>
{%include "news/inc_newsitem.html"%}
<div class="newsdate">Posted on <b>{{obj.date}}</b></div>
<p>
{{obj.content|markdown:"safe"}}
</p>
{%if obj.is_migrated%}
<p><i>This post has been migrated from a previous version of the PostgreSQL
website. We apologise for any formatting issues caused by the migration.</i></p>
{%endif%}
{%endblock%}

View File

@ -1,10 +1,14 @@
{%extends "base/page.html"%}
{%load markup%}
{%block title%}News archive{%endblock%}
{%block contents%}
<h1>News archive</h1>
{%for obj in news %}
<h2><a href="/about/news/{{obj.id}}/">{{obj.title}}</a></h2>
{%include "news/inc_newsitem.html"%}
<div class="newsdate">Posted on <b>{{obj.date}}</b></div>
<p>
{{obj.content|markdown:"safe"|truncatewords_html:20}}
</p>
{%endfor%}
<p><a href="/account/news/new/">Submit news</a></p>
{%endblock%}