diff --git a/app/templates/projects/project.html b/app/templates/projects/project.html
index 64118a7..74e30e4 100644
--- a/app/templates/projects/project.html
+++ b/app/templates/projects/project.html
@@ -13,7 +13,12 @@
{{ project }}
{% translate 'catalogs'|capfirst %}
{% for catalog in project.catalogs.all %}
- - {{ catalog }}
+ -
+ {{ catalog }}
+
+ {% blocktranslate with timesince=project.pretty_timesince trimmed %}Updated {{ timesince }} ago.{% endblocktranslate %}
+
+
{% endfor %}
diff --git a/app/templates/projects/projects.html b/app/templates/projects/projects.html
index 224f3c6..32c19fc 100644
--- a/app/templates/projects/projects.html
+++ b/app/templates/projects/projects.html
@@ -14,7 +14,12 @@ {% translate 'Your projects' %}
{% if projects %}
{% for project in projects %}
- - {{ project.name }}
+ -
+ {{ project.name }}
+
+ {% blocktranslate with timesince=project.pretty_timesince trimmed %}Updated {{ timesince }} ago.{% endblocktranslate %}
+
+
{% endfor %}
{% else %}
diff --git a/projects/forms.py b/projects/forms.py
index 7104f32..474dcc3 100644
--- a/projects/forms.py
+++ b/projects/forms.py
@@ -139,6 +139,7 @@ def update(self, catalog, *, request):
catalog.pofile = str(catalog.po)
catalog.save()
+ catalog.project.save()
else:
messages.info(request, _("No changes detected."))
diff --git a/projects/models.py b/projects/models.py
index 5db38b3..6e0fa34 100644
--- a/projects/models.py
+++ b/projects/models.py
@@ -5,6 +5,7 @@
from django.core import validators
from django.db import models
from django.urls import reverse
+from django.utils.timesince import timesince
from django.utils.translation import gettext_lazy as _
@@ -77,6 +78,10 @@ def clean(self):
def get_api_url(self):
return f"/api/pofile/{self.slug}/"
+ @property
+ def pretty_timesince(self):
+ return timesince(self.updated_at, depth=1)
+
class CatalogQuerySet(models.QuerySet):
def for_user(self, user):
@@ -129,3 +134,7 @@ def get_absolute_url(self):
@cached_property
def po(self):
return polib.pofile(self.pofile, wrapwidth=0)
+
+ @property
+ def pretty_timesince(self):
+ return timesince(self.updated_at, depth=1)