summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2023-06-28 23:55:18 -0700
committeriximeow <me@iximeow.net>2023-06-28 23:55:18 -0700
commit72567a7932b800e6eb851cafb385486b9817092b (patch)
tree7b9e2f0390320368fb0f59ee469d221cf5c3935c
parent27cdad3802138099749d927fb17283d2d713701a (diff)
color differentiation in per-repo build lists
-rw-r--r--src/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 5713d08..06a914e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -629,6 +629,8 @@ async fn handle_repo_summary(Path(path): Path<String>, State(ctx): State<Webserv
}
response.push_str("</tr>\n");
+ let mut row_num = 0;
+
for job in last_builds.iter().take(10) {
let job_commit = ctx.dbctx.commit_sha(job.commit_id).expect("job has a commit");
let commit_html = match commit_url(&job, &job_commit, &ctx.dbctx) {
@@ -687,9 +689,12 @@ async fn handle_repo_summary(Path(path): Path<String>, State(ctx): State<Webserv
row_html.push_str(&format!("<td class='row-item'>{}</td>", entry));
}
- response.push_str("<tr>");
+ let row_index = row_num % 2;
+ response.push_str(&format!("<tr class=\"{}\">", ["even-row", "odd-row"][row_index]));
response.push_str(&row_html);
response.push_str("</tr>\n");
+
+ row_num += 1;
}
response.push_str("</html>");