diff options
author | Eric Wong <e@80x24.org> | 2019-01-04 22:05:51 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-04-22 02:34:37 +0000 |
commit | a99c866cc8ef91ea366f536cc3125ed4647c6d79 (patch) | |
tree | e2ef2b18be41446e4c29feb6c8c7542e6041aa3a | |
parent | 7c692e6137697de8a8473c4de5c3de4fb03a2989 (diff) | |
download | cgit-a99c866cc8ef91ea366f536cc3125ed4647c6d79.tar.gz |
ui-{tree,repolist}: improve button spacing for browsers w/o CSS
For browsers on low-end machines running browsers without CSS support, the default tree view displayed "logplain" when it should be "log plain". Stop relying on CSS and add a space in between elements to improve accessibility.
-rw-r--r-- | cgit.css | 1 | ||||
-rw-r--r-- | ui-repolist.c | 2 | ||||
-rw-r--r-- | ui-tree.c | 12 |
3 files changed, 11 insertions, 4 deletions
@@ -575,7 +575,6 @@ div#cgit table.list td.reposection { div#cgit a.button { font-size: 80%; - padding: 0em 0.5em; } div#cgit a.primary { diff --git a/ui-repolist.c b/ui-repolist.c index 41424c0..6187101 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -353,8 +353,10 @@ void cgit_print_repolist(void) if (ctx.cfg.enable_index_links) { html("<td>"); cgit_summary_link("summary", NULL, "button", NULL); + html(" "); cgit_log_link("log", NULL, "button", NULL, NULL, NULL, 0, NULL, NULL, ctx.qry.showmsg, 0); + html(" "); cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); html("</td>"); } @@ -245,15 +245,21 @@ static int ls_item(const struct object_id *oid, struct strbuf *base, cgit_log_link("log", NULL, "button", ctx.qry.head, walk_tree_ctx->curr_rev, fullpath.buf, 0, NULL, NULL, ctx.qry.showmsg, 0); - if (ctx.repo->max_stats) + if (ctx.repo->max_stats) { + html(" "); cgit_stats_link("stats", NULL, "button", ctx.qry.head, fullpath.buf); - if (!S_ISGITLINK(mode)) + } + if (!S_ISGITLINK(mode)) { + html(" "); cgit_plain_link("plain", NULL, "button", ctx.qry.head, walk_tree_ctx->curr_rev, fullpath.buf); - if (!S_ISDIR(mode) && ctx.cfg.enable_blame) + } + if (!S_ISDIR(mode) && ctx.cfg.enable_blame) { + html(" "); cgit_blame_link("blame", NULL, "button", ctx.qry.head, walk_tree_ctx->curr_rev, fullpath.buf); + } html("</td></tr>\n"); free(name); strbuf_release(&fullpath); |