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

Show revert only in case it makes sense

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 0e96c288
......@@ -25,7 +25,7 @@
<td><a href="{{ c.get_translation_url }}">{{ c.get_translation_display }}</a></td>
<td></td>
</tr>
{% if c.target and c.unit %}
{% if c.can_revert %}
<tr>
<td colspan="4">{% format_translation c.target c.unit.translation.language %}</td>
<td>
......
......@@ -233,3 +233,15 @@ class Change(models.Model):
self.dictionary.language
)
return None
def can_revert(self):
return (
self.unit is not None and
self.target and
self.action in (
Change.ACTION_ACCEPT,
Change.ACTION_REVERT,
Change.ACTION_CHANGE,
Change.ACTION_NEW
)
)
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