Commit 35cc73af authored by Michal Čihař's avatar Michal Čihař

Allow to directly edit priority from translation

This makes it easy to adjust it when something wrong is noticed while
translating.

Fixes #575
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 9821c691
......@@ -29,11 +29,11 @@
{% for source in page_obj.object_list %}
{% with source.get_source_comments as comments %}
<tr>
<td class="expander">
<td class="expander {% if expand %}auto-expand{% endif %}">
<a><span class="glyphicon glyphicon-chevron-right expand-icon"></span></a>
</td>
<td class="translatetext expander">{% format_translation source.source %}</td>
<td>{{ source.source_info.get_priority_display }}{% if perms.edit_priority %} <a class="button smallbutton edit-priority" href="{% url 'edit_priority' pk=source.source_info.pk %}" data-priority="{{ source.source_info.priority }}"><span class="glyphicon glyphicon-pencil"></span></a>{% endif %}</td>
<td>{{ source.source_info.get_priority_display }}{% if perms.trans.edit_priority %} <a class="button smallbutton edit-priority" href="{% url 'edit_priority' pk=source.source_info.pk %}" data-priority="{{ source.source_info.priority }}"><span class="glyphicon glyphicon-pencil"></span></a>{% endif %}</td>
<td class="source-checks">
{% if ignored %}
{% show_checks source.source_checks user %}
......
......@@ -389,7 +389,10 @@
<th>{% trans "String priority" %}</th>
</tr>
<tr>
<td>{{ unit.source_info.get_priority_display }}</td>
<td>
{{ unit.source_info.get_priority_display }}
{% if perms.trans.edit_priority %} <a class="button smallbutton" href="{% url 'review_source' project=unit.translation.subproject.project.slug subproject=unit.translation.subproject.slug %}?checksum={{ unit.checksum }}"><span class="glyphicon glyphicon-pencil"></span></a>{% endif %}
</td>
</tr>
{% with unit.active_source_checks as checks %}
{% if checks %}
......
......@@ -299,6 +299,11 @@ $(function () {
$(this).closest('tr').find('.expander').first().click();
});
/* Auto expand expander */
$('.auto-expand').each(function () {
$(this).click()
});
/* Load correct tab */
if (location.hash !== '') {
var activeTab = $('[data-toggle=tab][href=' + location.hash + ']');
......
......@@ -48,10 +48,16 @@ def review_source(request, project, subproject):
rqtype = request.GET.get('type', 'all')
limit = request.GET.get('limit', 50)
page = request.GET.get('page', 1)
checksum = request.GET.get('checksum', '')
ignored = 'ignored' in request.GET
expand = False
# Filter units:
sources = source.unit_set.filter_type(rqtype, source, ignored)
if checksum:
sources = source.unit_set.filter(checksum=checksum)
expand = True
else:
sources = source.unit_set.filter_type(rqtype, source, ignored)
paginator = Paginator(sources, limit)
......@@ -73,6 +79,7 @@ def review_source(request, project, subproject):
'page_obj': sources,
'rqtype': rqtype,
'ignored': ignored,
'expand': True,
'title': _('Review source strings in %s') % obj.__unicode__(),
}
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment