diff options
author | Markus Zapke-Grùˆndemann <info@keimlink.de> | 2011-12-30 03:57:10 +0100 |
---|---|---|
committer | Markus Zapke-Grùˆndemann <info@keimlink.de> | 2011-12-30 03:57:10 +0100 |
commit | 1347410c5125775f8b84bff0d12086158c39bea0 (patch) | |
tree | 521fb037c2a18cfb2c59490a6b96defa1d027c8b /sublab_project/news/templates | |
parent | 8d7103f5d53c31f40bf6725a2923046e664eca57 (diff) |
Added image for news posts.
Diffstat (limited to 'sublab_project/news/templates')
-rw-r--r-- | sublab_project/news/templates/news/news_detail.html | 5 | ||||
-rw-r--r-- | sublab_project/news/templates/news/news_list.html | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sublab_project/news/templates/news/news_detail.html b/sublab_project/news/templates/news/news_detail.html index e3a0de1..49d2b7a 100644 --- a/sublab_project/news/templates/news/news_detail.html +++ b/sublab_project/news/templates/news/news_detail.html @@ -5,6 +5,9 @@ {% block content %} <p class="news_date">{{ object.date_updated|date:"DATETIME_FORMAT" }}</p> <h2 id="{{ object.slug }}">{{ object.title }}</h3> - <p>{{ object.content_html|safe }}</p> + <p> + {% if object.image %}<img src="{{ MEDIA_URL }}{{ object.image }}" width="{{ object.image_width }}" height="{{ object.image_height }}" align="right" />{% endif %} + {{ object.content_html|safe }} + </p> <p class="header">{{ object.author }}</p> {% endblock content %} diff --git a/sublab_project/news/templates/news/news_list.html b/sublab_project/news/templates/news/news_list.html index ea46320..52ded72 100644 --- a/sublab_project/news/templates/news/news_list.html +++ b/sublab_project/news/templates/news/news_list.html @@ -6,7 +6,10 @@ <h3 id="{{ post.slug }}"> <a href="{{ post.get_absolute_url }}">{{ post.date_updated|date }} - {{ post.title }}</a> </h3> - <p>{{ post.content_html|safe }}</p> + <p> + {% if post.image %}<img src="{{ MEDIA_URL }}{{ post.image }}" width="{{ post.image_width }}" height="{{ post.image_height }}" align="right" />{% endif %} + {{ post.content_html|safe }} + </p> {% endfor %} {% if is_paginated %} <p> |