Propagate some status variables
This commit is contained in:
parent
f234a3bd06
commit
8eb8f991da
|
@ -5,6 +5,8 @@
|
|||
|
||||
{% include "translation_info.html" %}
|
||||
|
||||
<h2>{% trans "Translate" %}</h2>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -37,9 +37,22 @@ def translate(request, project, subproject, lang):
|
|||
except:
|
||||
offset = 0
|
||||
units = obj.unit_set.filter_type(rqtype)
|
||||
total = units.count()
|
||||
if offset >= total:
|
||||
offset = total - 1
|
||||
nextoffset = offset + 1
|
||||
if nextoffset >= total:
|
||||
nextoffset = None
|
||||
prevoffset = offset - 1
|
||||
if prevoffset < 0:
|
||||
prevoffset = None
|
||||
|
||||
return render_to_response('translate.html', RequestContext(request, {
|
||||
'object': obj,
|
||||
'title': '%s @ Weblate' % (obj.__unicode__()),
|
||||
'unit': units[offset],
|
||||
'total': total,
|
||||
'offset': offset,
|
||||
'prevoffset': prevoffset,
|
||||
'nextoffset': nextoffset,
|
||||
}))
|
||||
|
|
Loading…
Reference in New Issue
Block a user