diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Keep the hash rows out of the column widths
Diffstat (limited to 'source')
-rw-r--r--source/ui-commit.c18
1 file changed, 10 insertions, 8 deletions
diff --git a/source/ui-commit.c b/source/ui-commit.c
index ba079a0..80c7faf 100644
--- a/source/ui-commit.c
+++ b/source/ui-commit.c
@@ -61,14 +61,14 @@ static int print_parent_rows(struct commit *commit, const char *rev, const char
html("</td></tr>\n");
continue;
}
- html("<tr><th>parent</th><td colspan='2' class='oid'>");
+ html("<tr><th>parent</th><td colspan='2' class='oid'><div class='spanning'>");
parent_hex = label = oid_to_hex(&p->item->object.oid);
if (ctx.repo->enable_subject_links)
label = cgit_parse_commit(parent)->subject;
cgit_commit_link(label, NULL, NULL, ctx.qry.head, parent_hex, prefix);
html(" (");
cgit_diff_link("diff", NULL, NULL, ctx.qry.head, rev, oid_to_hex(&p->item->object.oid), prefix);
- html(")</td></tr>\n");
+ html(")</div></td></tr>\n");
parents++;
}
return parents;
@@ -260,18 +260,20 @@ void cgit_print_commit(char *hex, const char *prefix)
print_ident_row("committer", info->committer, info->committer_email,
info->committer_date, info->committer_tz);
- html("<tr><th>commit</th><td colspan='2' class='oid'>");
+ // The spanning cells are kept out of the column widths, so a hash row
+ // never pushes the dates away from the names above it.
+ html("<tr><th>commit</th><td colspan='2' class='oid'><div class='spanning'>");
commit_hex = oid_to_hex(&commit->object.oid);
cgit_commit_link(commit_hex, NULL, NULL, ctx.qry.head, commit_hex, prefix);
html(" (");
cgit_patch_link("patch", NULL, NULL, NULL, commit_hex, prefix);
- html(")</td></tr>\n");
+ html(")</div></td></tr>\n");
// The parent rows follow the commit row so the commit hashes sit
// together, leaving the tree beside the download links.
parents = print_parent_rows(commit, hex, prefix);
- html("<tr><th>tree</th><td colspan='2' class='oid'>");
+ html("<tr><th>tree</th><td colspan='2' class='oid'><div class='spanning'>");
tree_rev = xstrdup(hex);
cgit_tree_link(oid_to_hex(get_commit_tree_oid(commit)), NULL, NULL, ctx.qry.head, tree_rev, NULL);
if (prefix) {
@@ -279,12 +281,12 @@ void cgit_print_commit(char *hex, const char *prefix)
cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tree_rev, prefix);
}
free(tree_rev);
- html("</td></tr>\n");
+ html("</div></td></tr>\n");
if (ctx.repo->snapshots) {
- html("<tr><th>download</th><td colspan='2' class='oid'>");
+ html("<tr><th>download</th><td colspan='2' class='oid'><div class='spanning'>");
cgit_print_snapshot_links(ctx.repo, hex, "<br>");
- html("</td></tr>\n");
+ html("</div></td></tr>\n");
}
html("</table>\n");