From 429991c3f99dc3cb94267491052e34cf94cca5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Pievil=C3=A4inen?= Date: Wed, 21 Nov 2012 14:41:09 +0200 Subject: [PATCH] List of translations for simple and notmyidea pages --- pelican/themes/notmyidea/templates/article_infos.html | 3 ++- pelican/themes/notmyidea/templates/page.html | 2 ++ pelican/themes/notmyidea/templates/translations.html | 2 ++ pelican/themes/simple/templates/article.html | 2 ++ pelican/themes/simple/templates/page.html | 3 +++ pelican/themes/simple/templates/translations.html | 9 +++++++++ 6 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 pelican/themes/simple/templates/translations.html diff --git a/pelican/themes/notmyidea/templates/article_infos.html b/pelican/themes/notmyidea/templates/article_infos.html index a1993a09..4b86716d 100644 --- a/pelican/themes/notmyidea/templates/article_infos.html +++ b/pelican/themes/notmyidea/templates/article_infos.html @@ -10,5 +10,6 @@ {% endif %}

In {{ article.category }}. {% if PDF_PROCESSOR %}get the pdf{% endif %}

{% include 'taglist.html' %} -{% include 'translations.html' %} +{% import 'translations.html' as translations with context %} +{{ translations.translations_for(article) }} diff --git a/pelican/themes/notmyidea/templates/page.html b/pelican/themes/notmyidea/templates/page.html index 9635fb8d..60409d5c 100644 --- a/pelican/themes/notmyidea/templates/page.html +++ b/pelican/themes/notmyidea/templates/page.html @@ -3,6 +3,8 @@ {% block content %}

{{ page.title }}

+ {% import 'translations.html' as translations with context %} + {{ translations.translations_for(page) }} {% if PDF_PROCESSOR %}get the pdf{% endif %} {{ page.content }} diff --git a/pelican/themes/notmyidea/templates/translations.html b/pelican/themes/notmyidea/templates/translations.html index 0079883e..ca03a2c9 100644 --- a/pelican/themes/notmyidea/templates/translations.html +++ b/pelican/themes/notmyidea/templates/translations.html @@ -1,6 +1,8 @@ +{% macro translations_for(article) %} {% if article.translations %} Translations: {% for translation in article.translations %} {{ translation.lang }} {% endfor %} {% endif %} +{% endmacro %} diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index 16c34266..86b14f62 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -5,6 +5,8 @@

{{ article.title }}

+ {% import 'translations.html' as translations with context %} + {{ translations.translations_for(article) }}