diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--assets/cgit.css10
-rw-r--r--source/ui-commit.c18
2 files changed, 20 insertions, 8 deletions
diff --git a/assets/cgit.css b/assets/cgit.css
index 462c4ae..511c377 100644
--- a/assets/cgit.css
+++ b/assets/cgit.css
@@ -821,6 +821,11 @@ div#cgit table.commit-info td {
padding: 0.1em 1em 0.1em 0.1em;
}
+div#cgit table.commit-info div.spanning {
+ width: 0;
+ white-space: nowrap;
+}
+
div#cgit div.commit-subject {
font-weight: bold;
font-size: 125%;
@@ -1375,4 +1380,9 @@ div#cgit table.ssdiff td.space {
div#cgit table.commit-info {
width: 100%;
}
+
+ div#cgit table.commit-info div.spanning {
+ width: auto;
+ white-space: normal;
+ }
}
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");