Skip to content

Commit 4562abf

Browse files
committed
reformat
1 parent 17063f9 commit 4562abf

4 files changed

Lines changed: 196 additions & 179 deletions

File tree

templates/base.html.jinja

Lines changed: 92 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,85 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3-
4-
<head>
5-
<meta charset="utf-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7-
<meta name="description" content="Python Documentation Translation Dashboard">
8-
9-
<title>Python Docs Translation Dashboard</title>
10-
11-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css"
12-
rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB"
13-
crossorigin="anonymous">
14-
<link href="style.css?version=1" rel="stylesheet">
15-
</head>
16-
17-
<body>
18-
<header>
19-
<nav class="navbar navbar-expand-md fixed-top">
20-
<div class="container-fluid">
21-
<div class="navbar-brand">
22-
<a href="./">
23-
<img src="logo.png" style="height: 2rem;" alt="Python logo">
24-
<span style="font-size: 1.25rem; font-weight: 700; color: #4a4a4a">Translation Dashboard</span>
25-
</a>
26-
</div>
27-
28-
<div class="navbar-light bg-light">
29-
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
30-
<span class="navbar-toggler-icon"></span>
31-
</button>
32-
</div>
33-
34-
<div class="collapse navbar-collapse" id="navbarNavDropdown">
35-
<ul class="navbar-nav mr-auto">
36-
<li class="nav-item">
37-
<a class="nav-link" href="build-details.html">
38-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-card-text" viewBox="0 0 16 16">
39-
<path d="M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z"></path>
40-
<path d="M3 5.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5M3 8a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9A.5.5 0 0 1 3 8m0 2.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5"></path>
41-
</svg>
42-
Build details
43-
</a>
44-
</li>
45-
<li class="nav-item">
46-
<a class="nav-link" href="https://devguide.python.org/documentation/translations/translating/" target="_blank">
47-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-up-right" viewBox="0 0 16 16">
48-
<path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5"></path>
49-
<path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z"></path>
50-
</svg>
51-
Translating
52-
</a>
53-
</li>
54-
</ul>
55-
</div>
56-
</div>
57-
</nav>
58-
</header>
59-
60-
<main role="main">
61-
{% block main %}
62-
{% endblock %}
63-
</main>
64-
65-
</body>
66-
67-
<script>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport"
6+
content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<meta name="description"
8+
content="Python Documentation Translation Dashboard">
9+
<title>Python Docs Translation Dashboard</title>
10+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css"
11+
rel="stylesheet"
12+
integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB"
13+
crossorigin="anonymous">
14+
<link href="style.css?version=1" rel="stylesheet">
15+
</head>
16+
<body>
17+
<header>
18+
<nav class="navbar navbar-expand-md fixed-top">
19+
<div class="container-fluid">
20+
<div class="navbar-brand">
21+
<a href="./">
22+
<img src="logo.png" style="height: 2rem;" alt="Python logo">
23+
<span style="font-size: 1.25rem; font-weight: 700; color: #4a4a4a">Translation Dashboard</span>
24+
</a>
25+
</div>
26+
<div class="navbar-light bg-light">
27+
<button class="navbar-toggler"
28+
type="button"
29+
data-bs-toggle="collapse"
30+
data-bs-target="#navbarNavDropdown"
31+
aria-controls="navbarNavDropdown"
32+
aria-expanded="false"
33+
aria-label="Toggle navigation">
34+
<span class="navbar-toggler-icon"></span>
35+
</button>
36+
</div>
37+
<div class="collapse navbar-collapse" id="navbarNavDropdown">
38+
<ul class="navbar-nav mr-auto">
39+
<li class="nav-item">
40+
<a class="nav-link" href="build-details.html">
41+
<svg xmlns="http://www.w3.org/2000/svg"
42+
width="16"
43+
height="16"
44+
fill="currentColor"
45+
class="bi bi-card-text"
46+
viewBox="0 0 16 16">
47+
<path d="M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z">
48+
</path>
49+
<path d="M3 5.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5M3 8a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9A.5.5 0 0 1 3 8m0 2.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5">
50+
</path>
51+
</svg>
52+
Build details
53+
</a>
54+
</li>
55+
<li class="nav-item">
56+
<a class="nav-link"
57+
href="https://devguide.python.org/documentation/translations/translating/"
58+
target="_blank">
59+
<svg xmlns="http://www.w3.org/2000/svg"
60+
width="16"
61+
height="16"
62+
fill="currentColor"
63+
class="bi bi-box-arrow-up-right"
64+
viewBox="0 0 16 16">
65+
<path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5">
66+
</path>
67+
<path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z">
68+
</path>
69+
</svg>
70+
Translating
71+
</a>
72+
</li>
73+
</ul>
74+
</div>
75+
</div>
76+
</nav>
77+
</header>
78+
<main role="main">
79+
{% block main %}{% endblock %}
80+
</main>
81+
</body>
82+
<script>
6883
function padnavbar() {
6984
const navbar = document.querySelector('.navbar.fixed-top');
7085
if (navbar) {
@@ -73,20 +88,15 @@
7388
}
7489
window.addEventListener('load', padnavbar);
7590
window.addEventListener('resize', padnavbar);
76-
</script>
77-
78-
<script src="https://code.jquery.com/jquery-4.0.0.slim.min.js"
79-
integrity="sha256-8DGpv13HIm+5iDNWw1XqxgFB4mj+yOKFNb+tHBZOowc="
80-
crossorigin="anonymous">
81-
</script>
82-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"
83-
integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI"
84-
crossorigin="anonymous">
85-
</script>
86-
87-
{# Plausible analytics #}
88-
<script defer data-domain="translations.python.org" src="https://analytics.python.org/js/script.outbound-links.js"></script>
89-
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
90-
{% block extrascript %}
91-
{% endblock %}
91+
</script>
92+
<script src="https://code.jquery.com/jquery-4.0.0.slim.min.js" integrity="sha256-8DGpv13HIm+5iDNWw1XqxgFB4mj+yOKFNb+tHBZOowc=" crossorigin="anonymous">
93+
</script>
94+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous">
95+
</script>
96+
{# Plausible analytics #}
97+
<script defer
98+
data-domain="translations.python.org"
99+
src="https://analytics.python.org/js/script.outbound-links.js"></script>
100+
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
101+
{% block extrascript %}{% endblock %}
92102
</html>

templates/build-details.html.jinja

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
{% extends "base.html.jinja" %}
2-
32
{% block main %}
4-
<table>
5-
<thead>
6-
<tr>
7-
<th>language</th>
8-
<th>branch</th>
9-
<th>last updated</th>
10-
<th>build warnings*</th>
11-
<th>lint failures</th>
12-
</tr>
13-
</thead>
14-
<tbody>
15-
{% for project, metadata in build_details | sort(attribute='0.completion') | reverse %}
16-
{% if project.repository %}
17-
<tr>
18-
<td data-label="language">{{ project.language.name }} ({{ project.language.code }})</td>
19-
<td data-label="branch">{{ project.branch }}</td>
20-
<td data-label="updated">{{ metadata[2].strftime('%Y/%m/%d %T') if metadata[2] else '' }}</td>
21-
<td data-label="warnings">
22-
{% if project.completion %}
23-
<a href="warnings-{{ project.language.code }}.txt">{{ metadata[0] }}</a>
24-
{% else %}
25-
{{ metadata[0] }}
26-
{% endif %}
27-
</td>
28-
<td data-label="lint">
29-
{% if project.completion %}
30-
<a href="warnings-lint-{{ project.language.code }}.txt">{{ metadata[1] }}</a>
31-
{% else %}
32-
{{ metadata[1] }}
33-
{% endif %}
34-
</td>
35-
</tr>
36-
{% endif %}
37-
{% endfor %}
38-
</tbody>
39-
</table>
40-
41-
<p>* number of Sphinx build process warnings</p>
42-
<p>Last updated at {{ generation_time.strftime('%A, %-d %B %Y, %-H:%M:%S %Z') }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes).</p>
3+
<table>
4+
<thead>
5+
<tr>
6+
<th>language</th>
7+
<th>branch</th>
8+
<th>last updated</th>
9+
<th>build warnings*</th>
10+
<th>lint failures</th>
11+
</tr>
12+
</thead>
13+
<tbody>
14+
{% for project, metadata in build_details | sort(attribute='0.completion') | reverse %}
15+
{% if project.repository %}
16+
<tr>
17+
<td data-label="language">{{ project.language.name }} ({{ project.language.code }})</td>
18+
<td data-label="branch">{{ project.branch }}</td>
19+
<td data-label="updated">{{ metadata[2].strftime("%Y/%m/%d %T") if metadata[2] else '' }}</td>
20+
<td data-label="warnings">
21+
{% if project.completion %}
22+
<a href="warnings-{{ project.language.code }}.txt">{{ metadata[0] }}</a>
23+
{% else %}
24+
{{ metadata[0] }}
25+
{% endif %}
26+
</td>
27+
<td data-label="lint">
28+
{% if project.completion %}
29+
<a href="warnings-lint-{{ project.language.code }}.txt">{{ metadata[1] }}</a>
30+
{% else %}
31+
{{ metadata[1] }}
32+
{% endif %}
33+
</td>
34+
</tr>
35+
{% endif %}
36+
{% endfor %}
37+
</tbody>
38+
</table>
39+
<p>* number of Sphinx build process warnings</p>
40+
<p>
41+
Last updated at {{ generation_time.strftime("%A, %-d %B %Y, %-H:%M:%S %Z") }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes).
42+
</p>
4343
{% endblock %}

templates/index.html.jinja

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,55 @@
11
{% extends "base.html.jinja" %}
2-
32
{% block main %}
4-
<div>
5-
<div class="row">
6-
{% for project in completion_progress | sort(attribute='core_completion,completion') | reverse %}
7-
<div class="col-12 col-sm-6 col-md-4 d-flex">
8-
<div id="{{ project.language.code }}" class="card shadow mb-3 w-100">
9-
<div class="card-body">
10-
<h3 class="card-title"><a href="#{{ project.language.code }}">{{ project.language.name }}</a></h3>
11-
<h5 class="card-subtitle mb-2 text-muted">{{ project.translated_name }}</h5>
12-
13-
<ul class="links-row">
14-
{% if project.built %}
15-
<li>
16-
<a href="https://docs.python.org/{{ project.language.code }}/3/" aria-label="View {{ project.language.name }} documentation"
17-
style="color: #1178cc;">View</a>
18-
</li>
19-
{% endif %}
20-
<li>
21-
<a href="{{ project.contribution_link }}" style="color: #1178cc;" aria-label="Contribute to {{ project.language.name }} translation">
22-
Contribute
23-
</a>
24-
</li>
25-
</ul>
26-
{# core progress bar #}
27-
{% with width=project.core_completion, change=project.core_change, kind='core' %}
28-
{% include 'progress_bar.html.jinja' %}
29-
{% endwith %}
30-
{# overall progress bar #}
31-
{% with width=project.completion, change=project.change, kind='overall', extra_container_class='mt-1' %}
32-
{% include 'progress_bar.html.jinja' %}
33-
{% endwith %}
34-
</div>
3+
<div>
4+
<div class="row">
5+
{% for project in completion_progress | sort(attribute='core_completion,completion') | reverse %}
6+
<div class="col-12 col-sm-6 col-md-4 d-flex">
7+
<div id="{{ project.language.code }}" class="card shadow mb-3 w-100">
8+
<div class="card-body">
9+
<h3 class="card-title">
10+
<a href="#{{ project.language.code }}">{{ project.language.name }}</a>
11+
</h3>
12+
<h5 class="card-subtitle mb-2 text-muted">{{ project.translated_name }}</h5>
13+
<ul class="links-row">
14+
{% if project.built %}
15+
<li>
16+
<a href="https://docs.python.org/{{ project.language.code }}/3/"
17+
aria-label="View {{ project.language.name }} documentation"
18+
style="color: #1178cc">View</a>
19+
</li>
20+
{% endif %}
21+
<li>
22+
<a href="{{ project.contribution_link }}"
23+
style="color: #1178cc"
24+
aria-label="Contribute to {{ project.language.name }} translation">
25+
Contribute
26+
</a>
27+
</li>
28+
</ul>
29+
{# core progress bar #}
30+
{% with width=project.core_completion, change=project.core_change, kind='core' %}
31+
{% include 'progress_bar.html.jinja' %}
32+
{% endwith %}
33+
{# overall progress bar #}
34+
{% with width=project.completion, change=project.change, kind='overall', extra_container_class='mt-1' %}
35+
{% include 'progress_bar.html.jinja' %}
36+
{% endwith %}
37+
</div>
38+
</div>
39+
</div>
40+
{% endfor %}
3541
</div>
36-
</div>
37-
{% endfor %}
38-
</div>
39-
</div>
40-
41-
<p style="text-align: center;">
42-
Last updated {{ generation_time.strftime('on %A %-d %B %Y at %-H:%M:%S %Z') }} (in {{ duration // 60 }} minutes and {{ duration % 60 }} seconds).<br/>
43-
You can find the scripts used to generate this website <a href="https://github.com/python-docs-translations/dashboard/">on GitHub</a>.<br/>
44-
You can download the data on this page in <a href="https://raw.githubusercontent.com/python-docs-translations/dashboard/refs/heads/gh-pages/index.json">JSON format</a>.
45-
</p>
42+
</div>
43+
<p style="text-align: center;">
44+
Last updated {{ generation_time.strftime("on %A %-d %B %Y at %-H:%M:%S %Z") }} (in {{ duration // 60 }} minutes and {{ duration % 60 }} seconds).
45+
<br />
46+
You can find the scripts used to generate this website <a href="https://github.com/python-docs-translations/dashboard/">on GitHub</a>.
47+
<br />
48+
You can download the data on this page in <a href="https://raw.githubusercontent.com/python-docs-translations/dashboard/refs/heads/gh-pages/index.json">JSON format</a>.
49+
</p>
4650
{% endblock %}
4751
{% block extrascript %}
48-
<script>
52+
<script>
4953
function updateProgressBarVisibility() {
5054
document.querySelectorAll('.main-bar').forEach(progressBar => {
5155
const barWithOverflowWidth = progressBar.scrollWidth;
@@ -62,5 +66,5 @@
6266
updateProgressBarVisibility();
6367
6468
window.addEventListener('resize', updateProgressBarVisibility);
65-
</script>
69+
</script>
6670
{% endblock %}

0 commit comments

Comments
 (0)