{% extends "site/layout/base_text.html" %}
{% load com %}
{% load i18n %}
{% load local_perms %}
{% block main %}

{% get_local_text_perm request text can_edit_text as can_edit_text %}

<script type="text/javascript">
<!--
tb_conf['current_tab'] = 'history';
-->
</script>

<div id="text_history" class="tab-meta">   

<script type="text/javascript">
<!--
$(function() {
    $(".hidden-text-actions").css('visibility','hidden');   
}) ;
-->

</script>


<ul class="sub_list">
    <li><a href="{% url text-history text.key %}">{% blocktrans %}Version list{% endblocktrans %}</a></li>
    <li> / </li>
    <li>&nbsp;<a href="{% url text-history-version text.key first_version.key %}" alt="{% blocktrans %}Original version{% endblocktrans %}" title="{% blocktrans %}Original version{% endblocktrans %}">&laquo;&laquo;{{ first_version.get_version_number }}</a></li>
    {% ifnotequal v1.key first_version.key %}
    {% if v1.get_previous_version %}<li>&nbsp;<a href="{% url text-history-compare text.key v1.get_previous_version.key v1.key %}"><img style="vertical-align: text-bottom;" title="{% blocktrans %}Previous modification{% endblocktrans %}" alt="{% blocktrans %}Previous modification{% endblocktrans %}" src="{{ CM_MEDIA_PREFIX }}img/plus-minus-left.gif"></img></a></li>{% endif %}    
    <li>&nbsp;<a href="{% url text-history-version text.key v1.key %}" alt="{% blocktrans with v1.get_version_number as version_number %}Version {{ version_number }}{% endblocktrans %}" title="{% blocktrans with v1.get_version_number as version_number %}Version {{ version_number }}{% endblocktrans %}">&laquo;{{ v1.get_version_number }}</a></li>
    {% endifnotequal %}
    <li class="active_sub">&nbsp;{% blocktrans with v1.get_version_number as version_1_number and v2.get_version_number as version_2_number %}Comparison between version #{{ version_1_number }} and #{{ version_2_number }}{% endblocktrans %}</li>
    {% ifnotequal v2.key text.last_text_version.key %}<li>&nbsp;<a href="{% url text-history-version text.key v2.key %}" alt="{% blocktrans with v2.get_version_number as version_number %}Version {{ version_number }}{% endblocktrans %}" title="{% blocktrans with v2.get_version_number as version_number %}Version {{ version_number }}{% endblocktrans %}">{{ v2.get_version_number }}&raquo;</a></li>
    {% if v1.get_next_version %}<li>&nbsp;<a href="{% url text-history-compare text.key v2.key v2.get_next_version.key %}"><img style="vertical-align: text-bottom;" title="{% blocktrans %}Next modification{% endblocktrans %}" alt="{% blocktrans %}Next modification{% endblocktrans %}" src="{{ CM_MEDIA_PREFIX }}img/plus-minus-right.gif"></img></a></li>{% endif %}    
    {% endifnotequal %}
    <li>&nbsp;<a href="{% url text-history-version text.key text.last_text_version.key %}" alt="{% blocktrans %}Most recent version{% endblocktrans %}" title="{% blocktrans %}Most recent version{% endblocktrans %}">{{ text.last_text_version.get_version_number }}&raquo;&raquo;</a></li>
</ul>

<div style="clear:both;"></div>

{% autoescape off %}
{% if empty %}
<center>{% blocktrans %}No differences{% endblocktrans %}</center>
{% else %}
{{ content }}
{% endif %}
{% endautoescape %}

</div>
{% endblock %}
