From c03b975a98e10c4ef2820615fdb36925e4ff6544 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Sun, 22 Nov 2026 13:59:07 +0100 Subject: [PATCH] Humanize last updated times in build details --- generate_build_details.py | 2 ++ requirements.txt | 1 + templates/build-details.html.jinja | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/generate_build_details.py b/generate_build_details.py index 075cc7c08..612534f28 100644 --- a/generate_build_details.py +++ b/generate_build_details.py @@ -8,6 +8,7 @@ from sys import argv import dacite +import humanize from git import Repo from jinja2 import Environment, FileSystemLoader from urllib3 import request @@ -57,6 +58,7 @@ def get_language_repo_and_completion( logging.basicConfig(level=logging.INFO) logger.info('starting at %s', generation_time) env = Environment(loader=FileSystemLoader('templates')) + env.filters['naturaltime'] = humanize.naturaltime if (index_path := Path('build/index.json')).exists(): index_json = loads(Path('build/index.json').read_text()) else: diff --git a/requirements.txt b/requirements.txt index c704f04bd..d8ddda0e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ gitpython urllib3 potodo jinja2 +humanize docutils git+https://github.com/m-aciek/sphinx.git@copilot/fix-last-four-cases-issue-14162 python-docs-theme diff --git a/templates/build-details.html.jinja b/templates/build-details.html.jinja index 73bd73f5c..25fe03e6a 100644 --- a/templates/build-details.html.jinja +++ b/templates/build-details.html.jinja @@ -24,7 +24,12 @@ {{ project.language.name }} ({{ project.language.code }}) {{ project.branch }} - {{ metadata[2].strftime("%Y/%m/%d %T") if metadata[2] else '' }} + + {% if metadata[2] %} + + {% endif %} + {% if project.completion %} {{ metadata[0] }}