Skip to content

Commit a326afd

Browse files
committed
Add buttons for expanding and collapsing all test suites
1 parent c8a882b commit a326afd

File tree

2 files changed

+84
-54
lines changed

2 files changed

+84
-54
lines changed

Diff for: src/ci/citool/templates/layout.askama

+4-53
Original file line numberDiff line numberDiff line change
@@ -3,69 +3,20 @@
33
<meta charset="UTF-8">
44
<title>Rust CI Test Dashboard</title>
55
<style>
6-
body {
6+
body {
77
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
88
line-height: 1.6;
99
max-width: 1500px;
1010
margin: 0 auto;
1111
padding: 20px;
1212
background: #F5F5F5;
13-
}
14-
15-
h1 {
16-
text-align: center;
17-
color: #333333;
18-
margin-bottom: 30px;
19-
}
20-
21-
.test-suites {
22-
background: white;
23-
border-radius: 8px;
24-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
25-
padding: 20px;
26-
}
27-
28-
ul {
29-
padding-left: 0;
30-
}
31-
32-
li {
33-
list-style: none;
34-
padding-left: 20px;
35-
}
36-
summary {
37-
margin-bottom: 5px;
38-
padding: 6px;
39-
background-color: #F4F4F4;
40-
border: 1px solid #ddd;
41-
border-radius: 4px;
42-
cursor: pointer;
43-
}
44-
summary:hover {
45-
background-color: #CFCFCF;
46-
}
47-
48-
/* Style the disclosure triangles */
49-
details > summary {
50-
list-style: none;
51-
position: relative;
52-
}
53-
54-
details > summary::before {
55-
content: "▶";
56-
position: absolute;
57-
left: -15px;
58-
transform: rotate(0);
59-
transition: transform 0.2s;
60-
}
61-
62-
details[open] > summary::before {
63-
transform: rotate(90deg);
64-
}
13+
}
14+
{% block styles %}{% endblock %}
6515
</style>
6616
</head>
6717

6818
<body>
6919
{% block content %}{% endblock %}
20+
{% block scripts %}{% endblock %}
7021
</body>
7122
</html>

Diff for: src/ci/citool/templates/test_suites.askama

+80-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<h1>Rust CI Test Dashboard</h1>
55
<div class="test-suites">
66
<div class="summary">
7-
Total tests: {{ test_count }}
7+
<span>Total tests: {{ test_count }}</span>
8+
<div>
9+
<button onclick="openAll()">Open all</button>
10+
<button onclick="closeAll()">Close all</button>
11+
</div>
812
</div>
913

1014
<ul>
@@ -16,3 +20,78 @@
1620
</ul>
1721
</div>
1822
{% endblock %}
23+
24+
{% block styles %}
25+
h1 {
26+
text-align: center;
27+
color: #333333;
28+
margin-bottom: 30px;
29+
}
30+
31+
.summary {
32+
display: flex;
33+
justify-content: space-between;
34+
}
35+
36+
.test-suites {
37+
background: white;
38+
border-radius: 8px;
39+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
40+
padding: 20px;
41+
}
42+
43+
ul {
44+
padding-left: 0;
45+
}
46+
47+
li {
48+
list-style: none;
49+
padding-left: 20px;
50+
}
51+
summary {
52+
margin-bottom: 5px;
53+
padding: 6px;
54+
background-color: #F4F4F4;
55+
border: 1px solid #ddd;
56+
border-radius: 4px;
57+
cursor: pointer;
58+
}
59+
summary:hover {
60+
background-color: #CFCFCF;
61+
}
62+
63+
/* Style the disclosure triangles */
64+
details > summary {
65+
list-style: none;
66+
position: relative;
67+
}
68+
69+
details > summary::before {
70+
content: "▶";
71+
position: absolute;
72+
left: -15px;
73+
transform: rotate(0);
74+
transition: transform 0.2s;
75+
}
76+
77+
details[open] > summary::before {
78+
transform: rotate(90deg);
79+
}
80+
{% endblock %}
81+
82+
{% block scripts %}
83+
<script type="text/javascript">
84+
function openAll() {
85+
const details = document.getElementsByTagName("details");
86+
for (const elem of details) {
87+
elem.open = true;
88+
}
89+
}
90+
function closeAll() {
91+
const details = document.getElementsByTagName("details");
92+
for (const elem of details) {
93+
elem.open = false;
94+
}
95+
}
96+
</script>
97+
{% endblock %}

0 commit comments

Comments
 (0)