diff options
| Commit | 2384fa99a62615c88884d5e0ab7f921f14500646 (patch) | |
|---|---|---|
| Author | 2026-09-27 22:04:58 +0300 | |
| Committer | 2026-09-27 22:16:27 +0300 | |
| Files | f5ff1fcd6df2aa0fa78e2a71fda63e82c88cb7e5 | |
| cgit-2384fa99a62615c88884d5e0ab7f921f14500646.tar cgit-2384fa99a62615c88884d5e0ab7f921f14500646.tar.gz cgit-2384fa99a62615c88884d5e0ab7f921f14500646.zip | ||
| Parent | b2c665a5ebe44c35befc88bb09b0fe1cbdfd904b (diff) | |
html: Improve navigation compatibility
Primarily adds spaces between different links to make navigation when
CSS is not available easier
3 files changed, 25 insertions, 6 deletions
| -rw-r--r-- | ui-log.c | 6 | ||||
| -rw-r--r-- | ui-shared.c | 16 | ||||
| -rw-r--r-- | ui-tree.c | 9 |
@@ -65,7 +65,7 @@ void show_commit_decorations(struct commit *commit) deco = get_name_decoration(&commit->object); if (!deco) return; - html("<span class='decoration'>"); + html("<span class='decoration'> "); while (deco) { struct object_id oid_tag, peeled; int is_annotated = 0; @@ -80,12 +80,14 @@ void show_commit_decorations(struct commit *commit) cgit_log_link(buf, NULL, "branch-deco", buf, NULL, ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg, 0); + html(" "); break; case DECORATION_REF_TAG: if (!refs_read_ref(get_main_ref_store(the_repository), deco->name, &oid_tag) && !peel_object(the_repository, &oid_tag, &peeled, PEEL_OBJECT_VERIFY_TAGGED_OBJECT_TYPE)) is_annotated = !oideq(&oid_tag, &peeled); cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf); + html(" "); break; case DECORATION_REF_REMOTE: if (!ctx.repo->enable_remote_branches) @@ -94,11 +96,13 @@ void show_commit_decorations(struct commit *commit) oid_to_hex(&commit->object.oid), ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg, 0); + html(" "); break; default: cgit_commit_link(buf, NULL, "deco", ctx.qry.head, oid_to_hex(&commit->object.oid), ctx.qry.vpath); + html(" "); break; } deco = deco->next; diff --git a/ui-shared.c b/ui-shared.c index 44794d8..5b1273c 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -821,6 +821,7 @@ void cgit_print_docstart(void) htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version); if (ctx.cfg.robots && *ctx.cfg.robots) htmlf("<meta name='robots' content='%s'/>\n", ctx.cfg.robots); + html("<meta id='viewport' name='viewport' content='width=device-width initial-scale=1'/>\n"); if (ctx.cfg.css.items) for_each_string_list(&ctx.cfg.css, emit_css_link, NULL); @@ -1001,7 +1002,7 @@ static void cgit_print_path_crumbs(char *path) if (!(q = strchr(p, '/')) || levels > 15) q = end; *q = '\0'; - html_txt("/"); + html_txt(" / "); cgit_self_link(p, NULL, NULL); if (q < end) *q = '/'; @@ -1086,30 +1087,39 @@ void cgit_print_pageheader(void) html("<table class='tabs'><tr><td>\n"); if (ctx.env.authenticated && ctx.repo) { - if (ctx.repo->readme.nr) + if (ctx.repo->readme.nr) { reporevlink("about", "about", NULL, hc("about"), ctx.qry.head, NULL, NULL); + html(" "); + } cgit_summary_link("summary", NULL, hc("summary"), ctx.qry.head); + html(" "); cgit_refs_link("refs", NULL, hc("refs"), ctx.qry.head, ctx.qry.oid, NULL); + html(" "); cgit_log_link("log", NULL, hc("log"), ctx.qry.head, NULL, ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg, ctx.qry.follow); + html(" "); if (ctx.qry.page && !strcmp(ctx.qry.page, "blame")) cgit_blame_link("blame", NULL, hc("blame"), ctx.qry.head, ctx.qry.oid, ctx.qry.vpath); else cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head, ctx.qry.oid, ctx.qry.vpath); + html(" "); cgit_commit_link("commit", NULL, hc("commit"), ctx.qry.head, ctx.qry.oid, ctx.qry.vpath); + html(" "); cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head, ctx.qry.oid, ctx.qry.oid2, ctx.qry.vpath); - if (ctx.repo->max_stats) + if (ctx.repo->max_stats) { + html(" "); cgit_stats_link("stats", NULL, hc("stats"), ctx.qry.head, ctx.qry.vpath); + } if (ctx.repo->homepage) { html("<a href='"); html_attr(ctx.repo->homepage); @@ -273,12 +273,17 @@ 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) + html(" "); + if (ctx.repo->max_stats) { cgit_stats_link("stats", NULL, "button", ctx.qry.head, fullpath.buf); - if (!S_ISGITLINK(mode)) + html(" "); + } + if (!S_ISGITLINK(mode)) { cgit_plain_link("plain", NULL, "button", ctx.qry.head, walk_tree_ctx->curr_rev, fullpath.buf); + html(" "); + } if (!S_ISDIR(mode) && ctx.repo->enable_blame) cgit_blame_link("blame", NULL, "button", ctx.qry.head, walk_tree_ctx->curr_rev, fullpath.buf); |
