-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtemplate.html.jinja
73 lines (70 loc) · 2.78 KB
/
template.html.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<html lang="en">
<head>
<title>Python Docs Translation Dashboard</title>
<link rel="stylesheet" href="style.css">
<meta charset="UTF-8">
<meta name="description" content="Python Docs Translation Dashboard">
</head>
<body>
<h1>Python Docs Translation Dashboard</h1>
<table>
<thead>
<tr>
<th>language</th>
<th>switcher</th>
<th>translators</th>
<th>completion*</th>
</tr>
</thead>
<tbody>
{% for project in completion_progress | sort(attribute='completion,translators.number') | reverse %}
<tr>
<td data-label="language">
<a href="{{ project.contribution_link }}" target="_blank">{{ project.language.name }} ({{ project.language.code }})</a>
</td>
<td data-label="build">
{% if project.in_switcher %}
<a href="https://docs.python.org/{{ project.language.code }}/" target="_blank">✓</a>
{% elif project.built %}
<a href="https://docs.python.org/{{ project.language.code }}/" target="_blank">✗</a>
{% endif %}
</td>
<td data-label="translators">
{% if project.translators.link %}<a href="{{ project.translators.link }}" target="_blank">{% endif %}
{{ project.translators.number }}
{% if project.translators.link %}</a>{% endif %}
</td>
<td data-label="completion">
<div class="progress-bar"
style="width: {{ project.completion }}%;{% if project.change %}background: linear-gradient(to left, #94cf96 {{ project.change * 100 / project.completion }}%, #4caf50 {{ project.change * 100 / project.completion }}%);{% else %}background-color: #4caf50;{% endif %}"
>
{{ '{:.2f}%'.format(project.completion) }} {% if project.change > 0 %}({{ '{:+.2f}%'.format(project.change) }}){% endif %}
</div>
<div class="progress-bar-outer-label">
{{ '{:.2f}%'.format(project.completion) }} {% if project.change > 0 %}({{ '{:+.2f}%'.format(project.change) }}){% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<p>* the number in parentheses shows change in the last 30 days, included in the total completion</p>
<p>For more information about translations, see the <a href="https://devguide.python.org/documentation/translating/" target="_blank">Python Developer’s Guide</a>.</p>
<p>Last updated at {{ generation_time.strftime('%A, %-d %B %Y, %-H:%M:%S %Z') }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes).</p>
</body>
<script>
function updateProgressBarVisibility() {
document.querySelectorAll('.progress-bar').forEach(progressBar => {
const textWidth = progressBar.scrollWidth;
const barWidth = progressBar.offsetWidth;
if (barWidth < textWidth) {
progressBar.classList.add('low');
} else {
progressBar.classList.remove('low');
}
});
}
updateProgressBarVisibility();
window.addEventListener('resize', updateProgressBarVisibility);
</script>
</html>