File: details.html

package info (click to toggle)
python-django-parler 2.3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,032 kB
  • sloc: python: 4,293; makefile: 164; sh: 6
file content (28 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{% extends "base.html" %}}{% load i18n parler_tags %}

{% block headtitle %}{{ article.title }}{% endblock %}

{% block main %}
  <h1>{{ article.title }}</h1>

  {{ article.content|linebreaks }}

  <hr/>
  <p>Current language: {{ article.language_code }}</p>
  <p>Available languages:

    {% comment %}
      generate URLs per language. This is less efficient compared to
      the example in admin/article/change_form.html as this performs a query per language.
      However, it shows the capabilities of this package very well.
    {% endcomment %}
    {% for language_code in article.get_available_languages %}
      {% get_language_info for language_code as lang %}
      {% get_translated_url language_code article as tr_url %}
      {% if tr_url %}
        <a href="{{ tr_url }}" title="{{ language_code }}">{{ lang.name_local }}</a>
      {% endif %}
    {% endfor %}

  </p>
{% endblock %}