Better structure for upload/download

This commit is contained in:
Michal Čihař 2012-03-05 14:08:35 +01:00
parent acdfbbea7a
commit 1a73801f52

View File

@ -23,17 +23,21 @@
{% endif %} {% endif %}
{% endwith %} {% endwith %}
<h2>{% trans "Download and upload" %}</h2> <h2>{% trans "Download" %}</h2>
<a href="{{ object.get_download_url }}">{% trans "Download" %}</a> {% with object.get_download_url as download_url %}
<p>{% blocktrans %}You can <a href="{{ download_url }}">download</a> file for offline translation.{% endblocktrans %}</p>
{% endwith %}
{% if user.is_authenticated %} {% if user.is_authenticated %}
<h2>{% trans "Upload" %}</h2>
<p>{% trans "Uploaded file will be merged with current translation. In case you want to overwrite already translated strings, don't forget to enable it." %}</p>
<form action="{% url 'trans.views.upload_translation' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code %}" method="post" enctype="multipart/form-data"> <form action="{% url 'trans.views.upload_translation' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code %}" method="post" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
<table> {{ form.as_p }}
{{ form.as_table }} <p><input type="submit" value="{% trans "Upload" %}" /></p>
<tr><td></td><td><input type="submit" value="{% trans "Upload" %}" /></td></tr>
</table>
</form> </form>
{% endif %} {% endif %}