Commit 778001e6 authored by Michal Čihař's avatar Michal Čihař

Better displaying of RTL languages in related strings

parent 4f01248d
......@@ -10,7 +10,7 @@
<tr>
<td>{{ item.translation.subproject }}</td>
<td class="translatetext"><a href="{{ item.get_absolute_url }}">{{ item.source|fmttranslation }}</a></td>
<td class="translatetext"><a href="{{ item.get_absolute_url }}">{{ item.target|fmttranslationdiff:unit }}</a></td>
<td class="translatetext" {{ item.translation.language.get_html }}><a href="{{ item.get_absolute_url }}">{{ item.target|fmttranslationdiff:unit }}</a></td>
<td>{% include "unit-state.html" %}</td>
<td>
{% if perms.trans.save_translation %}
......
......@@ -10,7 +10,7 @@
<tr>
<td>{{ item.translation.subproject }}</td>
<td class="translatetext"><a href="{{ item.get_absolute_url }}">{{ item.source|fmttranslation }}</a></td>
<td class="translatetext"><a href="{{ item.get_absolute_url }}">{{ item.target|fmttranslation:item.translation.language }}</a></td>
<td class="translatetext" {{ item.translation.language.get_html }}><a href="{{ item.get_absolute_url }}">{{ item.target|fmttranslation:item.translation.language }}</a></td>
<td>{% include "unit-state.html" %}</td>
</tr>
{% endfor %}
......
......@@ -159,15 +159,10 @@
</thead>
<tbody>
{% for item in unit.nearby %}
<tr>
<tr {% if unit.position == item.position %}class="current_translation"{% endif %}>
<td class="number"><a href="{{ item.get_absolute_url }}">{{ item.position }}</a></td>
{% if unit.position == item.position %}
<td class="translatetext current_translation"><a href="{{ item.get_absolute_url }}">{{ item.source|fmttranslation }}</a></td>
<td class="translatetext current_translation"><a href="{{ item.get_absolute_url }}">{{ item.target|fmttranslation:unit.translation.language }}</a></td>
{% else %}
<td class="translatetext"><a href="{{ item.get_absolute_url }}">{{ item.source|fmttranslation }}</a></td>
<td class="translatetext"><a href="{{ item.get_absolute_url }}">{{ item.target|fmttranslation:unit.translation.language }}</a></td>
{% endif %}
<td class="translatetext" {{ item.translation.language.get_html }}><a href="{{ item.get_absolute_url }}">{{ item.target|fmttranslation:unit.translation.language }}</a></td>
<td>{% include "unit-state.html" %}</td>
</tr>
{% endfor %}
......
......@@ -375,3 +375,6 @@ class Language(models.Model):
if translations['total__sum'] == 0:
return 0
return round(translations['translated__sum'] * 100.0 / translations['total__sum'], 1)
def get_html(self):
return 'lang="%s" dir="%s"' % (self.code, self.direction)
......@@ -60,7 +60,10 @@ ul.breadcrumbs li {
.translatetext {
background-color: #eee;
}
.current_translation {
.translatetext a, .translatetext a span {
display: block;
}
tr.current_translation td.translatetext {
background-color: #ddd;
}
.translation_comment {
......
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