From 72567a7932b800e6eb851cafb385486b9817092b Mon Sep 17 00:00:00 2001 From: iximeow Date: Wed, 28 Jun 2023 23:55:18 -0700 Subject: color differentiation in per-repo build lists --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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, State(ctx): State\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, State(ctx): State{}", entry)); } - response.push_str(""); + let row_index = row_num % 2; + response.push_str(&format!("", ["even-row", "odd-row"][row_index])); response.push_str(&row_html); response.push_str("\n"); + + row_num += 1; } response.push_str(""); -- cgit v1.1