{% extends "base.html" %}

{% load i18n %}
{% load staticfiles %}

{% block title %}{% trans "Motion" %} {{ motion.identifier }} – {{ block.super }}{% endblock %}

{% block header %}
    <link type="text/css" rel="stylesheet" media="all" href="{% static 'css/motion.css' %}" />
{% endblock %}


{% block content %}
<h1>
    {{ motion.title }}
    <br>
    <small>
    {% if motion.identifier != None %}
        {% trans "Motion" %} {{ motion.identifier }},
    {% else %}
        <i>[{% trans "no number" %}]</i>,
    {% endif %}
    {% trans "Diff view" %}
    </small>
    <small class="pull-right">
    <div class="btn-toolbar">
        <a href="{% url 'motion_detail' motion.id %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to motion" %}</a>
    </div>
    </small>
</h1>

{% if version_rev1 and version_rev2 %}
<table class="table table-striped table-bordered">
<tr>
    <td><b>{% trans "Version" %} {{ version_rev1.version_number }}</b><br>
        {% trans "Last changes" %}: {{ version_rev1.creation_time }}<br>
        <h4>{{ version_rev1.title }}</h4>
    </td>
    <td><b>{% trans "Version" %} {{ version_rev2.version_number }}</b><br>
        {% trans "Last changes" %}: {{ version_rev1.creation_time }}<br>
        <h4>{{ version_rev2.title }}</h4>
    </td>
</tr>
<!-- Text -->
<tr class="diff_row">
    {% if not version_rev1.text == version_rev2.text %}
        <td colspan="2">{{ diff_text|safe }}</td>
    {% else %}
        <td>{{ version_rev1.text }}</td>
        <td>{{ version_rev2.text }}</td>
    {% endif %}
</tr>
<!-- Reason -->
<tr><td colspan="2"><h4>{% trans "Reason" %}:</h4></td></tr>
<tr class="diff_row">
    {% if not version_rev1.reason == version_rev2.reason %}
        <td colspan="2">{{ diff_reason|safe }}</td>
    {% else %}
        <td>{{ version_rev1.reason }}</td>
        <td>{{ version_rev2.reason }}</td>
    {% endif %}
</tr>
</table>
{% endif %}

{% endblock %}
