diff options
Diffstat (limited to 'weblog/templates')
-rwxr-xr-x | weblog/templates/weblog/post.html | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/weblog/templates/weblog/post.html b/weblog/templates/weblog/post.html index 364e17c..0459744 100755 --- a/weblog/templates/weblog/post.html +++ b/weblog/templates/weblog/post.html @@ -5,6 +5,18 @@ <div class="container-fluid blogpost"> <h2>{% if post_translation %}{{ post_translation.title }}{% else %}{{ post.title }}{% endif %}</h2> <p class="publish-info">{% blocktrans with publish_date=post.publish_date %}Published on {{ publish_date }}{% endblocktrans %}{% if post_author %}{% blocktrans with author=post_author context 'Written by (Author)' %}, by {{ author }}{% endblocktrans %}{% endif %}</p> + {% if post_languages %} + <form> + <div class="form-group"> + <select class="form-control" id="post-languages" name="post-language" onchange="changeLang(this.value)"> + <option disabled selected>{% trans 'Read in another language' %}</option> + {% for lang in post_languages %} + <option value="{{ lang.0 }}">{{ lang.1 }}</option> + {% endfor %} + </select> + </div> + </form> + {% endif %} <hr> {% if post_translation %} {{ post_translation.content|safe }} @@ -13,7 +25,7 @@ {% endif %} {% if post_categories %} <hr> - <p>{% trans 'Categories' context 'Post categories' %}: + <p>{% trans 'Categories' context 'Post categories' %}: {% for post_category in post_categories %} <a class="label label-info" href="{% url 'weblog:CategoryIndex' category_slug=post_category.slug %}">{{ post_category.name }}</a> {% endfor %} @@ -64,4 +76,10 @@ {% endif %} {% endif %} </div> -{% endblock %}
\ No newline at end of file +<script> + function changeLang(lang){ + window.location = "{{ post_url }}"+lang; + } +</script> +{% endblock %} + |