Add link to article translations in index and article template

This commit is contained in:
FELD Boris
2011-04-08 13:41:44 +02:00
parent d5a2b51f9a
commit 3e04e093dd
3 changed files with 18 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}{{ article.title }}{% endblock %} {% block title %}{{ article.title }}{% endblock %}
{% block content %} {% block content %}
<section id="content" class="body"> <section id="content" class="body">
<article> <article>
<header> <h1 class="entry-title"><a href="{{ article.url }}" <header> <h1 class="entry-title"><a href="{{ article.url }}"
rel="bookmark" title="Permalink to {{ article.title }}">{{ article.title rel="bookmark" title="Permalink to {{ article.title }}">{{ article.title
@@ -16,8 +16,9 @@
By <a class="url fn" href="#">{{ article.author }}</a> By <a class="url fn" href="#">{{ article.author }}</a>
</address> </address>
{% endif %} {% endif %}
<p>In <a href="{{ SITEURL }}/category/{{ article.category }}.html">{{ article.category }}</a>. <p>In <a href="{{ SITEURL }}/category/{{ article.category }}.html">{{ article.category }}</a>.
{% include 'taglist.html' %} {% include 'taglist.html' %}
{% include 'translations.html' %}
</footer><!-- /.post-info --> </footer><!-- /.post-info -->
{{ article.content }} {{ article.content }}
</div><!-- /.entry-content --> </div><!-- /.entry-content -->

View File

@@ -1,13 +1,13 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content_title %}{% endblock %} {% block content_title %}{% endblock %}
{% block content %} {% block content %}
{% if articles %} {% if articles %}
{% for article in articles %} {% for article in articles %}
{% if loop.index == 1 %} {% if loop.index == 1 %}
<section id="content" class="body"> <section id="content" class="body">
<aside id="featured"><article> <aside id="featured"><article>
<h1 class="entry-title"><a href="{{ SITEURL }}/{{ article.url <h1 class="entry-title"><a href="{{ SITEURL }}/{{ article.url
}}">{{ article.title }}</a></h1> }}">{{ article.title }}</a></h1>
<footer class="post-info"> <footer class="post-info">
<abbr class="published" title="{{ article.date.isoformat() }}"> <abbr class="published" title="{{ article.date.isoformat() }}">
{{ article.date.strftime('%a %d %B %Y') }} {{ article.date.strftime('%a %d %B %Y') }}
@@ -20,6 +20,7 @@
{% endif %} {% endif %}
<p>In <a href="{{ SITEURL }}/category/{{ article.category }}.html">{{ article.category }}</a>. {% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ article.slug }}.pdf">get the pdf</a>{% endif %}</p> <p>In <a href="{{ SITEURL }}/category/{{ article.category }}.html">{{ article.category }}</a>. {% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ article.slug }}.pdf">get the pdf</a>{% endif %}</p>
{% include 'taglist.html' %} {% include 'taglist.html' %}
{% include 'translations.html' %}
</footer><!-- /.post-info --> </footer><!-- /.post-info -->
{{ article.content }} {{ article.content }}
</article></aside><!-- /#featured --> </article></aside><!-- /#featured -->
@@ -28,12 +29,12 @@
<hr /> <hr />
<ol id="posts-list" class="hfeed"> <ol id="posts-list" class="hfeed">
{% endif %} {% endif %}
{% else %} {% else %}
<li><article class="hentry"> <li><article class="hentry">
<header> <header>
<h1><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title}}">{{ article.title }}</a></h1> <h1><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title}}">{{ article.title }}</a></h1>
</header> </header>
<div class="entry-content"> <div class="entry-content">
<footer class="post-info"> <footer class="post-info">
<abbr class="published" title="{{ article.date.isoformat() }}"> <abbr class="published" title="{{ article.date.isoformat() }}">
@@ -56,7 +57,7 @@
</ol><!-- /#posts-list --> </ol><!-- /#posts-list -->
</section><!-- /#content --> </section><!-- /#content -->
{% else %} {% else %}
<section id="content" class="body"> <section id="content" class="body">
<h2>Pages</h2> <h2>Pages</h2>
{% for page in PAGES %} {% for page in PAGES %}
<li><a href="{{ SITEURL }}/pages/{{ page.url }}">{{ page.title }}</a></li> <li><a href="{{ SITEURL }}/pages/{{ page.url }}">{{ page.title }}</a></li>

View File

@@ -0,0 +1,6 @@
{% if article.translations %}
Translations:
{% for translation in article.translations %}
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
{% endfor %}
{% endif %}