Skip to content

Commit c27d32e

Browse files
Maciek's request
1 parent 644dfd9 commit c27d32e

File tree

2 files changed

+41
-16
lines changed

2 files changed

+41
-16
lines changed

src/style.css

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ a:hover {
8383

8484
/* ------------------------------ Metadata ---------------------------------- */
8585

86-
.metadata-table {
87-
overflow-x: auto;
88-
}
8986
table {
9087
border-collapse: collapse;
9188
}
@@ -104,3 +101,31 @@ hr {
104101
td[data-label="warnings"], td[data-label="lint"] {
105102
text-align: right;
106103
}
104+
105+
@media screen and (max-width: 600px) {
106+
table, thead, tbody, th, td, tr {
107+
display: block;
108+
}
109+
th {
110+
position: absolute;
111+
top: -9999px;
112+
left: -9999px;
113+
}
114+
tr {
115+
border: 1px solid #ccc;
116+
margin-bottom: 5px;
117+
overflow-x: auto;
118+
}
119+
td {
120+
border: none;
121+
border-bottom: 1px solid #eee;
122+
padding-left: 50%;
123+
position: relative;
124+
}
125+
td:before {
126+
content: attr(data-label);
127+
font-weight: bold;
128+
left: 10px;
129+
position: absolute;
130+
}
131+
}

templates/metadata.html.jinja

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{% extends "base.html.jinja" %}
22

33
{% block main %}
4-
<div class="metadata-table">
54
<table>
65
<thead>
76
<tr>
@@ -14,21 +13,22 @@
1413
</thead>
1514
<tbody>
1615
{% for project, metadata in metadata | sort(attribute='0.completion,0.translators.number') | reverse %}
17-
<tr>
18-
<td data-label="language">{{ project.language.name }} ({{ project.language.code }})</td>
19-
<td data-label="branch">{{ project.branch }}</td>
20-
<td data-label="updated">{{ metadata[2].strftime('%Y/%m/%d %T') if metadata[2] else '' }}</td>
21-
<td data-label="warnings">
22-
{% if project.completion %}<a href="warnings-{{ project.language.code }}.txt">{{ metadata[0] }}</a>{% else %}{{ metadata[0] }}{% endif %}
23-
</td>
24-
<td data-label="lint">
25-
{% if project.completion %}<a href="warnings-lint-{{ project.language.code }}.txt">{{ metadata[1] }}</a>{% else %}{{ metadata[1] }}{% endif %}
26-
</td>
27-
</tr>
16+
{% if project.repository %}
17+
<tr>
18+
<td data-label="language">{{ project.language.name }} ({{ project.language.code }})</td>
19+
<td data-label="branch">{{ project.branch }}</td>
20+
<td data-label="updated">{{ metadata[2].strftime('%Y/%m/%d %T') if metadata[2] else '' }}</td>
21+
<td data-label="warnings">
22+
{% if project.completion %}<a href="warnings-{{ project.language.code }}.txt">{{ metadata[0] }}</a>{% else %}{{ metadata[0] }}{% endif %}
23+
</td>
24+
<td data-label="lint">
25+
{% if project.completion %}<a href="warnings-lint-{{ project.language.code }}.txt">{{ metadata[1] }}</a>{% else %}{{ metadata[1] }}{% endif %}
26+
</td>
27+
</tr>
28+
{% endif %}
2829
{% endfor %}
2930
</tbody>
3031
</table>
3132
<p>* number of Sphinx build process warnings</p>
3233
<p>Last updated at {{ generation_time.strftime('%A, %-d %B %Y, %-H:%M:%S %Z') }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes).</p>
33-
</div>
3434
{% endblock %}

0 commit comments

Comments
 (0)