Commit 3dc3aaec authored by Michal Čihař's avatar Michal Čihař

Add (by default hidden) column for untranslated strings

Fixes #710
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent b9701c13
......@@ -7,6 +7,7 @@
<th>{% if show_language == 1 %}{% trans "Language" %}{% else %}{% trans "Project" %}{% endif %}</th>
<th></th>
<th colspan="2">{% trans "Translated" %}</th>
<th class="col-untranslated" style="display: none">{% trans "Untranslated" context "Number of untranslated strings" %}</th>
<th class="col-words">{% trans "Words" context "Number of translated words" %}</th>
<th class="col-fuzzy">{% trans "Fuzzy" context "Number of fuzzy strings" %}</th>
<th class="col-checks">{% trans "Checks" context "Number of failing checks" %}</th>
......@@ -17,6 +18,7 @@
<i class="fa fa-columns"></i>
</button>
<ul class="dropdown-menu" id="columns-menu" role="menu">
<li><a><label><input type="checkbox" id="toggle-untranslated"> {% trans "Untranslated" context "Number of untranslated strings" %}</label></a></li>
<li><a><label><input type="checkbox" id="toggle-words" checked="true"> {% trans "Words" context "Number of translated words" %}</label></a></li>
<li><a><label><input type="checkbox" id="toggle-fuzzy" checked="true"> {% trans "Fuzzy" context "Number of fuzzy strings" %}</label></a></li>
<li><a><label><input type="checkbox" id="toggle-checks" checked="true"> {% trans "Checks" context "Number of failing checks" %}</label></a></li>
......@@ -27,7 +29,7 @@
</tr>
<tbody>
{% for trans in translations %}
{% with trans.get_translated_percent as percent and trans.get_fuzzy_percent as fuzzy and trans.failing_checks as checks and trans.get_non_translated as count and trans.get_failing_checks_percent as check_percent and trans.have_suggestion as suggestions %}
{% with trans.get_untranslated_percent as untranslated and trans.get_translated_percent as percent and trans.get_fuzzy_percent as fuzzy and trans.failing_checks as checks and trans.get_non_translated as count and trans.get_failing_checks_percent as check_percent and trans.have_suggestion as suggestions %}
{% if not hide_completed or count > 0 %}
<tr>
<th><a href="{{ trans.get_absolute_url }}">{% if show_language == 1 %}{{ trans.language }}{% else %}{% if show_only_component %}{{ trans.subproject.name }}{% else %}{{ trans.subproject }}{% endif %}{% if show_language == 2 %} ({{ trans.language }}){% endif %}{% endif %}</a>
......@@ -36,6 +38,7 @@
<td>{% if trans.is_user_locked %}<i class="fa fa-lock html-tooltip" data-placement="bottom" data-toggle="tooltip" data-title='{{ trans.get_lock_display }}'></a>{% endif %}</td>
<td class="progress-cell">{% translation_progress trans %}</td>
<td class="percent">{{ percent }}%</td>
<td class="percent col-untranslated" style="display: none">{{ untranslated }}%</td>
<td class="percent col-words" title="{% blocktrans count words=trans.untranslated_words %}{{ words }} word to translate!{% plural %}{{ words }} words to translate!{% endblocktrans %}" >{{ trans.get_words_percent }}%</td>
<td class="percent col-fuzzy">
{% if fuzzy > 0 %}
......
......@@ -52,6 +52,12 @@ class PercentMixin(object):
"""
return self.get_percents()[0]
def get_untranslated_percent(self):
"""
Returns percent of untranslated strings.
"""
return 100 - self.get_percents()[0]
def get_fuzzy_percent(self):
"""
Returns percent of fuzzy strings.
......
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