-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtemplate.html.jinja
More file actions
76 lines (73 loc) · 3.82 KB
/
template.html.jinja
File metadata and controls
76 lines (73 loc) · 3.82 KB
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
<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">
<base target="_blank">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-LN+7fdVzj6u52u30Kp6M/trliBMCMKTyK833zpbD+pXdCLuTusPj697FH4R/5mcr" crossorigin="anonymous">
</head>
<body class="container">
<h1>Python Docs Translation Dashboard</h1>
<nav class="switchpages">
main | <a href="metadata.html" target="_self">meta</a>
</nav>
<div class="row row-cols-1 row-cols-md-4 g-4">
{% for project in completion_progress | sort(attribute='completion,translators.number') | reverse %}
<div class="col">
<div class="card">
<div class="card-body">
<h5>{{ project.language.name }} ({{ project.language.code }})</h5>
<p>translators: {% if project.translators.link %}<a href="{{ project.translators.link }}">
{{ project.translators.number }}</a>{% else %}
{{ project.translators.number }}{% endif %}</p>
<div 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.01 %}({{ '{:+.2f}%'.format(project.change) }}){% endif %}
</div>
<div class="progress-bar-outer-label">
{{ '{:.2f}%'.format(project.completion) }} {% if project.change >= 0.01 %}({{ '{:+.2f}%'.format(project.change) }}){% endif %}
</div>
</div>
{% if project.built %}
<a href="https://docs.python.org/{{ project.language.code }}/" class="btn btn-outline-secondary">Read</a>
{% else %}
<button type="button" class="btn btn-outline-secondary" disabled>Read</button>
{% endif %}
<a href="{{ project.contribution_link }}" class="btn btn-outline-primary">Contribute</a>
</div>
</div>
</div>
{% endfor %}
</div>
<p>* the number in parentheses shows change in the last 30 days, included in the total completion</p>
<p>
Currently being translated into {{ completion_progress|length }} languages.
The documentation has a total word count of {{ '{:,}'.format(word_count) }}.
For more information about translations, see the <a href="https://devguide.python.org/documentation/translating/">Python Developer’s Guide</a>.
</p>
<hr>
<p>You can download the data on this page in <a href="https://github.com/python-docs-translations/dashboard/blob/gh-pages/index.json">JSON format</a>.</p>
<p>You can also find the scripts used to generate these pages <a href="https://github.com/python-docs-translations/dashboard">here</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>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js" integrity="sha384-ndDqU0Gzau9qJ1lfW4pNLlhNTkCfHzAVBReH9diLvGRem5+R9g2FzA8ZGN954O5Q" crossorigin="anonymous"></script>
</body>
<script>
function updateProgressBarVisibility() {
document.querySelectorAll('.progress-bar').forEach(progressBar => {
const barWithOverflowWidth = progressBar.scrollWidth;
const barWidth = progressBar.clientWidth;
if (barWidth < barWithOverflowWidth) {
progressBar.classList.add('low');
} else {
progressBar.classList.remove('low');
}
});
}
updateProgressBarVisibility();
window.addEventListener('resize', updateProgressBarVisibility);
</script>
</html>