diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Let the listings wrap and the diff tables scroll
Diffstat (limited to '')
-rw-r--r--assets/cgit.css29
-rw-r--r--source/ui-diff.c2
-rw-r--r--source/ui-empty.c4
-rw-r--r--source/ui-log.c2
-rw-r--r--source/ui-refs.c2
-rw-r--r--source/ui-repolist.c2
-rw-r--r--source/ui-summary.c4
-rw-r--r--source/ui-tag.c2
8 files changed, 29 insertions, 18 deletions
diff --git a/assets/cgit.css b/assets/cgit.css
index 3161102..6c1ada4 100644
--- a/assets/cgit.css
+++ b/assets/cgit.css
@@ -271,6 +271,9 @@ div#cgit #header h1.main {
font-size: 250%;
font-weight: normal;
white-space: nowrap;
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
div#cgit #header h1.main a {
@@ -436,6 +439,16 @@ div#cgit table.list td {
padding: 0.3em 0.6em 0.3em 0.6em;
}
+div#cgit table.list td.col-author,
+div#cgit table.list td.col-count,
+div#cgit table.list td.col-links {
+ white-space: nowrap;
+}
+
+div#cgit table.list td.clone-url {
+ overflow-wrap: anywhere;
+}
+
div#cgit table.list td.commitgraph {
font-family: var(--font-mono);
white-space: pre;
@@ -839,10 +852,6 @@ div#cgit table.bin-blob td {
/* Commit / tag */
-div#cgit table.nowrap td {
- white-space: nowrap;
-}
-
div#cgit table.commit-info {
border-collapse: collapse;
margin-top: 1.5em;
@@ -885,7 +894,6 @@ div#cgit table.commit-info th {
div#cgit table.commit-info td {
font-weight: normal;
padding: 0.1em 1em 0.1em 0.1em;
- overflow-wrap: anywhere;
}
div#cgit div.commit-subject {
@@ -1000,6 +1008,12 @@ div#cgit div.diffstat-summary {
/* Unified diff */
+/* A scroll box beside the options float would shrink to fit the gap. */
+div#cgit div.diff-scroll {
+ clear: right;
+ overflow-x: auto;
+}
+
div#cgit table.diff {
width: 100%;
}
@@ -1427,7 +1441,6 @@ div#cgit table.ssdiff td.space div {
div#cgit #header h1.main {
white-space: normal;
overflow-wrap: anywhere;
- min-width: 0;
font-size: 190%;
}
@@ -1453,10 +1466,6 @@ div#cgit table.ssdiff td.space div {
div#cgit table.commit-info {
width: 100%;
}
-
- div#cgit table.nowrap td {
- white-space: normal;
- }
}
@media (max-width: 380px) {
diff --git a/source/ui-diff.c b/source/ui-diff.c
index 09e2790..f0ad58a 100644
--- a/source/ui-diff.c
+++ b/source/ui-diff.c
@@ -707,6 +707,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
return;
}
+ html("<div class='diff-scroll'>");
if (use_ssdiff) {
html("<table summary='ssdiff' class='ssdiff'>");
} else {
@@ -727,6 +728,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
if (!use_ssdiff)
html("</td></tr>");
html("</table>");
+ html("</div>");
if (show_ctrls)
cgit_print_layout_end();
diff --git a/source/ui-empty.c b/source/ui-empty.c
index 56ca6e1..b5f90fc 100644
--- a/source/ui-empty.c
+++ b/source/ui-empty.c
@@ -13,7 +13,7 @@
static void print_clone_url(const char *url)
{
- html("<tr><td><a rel='vcs-git' href='");
+ html("<tr><td class='clone-url'><a rel='vcs-git' href='");
html_url_path(url);
html("' title='");
html_attr(ctx.repo->name);
@@ -35,7 +35,7 @@ void cgit_print_empty_repo(void)
if (!ctx.repo->clone_url && !ctx.cfg.clone_prefix)
return;
- html("<table summary='clone urls' class='list nowrap'>");
+ html("<table summary='clone urls' class='list'>");
html("<tr class='nohover'><th class='left'>Clone</th></tr>\n");
cgit_add_clone_urls(print_clone_url);
html("</table>\n");
diff --git a/source/ui-log.c b/source/ui-log.c
index f80ed16..4bd17fa 100644
--- a/source/ui-log.c
+++ b/source/ui-log.c
@@ -536,7 +536,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep,
if (pager) {
cgit_print_layout_start();
- html("<table class='list nowrap'>");
+ html("<table class='list'>");
}
html("<tr class='nohover'>");
diff --git a/source/ui-refs.c b/source/ui-refs.c
index d179cdf..9897839 100644
--- a/source/ui-refs.c
+++ b/source/ui-refs.c
@@ -332,7 +332,7 @@ void cgit_print_tags(int maxcount)
void cgit_print_refs(void)
{
cgit_print_layout_start();
- html("<table class='list nowrap'>");
+ html("<table class='list'>");
if (ctx.qry.path && starts_with(ctx.qry.path, "heads"))
print_branches_page(ctx.cfg.max_ref_count);
diff --git a/source/ui-repolist.c b/source/ui-repolist.c
index 3bdae37..e9e710e 100644
--- a/source/ui-repolist.c
+++ b/source/ui-repolist.c
@@ -420,7 +420,7 @@ void cgit_print_repolist(void)
sort_repolist("section");
currenturl = cgit_currenturl();
- html("<table class='list nowrap repolist'>");
+ html("<table class='list repolist'>");
for (i = 0; i < cgit_repolist.count; i++) {
char *section;
diff --git a/source/ui-summary.c b/source/ui-summary.c
index ada6b1b..edcbc85 100644
--- a/source/ui-summary.c
+++ b/source/ui-summary.c
@@ -48,7 +48,7 @@ static void print_clone_url(const char *url)
htmlf("<tr class='nohover'><th class='left' colspan='%d'>Clone</th></tr>\n", columns);
}
- htmlf("<tr><td colspan='%d'><a rel='vcs-git' href='", columns);
+ htmlf("<tr><td colspan='%d' class='clone-url'><a rel='vcs-git' href='", columns);
html_url_path(url);
html("' title='");
html_attr(ctx.repo->name);
@@ -117,7 +117,7 @@ void cgit_print_summary(void)
int columns = log_columns();
cgit_print_layout_start();
- html("<table summary='repository info' class='list nowrap'>");
+ html("<table summary='repository info' class='list'>");
cgit_print_branches(ctx.cfg.summary_branches);
htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
cgit_print_tags(ctx.cfg.summary_tags);
diff --git a/source/ui-tag.c b/source/ui-tag.c
index d09ff2b..c384f91 100644
--- a/source/ui-tag.c
+++ b/source/ui-tag.c
@@ -73,7 +73,7 @@ static void print_annotated_tag(const char *revname,
html("<table class='commit-info'>\n");
html("<tr><td>tag name</td><td>");
html_txt(revname);
- htmlf(" (%s)</td></tr>\n", oid_to_hex(oid));
+ htmlf(" (<span class='oid'>%s</span>)</td></tr>\n", oid_to_hex(oid));
if (info->tagger_date > 0) {
html("<tr><td>tag date</td><td>");
html_txt(show_date(info->tagger_date, info->tagger_tz,