about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorEric Wong2019-01-04 22:23:24 +0000
committerJune McEnroe2022-02-13 11:55:35 -0500
commit2d4c893dbdfea6a5ccefa75017113d45b33f2c43 (patch)
tree81036c21a04b42d38c59274043fb22e84174bb10
parentImprove decoration display for browsers without CSS (diff)
downloadcgit-2d4c893dbdfea6a5ccefa75017113d45b33f2c43.tar.gz
cgit-2d4c893dbdfea6a5ccefa75017113d45b33f2c43.zip
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.css1
-rw-r--r--ui-repolist.c2
-rw-r--r--ui-tree.c12
3 files changed, 11 insertions, 4 deletions
diff --git a/cgit.css b/cgit.css index b88db61..dac791b 100644 --- a/cgit.css +++ b/cgit.css
@@ -576,7 +576,6 @@ div#cgit table.list td.reposection {
576 576
577div#cgit a.button { 577div#cgit a.button {
578 font-size: 80%; 578 font-size: 80%;
579 padding: 0em 0.5em;
580} 579}
581 580
582div#cgit a.primary { 581div#cgit a.primary {
diff --git a/ui-repolist.c b/ui-repolist.c index 529a203..591929b 100644 --- a/ui-repolist.c +++ b/ui-repolist.c
@@ -353,8 +353,10 @@ void cgit_print_repolist(void)
353 if (ctx.cfg.enable_index_links) { 353 if (ctx.cfg.enable_index_links) {
354 html("<td>"); 354 html("<td>");
355 cgit_summary_link("summary", NULL, "button", NULL); 355 cgit_summary_link("summary", NULL, "button", NULL);
356 html(" ");
356 cgit_log_link("log", NULL, "button", NULL, NULL, NULL, 357 cgit_log_link("log", NULL, "button", NULL, NULL, NULL,
357 0, NULL, NULL, ctx.qry.showmsg, 0); 358 0, NULL, NULL, ctx.qry.showmsg, 0);
359 html(" ");
358 cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); 360 cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL);
359 html("</td>"); 361 html("</td>");
360 } 362 }
diff --git a/ui-tree.c b/ui-tree.c index 438b001..34e7e63 100644 --- a/ui-tree.c +++ b/ui-tree.c
@@ -263,15 +263,21 @@ static int ls_item(const struct object_id *oid, struct strbuf *base,
263 cgit_log_link("log", NULL, "button", ctx.qry.head, 263 cgit_log_link("log", NULL, "button", ctx.qry.head,
264 walk_tree_ctx->curr_rev, fullpath.buf, 0, NULL, NULL, 264 walk_tree_ctx->curr_rev, fullpath.buf, 0, NULL, NULL,
265 ctx.qry.showmsg, 0); 265 ctx.qry.showmsg, 0);
266 if (ctx.repo->max_stats) 266 if (ctx.repo->max_stats) {
267 html(" ");
267 cgit_stats_link("stats", NULL, "button", ctx.qry.head, 268 cgit_stats_link("stats", NULL, "button", ctx.qry.head,
268 fullpath.buf); 269 fullpath.buf);
269 if (!S_ISGITLINK(mode)) 270 }
271 if (!S_ISGITLINK(mode)) {
272 html(" ");
270 cgit_plain_link("plain", NULL, "button", ctx.qry.head, 273 cgit_plain_link("plain", NULL, "button", ctx.qry.head,
271 walk_tree_ctx->curr_rev, fullpath.buf); 274 walk_tree_ctx->curr_rev, fullpath.buf);
272 if (!S_ISDIR(mode) && ctx.repo->enable_blame) 275 }
276 if (!S_ISDIR(mode) && ctx.repo->enable_blame) {
277 html(" ");
273 cgit_blame_link("blame", NULL, "button", ctx.qry.head, 278 cgit_blame_link("blame", NULL, "button", ctx.qry.head,
274 walk_tree_ctx->curr_rev, fullpath.buf); 279 walk_tree_ctx->curr_rev, fullpath.buf);
280 }
275 html("</td></tr>\n"); 281 html("</td></tr>\n");
276 282
277cleanup: 283cleanup: