diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Keep each snapshot link in one piece
On a narrow screen the download column broke a snapshot name at a hyphen or left its signature link alone on the next line. Each file and its signature now stay together, and a line breaks only between them.
Diffstat (limited to 'source/ui-shared.c')
-rw-r--r--source/ui-shared.c4
1 file changed, 4 insertions, 0 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c
index d1b9994..ff691f8 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -1943,6 +1943,9 @@ void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref, co
continue;
strbuf_setlen(&filename, prefixlen);
strbuf_addstr(&filename, f->suffix);
+ // A file and its signature are one unit, which the stylesheet
+ // keeps from breaking across lines.
+ html("<span class='snapshot'>");
snapshot_link(filename.buf, NULL, NULL, NULL, NULL, filename.buf);
if (cgit_snapshot_get_sig(ref, f)) {
strbuf_addstr(&filename, ".asc");
@@ -1962,6 +1965,7 @@ void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref, co
snapshot_link("sig", NULL, NULL, NULL, NULL, filename.buf);
html(")");
}
+ html("</span>");
html(separator);
}
strbuf_release(&filename);