Commit 72bcef5c authored by Michal Čihař's avatar Michal Čihař

Show last author and change on translation stats

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 46389bde
...@@ -175,6 +175,17 @@ ...@@ -175,6 +175,17 @@
<td class="number">{{ object.failing_checks }}</td> <td class="number">{{ object.failing_checks }}</td>
<td class="number"></td> <td class="number"></td>
</tr> </tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<tr>
<th>{% trans "Last change" %}<th>
<td class="number" colspan="3">{{ object.get_last_change }}</td>
</tr>
<tr>
<th>{% trans "Last author" %}<th>
<td class="number" colspan="3">{{ object.get_last_author }}</td>
</tr>
</table> </table>
</div> </div>
......
...@@ -700,7 +700,7 @@ class Translation(models.Model, URLMixin, PercentMixin): ...@@ -700,7 +700,7 @@ class Translation(models.Model, URLMixin, PercentMixin):
self.revision = blob_hash self.revision = blob_hash
self.save() self.save()
def get_last_author(self, email=True): def get_last_author(self, email=False):
''' '''
Returns last autor of change done in Weblate. Returns last autor of change done in Weblate.
''' '''
...@@ -727,7 +727,7 @@ class Translation(models.Model, URLMixin, PercentMixin): ...@@ -727,7 +727,7 @@ class Translation(models.Model, URLMixin, PercentMixin):
Commits any pending changes. Commits any pending changes.
''' '''
# Get author of last changes # Get author of last changes
last = self.get_last_author() last = self.get_last_author(True)
# If it is same as current one, we don't have to commit # If it is same as current one, we don't have to commit
if author == last or last is None: if author == last or last is None:
......
...@@ -245,7 +245,7 @@ def export_stats(request, project, subproject): ...@@ -245,7 +245,7 @@ def export_stats(request, project, subproject):
'total': trans.total, 'total': trans.total,
'total_words': trans.total_words, 'total_words': trans.total_words,
'last_change': trans.get_last_change(), 'last_change': trans.get_last_change(),
'last_author': trans.get_last_author(False), 'last_author': trans.get_last_author(),
'translated': trans.translated, 'translated': trans.translated,
'translated_words': trans.translated_words, 'translated_words': trans.translated_words,
'translated_percent': trans.get_translated_percent(), 'translated_percent': trans.get_translated_percent(),
......
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