{% extends "base.html" %}
{% load i18n %}
{% load translations %}
{% load permissions %}
{% load crispy_forms_tags %}

{% block breadcrumbs %}
{% if project %}
<li><a href="{{ project.get_absolute_url }}">{{ project }}</a></li>
{% if component %}
<li><a href="{{ component.get_absolute_url }}">{{ component.name }}</a></li>
{% if translation %}
<li><a href="{{ translation.get_absolute_url }}">{{ translation.language }}</a></li>
{% endif %}
{% endif %}
{% elif changes_user %}
<li><a href="{{ changes_user.profile.get_absolute_url }}">{{ changes_user.profile.get_user_name }}</a></li>
{% elif language %}
<li><a href="{% url 'languages' %}">{% trans "Languages" %}</a></li>
<li><a href="{{ language.get_absolute_url }}">{{ language }}</a></li>
{% endif %}
<li><a href="{% url 'changes' %}?{{ query_string }}">{% trans "Changes" %}</a></li>
{% endblock %}

{% block content %}

{% perm 'change.download' project as user_can_download_changes %}

{% if user_can_download_changes or changes_rss %}
<ul class="pagination pull-right flip">
{% if user_can_download_changes %}
<li>
<a href="{% url 'changes-csv' %}?{{ query_string }}" title="{% trans "Download latest changes as CSV" %}"><i class="fa fa-download"></i></a>
</li>
{% endif %}
{% if changes_rss %}
<li>
<a href="{{ changes_rss }}" title="{% trans "Follow using RSS" %}"><i class="fa fa-rss"></i></a>
</li>
{% endif %}
</ul>
{% endif %}

{% include "paginator.html" %}

{% with object_list as last_changes %}
{% include "last-changes-content.html" %}
{% endwith %}

{% include "paginator.html" %}

<form method="get">
{% if changes_user %}
<input type="hidden" name="user" value="{{ changes_user.username }}" />
{% endif %}
{% if component %}
<input type="hidden" name="component" value="{{ component.slug }}" />
{% endif %}
<div class="panel panel-primary">
<div class="panel-heading"><h4 class="panel-title">{% trans "Search" %}</h4></div>
  <div class="panel-body">
  {{ form|crispy }}
</div>
<div class="panel-footer">
<input type="submit" value="{% trans "Search" %}" class="btn btn-primary" />
</div>
</div>
</form>

{% endblock %}
