mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/weblate.git
synced 2026-05-25 15:19:04 +08:00
98 lines
2.6 KiB
HTML
Vendored
98 lines
2.6 KiB
HTML
Vendored
{% extends "base.html" %}
|
|
{% load i18n %}
|
|
{% load url from future %}
|
|
|
|
{% block breadcums %}
|
|
<li><a href="{{ project.get_absolute_url }}">{{ project }}</a></li>
|
|
<li><a href="{% url 'trans.views.show_dictionaries' project=project.slug %}">{% trans "dictionaries" %}</a></li>
|
|
<li><a href="{% url 'trans.views.show_dictionary' project=project.slug lang=language.code %}">{{ language }}</a></li>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
|
|
{% if words.object_list %}
|
|
|
|
<h2>{% trans "Dictionary" %}</h2>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans "Source" %}</th>
|
|
<th>{% trans "Translation" %}</th>
|
|
<th></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for word in words.object_list %}
|
|
<tr>
|
|
<td class="translatetext">{{ word.source }}</td>
|
|
<td class="translatetext">{{ word.target }}</td>
|
|
<td>
|
|
{% if perms.trans.change_dictionary %}
|
|
<form action="{% url 'trans.views.edit_dictionary' project=project.slug lang=language.code %}" method="get">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="id" value="{{ word.id }}" />
|
|
<input type="submit" class="button" value="{% trans "Edit" %}" />
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if perms.trans.delete_dictionary %}
|
|
<form action="{% url 'trans.views.delete_dictionary' project=project.slug lang=language.code %}" method="post">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="id" value="{{ word.id }}" />
|
|
<input type="submit" class="button" value="{% trans "Delete" %}" />
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<ul class="pages">
|
|
{% if words.has_previous %}
|
|
<li><a href="?page={{ words.previous_page_number }}">«</a></li>
|
|
{% else %}
|
|
<li class="disabled"><span>«</span></li>
|
|
{% endif %}
|
|
{% for page in words.paginator.page_range %}
|
|
<li {% if page = words.number %} class="active" {% endif %}><a href="?page={{ page }}">{{ page }}</a></li>
|
|
{% endfor %}
|
|
{% if words.has_next %}
|
|
<li><a href="?page={{ words.next_page_number }}">»</a></li>
|
|
{% else %}
|
|
<li class="disabled"><span>»</span></li>
|
|
{% endif %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
{% if perms.trans.add_dictionary %}
|
|
<h2>{% trans "Add new word" %}</h2>
|
|
|
|
<form method="POST">
|
|
{% csrf_token %}
|
|
<table>
|
|
{{ form.as_table }}
|
|
</table>
|
|
<input type="submit" value="{% trans "Add" %}" />
|
|
</form>
|
|
{% endif %}
|
|
|
|
{% if perms.trans.upload_dictionary %}
|
|
<h2>{% trans "Import dictionary" %}</h2>
|
|
|
|
<p>{% trans "You can upload any format which is understood by Translate Toolkit for example csv or po file." %}</p>
|
|
|
|
<form action="{% url 'trans.views.upload_dictionary' project=project.slug lang=language.code %}" method="post" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
<table>
|
|
{{ uploadform.as_table }}
|
|
</table>
|
|
<input type="submit" value="{% trans "Import" %}" />
|
|
</form>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|