From 17063f9aab838509edeef1d43297ac079536b371 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Sun, 22 Mar 2026 23:08:29 +0100 Subject: [PATCH 01/10] Add new linter --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7093afdf5..be098c214 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,5 +46,11 @@ repos: - id: deptry args: [".", "--per-rule-ignores", "DEP002=python-docs-theme", "--package-module-name-map", "gitpython=git,sphinx-lint=sphinxlint"] + - repo: https://github.com/djlint/djLint + rev: v1.36.4 + hooks: + - id: djlint-reformat-jinja + - id: djlint-jinja + ci: autoupdate_schedule: quarterly From 4562abfb8c01570dfe24cfb7cf4782efe60099c9 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Sun, 22 Mar 2026 23:20:03 +0100 Subject: [PATCH 02/10] reformat --- templates/base.html.jinja | 174 +++++++++++++++-------------- templates/build-details.html.jinja | 80 ++++++------- templates/index.html.jinja | 92 +++++++-------- templates/progress_bar.html.jinja | 29 ++--- 4 files changed, 196 insertions(+), 179 deletions(-) diff --git a/templates/base.html.jinja b/templates/base.html.jinja index e90f7b19e..28570b0cc 100644 --- a/templates/base.html.jinja +++ b/templates/base.html.jinja @@ -1,70 +1,85 @@ - + - - - - - - - Python Docs Translation Dashboard - - - - - - -
- -
- -
- {% block main %} - {% endblock %} -
- - - - - - - - -{# Plausible analytics #} - - -{% block extrascript %} -{% endblock %} + + + + {# Plausible analytics #} + + + {% block extrascript %}{% endblock %} diff --git a/templates/build-details.html.jinja b/templates/build-details.html.jinja index 02c7c637a..0ceddc39e 100644 --- a/templates/build-details.html.jinja +++ b/templates/build-details.html.jinja @@ -1,43 +1,43 @@ {% extends "base.html.jinja" %} - {% block main %} - - - - - - - - - - - - {% for project, metadata in build_details | sort(attribute='0.completion') | reverse %} - {% if project.repository %} - - - - - - - - {% endif %} - {% endfor %} - -
languagebranchlast updatedbuild warnings*lint failures
{{ project.language.name }} ({{ project.language.code }}){{ project.branch }}{{ metadata[2].strftime('%Y/%m/%d %T') if metadata[2] else '' }} - {% if project.completion %} - {{ metadata[0] }} - {% else %} - {{ metadata[0] }} - {% endif %} - - {% if project.completion %} - {{ metadata[1] }} - {% else %} - {{ metadata[1] }} - {% endif %} -
- -

* number of Sphinx build process warnings

-

Last updated at {{ generation_time.strftime('%A, %-d %B %Y, %-H:%M:%S %Z') }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes).

+ + + + + + + + + + + + {% for project, metadata in build_details | sort(attribute='0.completion') | reverse %} + {% if project.repository %} + + + + + + + + {% endif %} + {% endfor %} + +
languagebranchlast updatedbuild warnings*lint failures
{{ project.language.name }} ({{ project.language.code }}){{ project.branch }}{{ metadata[2].strftime("%Y/%m/%d %T") if metadata[2] else '' }} + {% if project.completion %} + {{ metadata[0] }} + {% else %} + {{ metadata[0] }} + {% endif %} + + {% if project.completion %} + {{ metadata[1] }} + {% else %} + {{ metadata[1] }} + {% endif %} +
+

* number of Sphinx build process warnings

+

+ Last updated at {{ generation_time.strftime("%A, %-d %B %Y, %-H:%M:%S %Z") }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes). +

{% endblock %} diff --git a/templates/index.html.jinja b/templates/index.html.jinja index 790318006..52e4a6e10 100644 --- a/templates/index.html.jinja +++ b/templates/index.html.jinja @@ -1,51 +1,55 @@ {% extends "base.html.jinja" %} - {% block main %} -
-
- {% for project in completion_progress | sort(attribute='core_completion,completion') | reverse %} -
-
-
-

{{ project.language.name }}

-
{{ project.translated_name }}
- - - {# core progress bar #} - {% with width=project.core_completion, change=project.core_change, kind='core' %} - {% include 'progress_bar.html.jinja' %} - {% endwith %} - {# overall progress bar #} - {% with width=project.completion, change=project.change, kind='overall', extra_container_class='mt-1' %} - {% include 'progress_bar.html.jinja' %} - {% endwith %} -
+
+
+ {% for project in completion_progress | sort(attribute='core_completion,completion') | reverse %} +
+
+
+

+ {{ project.language.name }} +

+
{{ project.translated_name }}
+ + {# core progress bar #} + {% with width=project.core_completion, change=project.core_change, kind='core' %} + {% include 'progress_bar.html.jinja' %} + {% endwith %} + {# overall progress bar #} + {% with width=project.completion, change=project.change, kind='overall', extra_container_class='mt-1' %} + {% include 'progress_bar.html.jinja' %} + {% endwith %} +
+
+
+ {% endfor %}
-
- {% endfor %} -
-
- -

- Last updated {{ generation_time.strftime('on %A %-d %B %Y at %-H:%M:%S %Z') }} (in {{ duration // 60 }} minutes and {{ duration % 60 }} seconds).
- You can find the scripts used to generate this website on GitHub.
- You can download the data on this page in JSON format. -

+
+

+ Last updated {{ generation_time.strftime("on %A %-d %B %Y at %-H:%M:%S %Z") }} (in {{ duration // 60 }} minutes and {{ duration % 60 }} seconds). +
+ You can find the scripts used to generate this website on GitHub. +
+ You can download the data on this page in JSON format. +

{% endblock %} {% block extrascript %} - + {% endblock %} diff --git a/templates/progress_bar.html.jinja b/templates/progress_bar.html.jinja index a24a2e96d..17f473bf4 100644 --- a/templates/progress_bar.html.jinja +++ b/templates/progress_bar.html.jinja @@ -4,17 +4,20 @@ - change: numeric change value (same units as width) or falsy #}
-
- {{ kind }}: {{ '{:.2f}%'.format(width) }} {% if change >= 0.01 %}({{ '{:+.2f}%'.format(change) }}){% endif %} -
-
- {{ kind }}: {{ '{:.2f}%'.format(width) }} {% if change >= 0.01 %}({{ '{:+.2f}%'.format(change) }}){% endif %} -
+
+ {{ kind }}: {{ '{:.2f}%'.format(width) }} + {% if change >= 0.01 %} + ({{ '{:+.2f}%'.format(change) }}) + {% endif %} +
+
+ {{ kind }}: {{ '{:.2f}%'.format(width) }} + {% if change >= 0.01 %} + ({{ '{:+.2f}%'.format(change) }}) + {% endif %} +
From 2ecce5daa881845d378b3e5bd41fc0acc5f94560 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Sun, 22 Mar 2026 23:33:40 +0100 Subject: [PATCH 03/10] add meta keywords, move styles to stylesheet, add height and width for logo, set endblock names, add ignore for flask internal links --- djlint.toml | 1 + src/style.css | 10 ++++++++++ templates/base.html.jinja | 11 +++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 djlint.toml diff --git a/djlint.toml b/djlint.toml new file mode 100644 index 000000000..cf12d762c --- /dev/null +++ b/djlint.toml @@ -0,0 +1 @@ +ignore="J018" diff --git a/src/style.css b/src/style.css index 14bd515f5..e721812cc 100644 --- a/src/style.css +++ b/src/style.css @@ -42,6 +42,16 @@ body { outline-offset: 8px; } +.navbar-brand a img { + height: 2rem; +} + +.navbar-brand a span { + font-size: 1.25rem; + font-weight: 700; + color: #4a4a4a; +} + .nav-link svg { vertical-align: middle; margin-top: -4.5px; diff --git a/templates/base.html.jinja b/templates/base.html.jinja index 28570b0cc..5b86078c9 100644 --- a/templates/base.html.jinja +++ b/templates/base.html.jinja @@ -6,6 +6,7 @@ content="width=device-width, initial-scale=1, shrink-to-fit=no"> + Python Docs Translation Dashboard @@ -40,14 +38,14 @@ {% endfor %}
-

+

Last updated {{ generation_time.strftime("on %A %-d %B %Y at %-H:%M:%S %Z") }} (in {{ duration // 60 }} minutes and {{ duration % 60 }} seconds).
You can find the scripts used to generate this website on GitHub.
You can download the data on this page in JSON format.

-{% endblock %} +{% endblock main %} {% block extrascript %} -{% endblock %} +{% endblock extrascript %} From bd4bd65cc3798a342c11bf3aaa395ba3207e7972 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Mon, 23 Mar 2026 00:23:15 +0100 Subject: [PATCH 08/10] use spaceless tags inside attribute values --- templates/progress_bar.html.jinja | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/progress_bar.html.jinja b/templates/progress_bar.html.jinja index 17f473bf4..7c8633733 100644 --- a/templates/progress_bar.html.jinja +++ b/templates/progress_bar.html.jinja @@ -6,9 +6,9 @@
+ {%- if change and width -%} {# compute the relative change percentage safely #} {%- set rel = (change * 100 / width) -%} background: linear-gradient(to left, #94cf96 {{ rel }}%, #4caf50 {{ rel }}%); + {%- else -%} background-color: #4caf50; + {%- endif -%}"> {{ kind }}: {{ '{:.2f}%'.format(width) }} {% if change >= 0.01 %} ({{ '{:+.2f}%'.format(change) }}) From bc5c228000c4611f162073989ed82ead9e21b7ff Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Mon, 23 Mar 2026 00:34:00 +0100 Subject: [PATCH 09/10] add indentation setting to djlint configuration --- djlint.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/djlint.toml b/djlint.toml index cf12d762c..7eab3e9aa 100644 --- a/djlint.toml +++ b/djlint.toml @@ -1 +1,2 @@ ignore="J018" +indent=2 From 6ee38e5f10f8f567a8371775252b62b012a935ec Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Mon, 23 Mar 2026 00:34:24 +0100 Subject: [PATCH 10/10] reformat --- templates/base.html.jinja | 188 ++++++++++++++--------------- templates/build-details.html.jinja | 80 ++++++------ templates/index.html.jinja | 88 +++++++------- templates/progress_bar.html.jinja | 32 ++--- 4 files changed, 193 insertions(+), 195 deletions(-) diff --git a/templates/base.html.jinja b/templates/base.html.jinja index fe4b48b26..e2a773ecd 100644 --- a/templates/base.html.jinja +++ b/templates/base.html.jinja @@ -1,87 +1,87 @@ - - - - - - Python Docs Translation Dashboard - - - - -
- -
-
- {% block main %} - {% endblock main %} -
- - - - - {# Plausible analytics #} - - - {% block extrascript %} - {% endblock extrascript %} + + + + {# Plausible analytics #} + + + {% block extrascript %} + {% endblock extrascript %} diff --git a/templates/build-details.html.jinja b/templates/build-details.html.jinja index cc91fdb10..93e9f6298 100644 --- a/templates/build-details.html.jinja +++ b/templates/build-details.html.jinja @@ -1,43 +1,43 @@ {% extends "base.html.jinja" %} {% block main %} - - - - - - - - - - - - {% for project, metadata in build_details | sort(attribute='0.completion') | reverse %} - {% if project.repository %} - - - - - - - - {% endif %} - {% endfor %} - -
languagebranchlast updatedbuild warnings*lint failures
{{ project.language.name }} ({{ project.language.code }}){{ project.branch }}{{ metadata[2].strftime("%Y/%m/%d %T") if metadata[2] else '' }} - {% if project.completion %} - {{ metadata[0] }} - {% else %} - {{ metadata[0] }} - {% endif %} - - {% if project.completion %} - {{ metadata[1] }} - {% else %} - {{ metadata[1] }} - {% endif %} -
-

* number of Sphinx build process warnings

-

- Last updated at {{ generation_time.strftime("%A, %-d %B %Y, %-H:%M:%S %Z") }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes). -

+ + + + + + + + + + + + {% for project, metadata in build_details | sort(attribute='0.completion') | reverse %} + {% if project.repository %} + + + + + + + + {% endif %} + {% endfor %} + +
languagebranchlast updatedbuild warnings*lint failures
{{ project.language.name }} ({{ project.language.code }}){{ project.branch }}{{ metadata[2].strftime("%Y/%m/%d %T") if metadata[2] else '' }} + {% if project.completion %} + {{ metadata[0] }} + {% else %} + {{ metadata[0] }} + {% endif %} + + {% if project.completion %} + {{ metadata[1] }} + {% else %} + {{ metadata[1] }} + {% endif %} +
+

* number of Sphinx build process warnings

+

+ Last updated at {{ generation_time.strftime("%A, %-d %B %Y, %-H:%M:%S %Z") }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes). +

{% endblock main %} diff --git a/templates/index.html.jinja b/templates/index.html.jinja index b237a6269..cb5ae1bd7 100644 --- a/templates/index.html.jinja +++ b/templates/index.html.jinja @@ -1,53 +1,51 @@ {% extends "base.html.jinja" %} {% block main %} -
-
- {% for project in completion_progress | sort(attribute='core_completion,completion') | reverse %} -
-
-
-

- {{ project.language.name }} -

-
{{ project.translated_name }}
- - {# core progress bar #} - {% with width=project.core_completion, change=project.core_change, kind="core" %} - {% include "progress_bar.html.jinja" %} - {% endwith %} - {# overall progress bar #} - {% with width=project.completion, change=project.change, kind="overall", extra_container_class="mt-1" %} - {% include "progress_bar.html.jinja" %} - {% endwith %} -
-
-
- {% endfor %} +
+
+ {% for project in completion_progress | sort(attribute='core_completion,completion') | reverse %} +
+
+
+

+ {{ project.language.name }} +

+
{{ project.translated_name }}
+ + {# core progress bar #} + {% with width=project.core_completion, change=project.core_change, kind="core" %} + {% include "progress_bar.html.jinja" %} + {% endwith %} + {# overall progress bar #} + {% with width=project.completion, change=project.change, kind="overall", extra_container_class="mt-1" %} + {% include "progress_bar.html.jinja" %} + {% endwith %} +
+
+ {% endfor %}
-

- Last updated {{ generation_time.strftime("on %A %-d %B %Y at %-H:%M:%S %Z") }} (in {{ duration // 60 }} minutes and {{ duration % 60 }} seconds). -
- You can find the scripts used to generate this website on GitHub. -
- You can download the data on this page in JSON format. -

+
+

+ Last updated {{ generation_time.strftime("on %A %-d %B %Y at %-H:%M:%S %Z") }} (in {{ duration // 60 }} minutes and {{ duration % 60 }} seconds). +
+ You can find the scripts used to generate this website on GitHub. +
+ You can download the data on this page in JSON format. +

{% endblock main %} {% block extrascript %} - + {% endblock extrascript %} diff --git a/templates/progress_bar.html.jinja b/templates/progress_bar.html.jinja index 7c8633733..19b94d799 100644 --- a/templates/progress_bar.html.jinja +++ b/templates/progress_bar.html.jinja @@ -4,20 +4,20 @@ - change: numeric change value (same units as width) or falsy #}
-
- {{ kind }}: {{ '{:.2f}%'.format(width) }} - {% if change >= 0.01 %} - ({{ '{:+.2f}%'.format(change) }}) - {% endif %} -
-
- {{ kind }}: {{ '{:.2f}%'.format(width) }} - {% if change >= 0.01 %} - ({{ '{:+.2f}%'.format(change) }}) - {% endif %} -
+
+ {{ kind }}: {{ '{:.2f}%'.format(width) }} + {% if change >= 0.01 %} + ({{ '{:+.2f}%'.format(change) }}) + {% endif %} +
+
+ {{ kind }}: {{ '{:.2f}%'.format(width) }} + {% if change >= 0.01 %} + ({{ '{:+.2f}%'.format(change) }}) + {% endif %} +