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

{% 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 %}
<div class="btn-group pull-right flip btn-group-settings" role="group">
{% if user_can_download_changes %}
<a href="{% url 'changes-csv' %}?{{ query_string }}" title="{% trans "Download latest changes as CSV" %}" class="btn btn-link">{% icon "download.svg" %}</a>
{% endif %}
{% if changes_rss %}
<a href="{{ changes_rss }}" title="{% trans "Follow using RSS" %}" class="btn btn-link">{% icon "rss.svg" %}</a>
{% endif %}
</div>
{% 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-default">
<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 %}
