Commit f233fec7 authored by Michal Čihař's avatar Michal Čihař

Add stub for getting similar strings

parent cd0dff5c
{% load i18n %}
{% load weblate %}
{% if similar.count > 0 %}
<table>
<thead>
<tr><th>{% trans "Source" %}</th><th>{% trans "Translation" %}</th></tr>
</thead>
<tbody>
{% for item in similar %}
<tr class="clickable">
<td class="translatetext"><a href="{{ item.object.get_absolute_url }}">{{ item.object.source|fmttranslation }}</a></td>
<td class="translatetext"><a href="{{ item.object.get_absolute_url }}">{{ item.object.target|fmttranslation:item.object.translation.language }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{% trans "No similar strings found." %}</p>
{% endif %}
......@@ -378,6 +378,12 @@ def get_string(request, checksum):
return HttpResponse(units[0].get_source_plurals()[0])
def get_similar(request, unit_id):
unit = get_object_or_404(Unit, pk = int(unit_id))
return render_to_response('similar.html', RequestContext(request, {
'similar': [],
}))
@login_required
@permission_required('trans.ignore_check')
def ignore_check(request, check_id):
......
......@@ -36,6 +36,7 @@ urlpatterns = patterns('',
url(r'^js/get/(?P<checksum>[^/]*)/$', 'trans.views.get_string'),
url(r'^js/ignore-check/(?P<check_id>[0-9]*)/$', 'trans.views.ignore_check'),
url(r'^js/i18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
url(r'^js/similar/(?P<unit_id>[0-9]*)/$', 'trans.views.get_similar'),
# Admin interface
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
......
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