Skip to content

Commit 0636971

Browse files
committed
Resolve changes from review
1 parent 1c79b93 commit 0636971

File tree

2 files changed

+40
-42
lines changed

2 files changed

+40
-42
lines changed

src/templates.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,5 @@ pub fn get_pending_build(pr: &PullRequestModel) -> Option<&BuildModel> {
7979
{
8080
return Some(auto_build);
8181
}
82-
83-
if let Some(try_build) = &pr.try_build
84-
&& try_build.status == BuildStatus::Pending
85-
{
86-
return Some(try_build);
87-
}
8882
None
8983
}

templates/queue.html

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
<link rel="stylesheet" href="https://cdn.datatables.net/rowgroup/1.5.1/css/rowGroup.dataTables.min.css" />
88
<style>
99
@keyframes barber-pole {
10-
/* This animation is used to make the status indicator next to
11-
pending pulls look like a barber poll. We do that with a
12-
diagonal linear gradient. CSS does not allow us to animate a
13-
gradient, so instead we make the indicator a little taller
14-
than shown, and then animate the whole thing upward. */
15-
from{
16-
transform: translate(0, 0);
17-
}
18-
to {
19-
/* The magic number 11.314 is sqrt(8^2 + 8^2), based on how
20-
far vertically it takes to repeat a 45 degree gradient
21-
that is 8 pixels long before it repeats. */
22-
transform: translate(0, -11.314px);
23-
}
10+
/* This animation is used to make the status indicator next to
11+
pending pulls look like a barber poll. We do that with a
12+
diagonal linear gradient. CSS does not allow us to animate a
13+
gradient, so instead we make the indicator a little taller
14+
than shown, and then animate the whole thing upward. */
15+
from{
16+
transform: translate(0, 0);
17+
}
18+
to {
19+
/* The magic number 11.314 is sqrt(8^2 + 8^2), based on how
20+
far vertically it takes to repeat a 45 degree gradient
21+
that is 8 pixels long before it repeats. */
22+
transform: translate(0, -11.314px);
23+
}
2424
}
2525
main {
2626
max-width: 100rem;
@@ -51,28 +51,28 @@
5151
width: 2.5rem;
5252
}
5353
table.dataTable > tbody > tr > td.status {
54-
position: relative;
55-
overflow: hidden;
56-
padding-left: 16px;
57-
white-space: nowrap;
54+
position: relative;
55+
overflow: hidden;
56+
padding-left: 16px;
57+
white-space: nowrap;
5858
}
5959
td.status:before {
60-
content: " ";
61-
position: absolute;
62-
display: block;
63-
left: 6px;
64-
width: 6px;
65-
top: 0;
66-
bottom: 0;
60+
content: " ";
61+
position: absolute;
62+
display: block;
63+
left: 6px;
64+
width: 6px;
65+
top: 0;
66+
bottom: 0;
6767
}
6868
td.status[data-status="pending"]:before {
69-
/* Give the pending state a little bit of animation to make it
70-
clear that these items are the ones that are being tested
71-
right now. */
72-
bottom: -20px;
73-
background-color: #F0DE57;
74-
background-image: repeating-linear-gradient(135deg, #F0DE57 0, #F0DE57 4px, #FBEE97 4px, #FBEE97 8px, #F0DE57 0);
75-
animation: barber-pole 1s linear infinite;
69+
/* Give the pending state a little bit of animation to make it
70+
clear that these items are the ones that are being tested
71+
right now. */
72+
bottom: -20px;
73+
background-color: #F0DE57;
74+
background-image: repeating-linear-gradient(135deg, #F0DE57 0, #F0DE57 4px, #FBEE97 4px, #FBEE97 8px, #F0DE57 0);
75+
animation: barber-pole 1s linear infinite;
7676
}
7777

7878
#rollupModal {
@@ -156,9 +156,9 @@ <h1>
156156
</td>
157157
{% let pending_build = crate::templates::get_pending_build(pr) %}
158158
<td class="status" data-status="{{ crate::templates::status_text(pr) }}"
159-
data-created-at="{% if let Some(build) = pending_build %}
160-
{{ build.created_at.timestamp_millis() }}
161-
{% endif %}">
159+
{% if let Some(build) = pending_build %}
160+
data-created-at="{{ build.created_at.timestamp_millis() }}"
161+
{% endif %}>
162162

163163
{% if let Some(try_build) = pr.try_build %}
164164
<a href="../results/{{ repo_name }}/{{ pr.number }}">{{ crate::templates::status_text(pr) }}</a> (try)
@@ -423,6 +423,9 @@ <h1>
423423
}
424424

425425
if (minutes > 0) {
426+
if (output.length > 0) {
427+
output += ' ';
428+
}
426429
output += `${minutes}m`;
427430
}
428431
if (output.length > 0) {
@@ -434,7 +437,7 @@ <h1>
434437
function updateElapsedTimes() {
435438
const now = Date.now();
436439
document.querySelectorAll('[data-created-at]').forEach(td => {
437-
const createdAtMs = parseInt(td.getAttribute('data-created-at'), 10);
440+
const createdAtMs = parseInt(td.dataset.createdAt, 10);
438441
if (createdAtMs > 0) {
439442
const elapsedMs = now - createdAtMs;
440443
const formattedTime = formatElapsedTime(elapsedMs);
@@ -445,5 +448,6 @@ <h1>
445448
}
446449

447450
updateElapsedTimes();
451+
setInterval(updateElapsedTimes, 1000);
448452
</script>
449453
{% endblock %}

0 commit comments

Comments
 (0)