-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtemplate.html.jinja
80 lines (77 loc) · 2.86 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
74
75
76
77
78
79
80
<html lang="en">
<head>
<title>Python Docs Translation Dashboard</title>
<link rel="stylesheet" href="style.css">
<meta charset="UTF-8">
</head>
<body>
<h1>Python Docs Translation Dashboard</h1>
<table>
<thead>
<tr>
<th>language</th>
<th>contribute</th>
<th>build</th>
<th>visitors*</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">{{ project.language.name }} ({{ project.language.code }})</td>
<td data-label="contribute">
{% if project.contribution_link %}<a href="{{ project.contribution_link }}" target="_blank">{% endif %}
{% if project.uses_platform %}platform{% else %}repository{% endif %}
{% if project.contribution_link %}</a>{% endif %}
</td>
<td data-label="build">
{% if project.built %}
<a href="https://docs.python.org/{{ project.language.code }}/" target="_blank">✓{% if project.in_switcher %} in switcher{% endif %}</a>
{% else %}
✗
{% endif %}
</td>
<td data-label="visitors">
{% if project.built %}
<a href="https://plausible.io/docs.python.org?filters=((contains,page,(/{{ project.language.code }}/)))" target="_blank">
{{ '{:,}'.format(project.visitors) }}
</a>
{% else %}
{{ '{:,}'.format(project.visitors) }}
{% 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 }}%;">{{ "{:.2f}".format(project.completion) }}%</div>
<div class="progress-bar-outer-label">{{ "{:.2f}".format(project.completion) }}%</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<p>* sum of <a href="https://plausible.io/data-policy#how-we-count-unique-users-without-cookies" target="_blank">daily unique visitors</a> since 8 June 2024</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>