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

{% block breadcrumbs %}
<li><a href="{{ object.project.get_absolute_url }}">{{ object.project }}</a></li>
<li><a href="{{ object.get_absolute_url }}">{{ object.name }}</a></li>
{% endblock %}

{% block content %}
{% can_add_translation user object.project as user_can_add_translation %}

{% if object.can_add_language and user_can_add_translation %}

<div class="tab-pane" id="newlang">

<form action="{% url 'new-language' project=object.project.slug subproject=object.slug %}" method="post">
{% csrf_token %}
<div class="panel panel-primary">
  <div class="panel-heading"><h4 class="panel-title">{% trans "Start new translation" %}</h4></div>
  <div class="panel-body">
{% if object.new_lang == 'url' %}
<p>{% blocktrans with object.project.instructions as url %}Should your language be missing, please follow <a href="{{ url }}">translator instructions</a>.{% endblocktrans %}</p>
{% else %}
<p>{% trans "Please choose the language into which you would like to translate." %}</p>
{% if object.new_lang == 'contact' %}
<p>{% trans "Project maintainers will get notified about this request and will add the language manually." %}</p>
{% endif %}
{{ form|crispy }}
<p class="help-block"><a href="{% url 'contact' %}?t=lang">{% trans "Can't find your language in the list above?" %}</a></p>
</div>
<div class="panel-footer">
{% if object.new_lang == 'contact' %}
<input class="btn btn-default" type="submit" value="{% trans "Request new translation" %}" />
{% else %}
<input class="btn btn-default" type="submit" value="{% trans "Start new translation" %}" />
{% endif %}
{% endif %}
</div>
</div>
</form>

</div>
{% endif %}

{% endblock %}
