Skip to content

Commit 7725b22

Browse files
Improve indentation in templates (#121)
1 parent 24f24ed commit 7725b22

File tree

3 files changed

+75
-65
lines changed

3 files changed

+75
-65
lines changed

src/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ a:hover {
7272
position: relative;
7373
}
7474

75-
.progress-bar-index {
75+
.progress-bar {
7676
display: inline-block;
7777
color: white;
7878
height: 100%;

templates/index.html.jinja

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
11
{% extends "base.html.jinja" %}
22

33
{% block main %}
4-
<div>
5-
<div class="row">
6-
{% for project in completion_progress | sort(attribute='completion') | reverse %}
7-
<div class="col-12 col-sm-6 col-md-4 d-flex">
8-
<div class="card shadow mb-3 w-100">
9-
<div class="card-body">
10-
<h3 class="card-title">{{ project.language.name }}</h3>
11-
<h5 class="card-subtitle mb-2 text-muted">{{ project.translated_name }}</h5>
12-
<p class="text-muted">Completion: <strong>{{ '{:.2f}%'.format(project.completion) }}</strong></p>
13-
<p class="text-muted">30-day progress: {{ '{:.2f}%'.format(project.change) }}</p>
14-
<p style="text-align: center;">
15-
{% if project.built %}
16-
<a href="https://docs.python.org/{{ project.language.code }}/3/" style="color: #1595fe;">View</a>
17-
18-
{% endif %}
19-
{% if project.contribution_link %}
20-
<a href="{{ project.contribution_link }}" style="color: #1595fe;">Contribute</a>
21-
{% elif project.uses_platform %}
22-
<a href="https://app.transifex.com/join/?o=python-doc&p=python-newest&t=opensource" style="color: #1595fe;">Contribute</a>
23-
{% else %}
24-
<a href="https://devguide.python.org/documentation/translations/translating/" style="color: #1595fe;">Contribute</a>
25-
{% endif %}
26-
</p>
27-
<div class="progress-bar-container">
28-
<div class="progress-bar-index" style="width: {{ project.completion }}%;
29-
{% if project.change %}
30-
background: linear-gradient(to left, #94cf96 {{ project.change * 100 / project.completion }}%, #4caf50 {{ project.change * 100 / project.completion }}%);
31-
{% else %}
32-
background-color: #4caf50;
33-
{% endif %}">
34-
</div>
35-
</div>
4+
<div>
5+
<div class="row">
6+
{% for project in completion_progress | sort(attribute='completion') | reverse %}
7+
<div class="col-12 col-sm-6 col-md-4 d-flex">
8+
<div class="card shadow mb-3 w-100">
9+
<div class="card-body">
10+
<h3 class="card-title">{{ project.language.name }}</h3>
11+
<h5 class="card-subtitle mb-2 text-muted">{{ project.translated_name }}</h5>
12+
<p class="text-muted">Completion: <strong>{{ '{:.2f}%'.format(project.completion) }}</strong></p>
13+
<p class="text-muted">30-day progress: {{ '{:.2f}%'.format(project.change) }}</p>
14+
15+
<p style="text-align: center;">
16+
{% if project.built %}
17+
<a href="https://docs.python.org/{{ project.language.code }}/3/" style="color: #1595fe;">View</a>
18+
19+
{% endif %}
20+
{% if project.contribution_link %}
21+
<a href="{{ project.contribution_link }}" style="color: #1595fe;">Contribute</a>
22+
{% elif project.uses_platform %}
23+
<a href="https://app.transifex.com/join/?o=python-doc&p=python-newest&t=opensource" style="color: #1595fe;">Contribute</a>
24+
{% else %}
25+
<a href="https://devguide.python.org/documentation/translations/translating/" style="color: #1595fe;">Contribute</a>
26+
{% endif %}
27+
</p>
28+
<div class="progress-bar-container">
29+
<div class="progress-bar" style="width: {{ project.completion }}%;
30+
{% if project.change %}
31+
background: linear-gradient(to left, #94cf96 {{ project.change * 100 / project.completion }}%, #4caf50 {{ project.change * 100 / project.completion }}%);
32+
{% else %}
33+
background-color: #4caf50;
34+
{% endif %}">
3635
</div>
3736
</div>
3837
</div>
39-
{% endfor %}
38+
</div>
4039
</div>
41-
</div>
40+
{% endfor %}
41+
</div>
42+
</div>
4243

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).<br/>
45-
You can find the scripts used to generate this website <a href="https://github.com/python-docs-translations/dashboard/">on GitHub</a>.<br/>
46-
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>.
47-
</p>
44+
<p style="text-align: center;">
45+
Last updated {{ generation_time.strftime('on %A %-d %B %Y at %-H:%M:%S %Z') }} (in {{ duration // 60 }} minutes and {{ duration % 60 }} seconds).<br/>
46+
You can find the scripts used to generate this website <a href="https://github.com/python-docs-translations/dashboard/">on GitHub</a>.<br/>
47+
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>.
48+
</p>
4849
{% endblock %}

templates/metadata.html.jinja

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,40 @@
22

33
{% block main %}
44
<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 metadata | sort(attribute='0.completion') | reverse %}
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 %}<a href="warnings-{{ project.language.code }}.txt">{{ metadata[0] }}</a>{% else %}{{ metadata[0] }}{% endif %}
22-
</td>
23-
<td data-label="lint">
24-
{% if project.completion %}<a href="warnings-lint-{{ project.language.code }}.txt">{{ metadata[1] }}</a>{% else %}{{ metadata[1] }}{% endif %}
25-
</td>
26-
</tr>
27-
{% endfor %}
28-
</tbody>
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 metadata | sort(attribute='0.completion') | reverse %}
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+
{% endfor %}
36+
</tbody>
2937
</table>
38+
3039
<p>* number of Sphinx build process warnings</p>
31-
<p>Last updated at {{ generation_time.strftime('%A, %-d %B %Y, %-H:%M:%S %Z') }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes).</p>
40+
<p>Last updated at {{ generation_time.strftime('%A, %-d %B %Y, %-H:%M:%S %Z') }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes).</p>
3241
{% endblock %}

0 commit comments

Comments
 (0)