Skip to content

Commit da07650

Browse files
(Hopefully final) Review
1 parent 08ff437 commit da07650

File tree

5 files changed

+11
-140
lines changed

5 files changed

+11
-140
lines changed

generate.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,9 @@ class LanguageProjectData:
120120
counts=counts,
121121
)
122122

123-
chart = env.get_template('chart.html.jinja').render(
124-
completion_progress=completion_progress,
125-
generation_time=generation_time,
126-
duration=(datetime.now(timezone.utc) - generation_time).seconds,
127-
counts=counts,
128-
)
129-
130123
Path('build/style.css').write_bytes(Path('src/style.css').read_bytes())
131124
Path('build/logo.png').write_bytes(Path('src/logo.png').read_bytes())
132125
Path('build/index.html').write_text(index)
133-
Path('build/chart.html').write_text(chart)
134126

135127
Path('build/index.json').write_text(
136128
json.dumps([asdict(project) for project in completion_progress], indent=2)

src/style.css

Lines changed: 4 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ------------------------ GLOBAL STYLES -------------------------- */
1+
/* ---------------------------- Global Styles ------------------------------- */
22

33
body {
44
padding-top: 4.5rem;
@@ -17,7 +17,7 @@ a:hover {
1717
color: #1595fe;
1818
}
1919

20-
/* --------------------------- NAVBAR ------------------------------ */
20+
/* -------------------------------- navbar ---------------------------------- */
2121

2222
.navbar {
2323
background-color: rgb(245, 245, 245, 0.6);
@@ -54,22 +54,11 @@ a:hover {
5454
}
5555

5656
.card:hover {
57-
background: linear-gradient(90deg, #cc9add 8.06%, #ebad98 106.93%);
5857
text-decoration: none;
5958
transform: scale(1.05);
6059
transition: all 0.3s ease-in-out;
6160
}
6261

63-
.card:hover .card-title,
64-
.card:hover .card-subtitle,
65-
.card:hover .card-text {
66-
color: white;
67-
}
68-
69-
.card:hover .card-link {
70-
color: rgb(231, 231, 231);
71-
}
72-
7362
@media (min-width: 768px) {
7463
.card {
7564
flex-basis: calc(33.33% - 30px);
@@ -95,7 +84,7 @@ a:hover {
9584
border-bottom-left-radius: 3px;
9685
}
9786

98-
/* ------------------------------ Tables ------------------------------------ */
87+
/* ------------------------------ Metadata ---------------------------------- */
9988

10089
table {
10190
border-collapse: collapse;
@@ -112,48 +101,9 @@ th {
112101
hr {
113102
color: #f4f4f4;
114103
}
115-
.progress-bar {
116-
display: inline-block;
117-
color: white;
118-
height: 20px;
119-
line-height: 20px;
120-
text-align: center;
121-
overflow: hidden;
122-
white-space: nowrap;
123-
box-sizing: border-box;
124-
}
125-
.progress-bar-outer-label {
126-
display: none;
127-
padding-left: .5em;
128-
height: 20px;
129-
line-height: 20px;
130-
overflow: hidden;
131-
}
132-
.progress-bar.low {
133-
color: transparent;
134-
user-select: none;
135-
}
136-
.progress-bar.low + .progress-bar-outer-label {
137-
display: inline-block;
138-
}
139-
td[data-label="translators"], td[data-label="warnings"], td[data-label="lint"] {
104+
td[data-label="warnings"], td[data-label="lint"] {
140105
text-align: right;
141106
}
142-
td[data-label="completion"] {
143-
width: 100%;
144-
line-height: 0;
145-
}
146-
.switchpages{
147-
position: absolute;
148-
top: 10px;
149-
right: 10px;
150-
}
151-
152-
@media screen and (max-width: 675px) {
153-
.switchpages{
154-
all: unset;
155-
}
156-
}
157107

158108
@media screen and (max-width: 600px) {
159109
table, thead, tbody, th, td, tr {
@@ -180,11 +130,4 @@ td[data-label="completion"] {
180130
left: 10px;
181131
position: absolute;
182132
}
183-
td[data-label="completion"] {
184-
width: inherit;
185-
}
186-
.progress-bar {
187-
min-width: 0;
188-
width: 100% !important;
189-
}
190133
}

templates/base.html.jinja

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
<head>
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7-
<meta name="description" content="">
8-
<meta name="author" content="">
7+
<meta name="description" content="Python Documentation Translation Dashboard">
98

109
<title>Python Docs Translation Dashboard</title>
1110

@@ -32,9 +31,6 @@
3231

3332
<div class="collapse navbar-collapse" id="navbarNavDropdown">
3433
<ul class="navbar-nav mr-auto">
35-
<li class="nav-item">
36-
<a class="nav-link" href="chart.html">Chart</a>
37-
</li>
3834
<li class="nav-item">
3935
<a class="nav-link" href="metadata.html">Metadata</a>
4036
</li>

templates/chart.html.jinja

Lines changed: 0 additions & 64 deletions
This file was deleted.

templates/index.html.jinja

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="card shadow mb-3 w-100">
99
<div class="card-body">
1010
<h5 class="card-subtitle text-muted">{{ project.translated_name }}</h5>
11-
<h4 class="card-title">{{ project.language.name }} ({{ project.language.code }})</h4>
11+
<h4 class="card-title">{{ project.language.name }}</h4>
1212
<h5 class="card-subtitle mb-2">Completion: <strong>{{ '{:.2f}%'.format(project.completion) }}</strong></h5>
1313
<h6 class="card-subtitle mb-2 text-muted">30 Days Progress: {{ '{:.2f}%'.format(project.change) }}</h6>
1414
<h6 class="card-subtitle mb-2 text-muted">Translators: {{ project.translators.number }}</h6>
@@ -45,5 +45,9 @@
4545
</div>
4646
</div>
4747

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

0 commit comments

Comments
 (0)