From 2126f86d4d83409311e264dbaf93facf435a505b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Zapke-Gru=CC=88ndemann?= Date: Mon, 9 Jan 2012 07:25:19 +0100 Subject: Added thumbnails for news. --- sublab_project/news/templates/news/news_detail.html | 9 +++++++-- sublab_project/news/templates/news/news_image.html | 14 ++++++++++++++ sublab_project/news/templates/news/news_list.html | 7 ++++++- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 sublab_project/news/templates/news/news_image.html (limited to 'sublab_project/news/templates') diff --git a/sublab_project/news/templates/news/news_detail.html b/sublab_project/news/templates/news/news_detail.html index 918fe60..a91517e 100644 --- a/sublab_project/news/templates/news/news_detail.html +++ b/sublab_project/news/templates/news/news_detail.html @@ -1,13 +1,18 @@ {% extends 'base.html' %} +{% load thumbnail %} {% block title %}{{ object.title }}{% endblock %} {% block content %}

{{ object.date_updated|date:"DATETIME_FORMAT" }}

-

{{ object.title }}

+

{{ object.title }}

{% if object.image %}
- + + {% thumbnail object.image "200" upscale=False as image %} + + {% endthumbnail %} +
{% endif %} {{ object.content_html|safe }} diff --git a/sublab_project/news/templates/news/news_image.html b/sublab_project/news/templates/news/news_image.html new file mode 100644 index 0000000..3c490c6 --- /dev/null +++ b/sublab_project/news/templates/news/news_image.html @@ -0,0 +1,14 @@ +{% extends 'base.html' %} +{% load thumbnail %} + +{% block title %}Bild: {{ object.title }}{% endblock %} + +{% block content %} +

Bild: {{ object.title }}

+
+ {% thumbnail object.image "820" upscale=False as image %} + + {% endthumbnail %} +
+

Zurück zum Artikel

+{% endblock content %} diff --git a/sublab_project/news/templates/news/news_list.html b/sublab_project/news/templates/news/news_list.html index af66c07..fa11311 100644 --- a/sublab_project/news/templates/news/news_list.html +++ b/sublab_project/news/templates/news/news_list.html @@ -1,4 +1,5 @@ {% extends 'base.html' %} +{% load thumbnail %} {% block title %}Neues{% endblock %} @@ -10,7 +11,11 @@ {% if post.image %}
- + + {% thumbnail post.image "200" upscale=False as image %} + + {% endthumbnail %} +
{% endif %} {{ post.content_html|safe }} -- cgit v1.2.1