From bd650dd4ecc96cebf067f9d716c7f597ecdb74c5 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Wed, 1 Aug 2018 11:42:15 +0100 Subject: fixed dir entries in tree view --- ui_70-tree.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/ui_70-tree.c b/ui_70-tree.c index 8509322..32fd585 100644 --- a/ui_70-tree.c +++ b/ui_70-tree.c @@ -120,10 +120,10 @@ static void write_tree_link(const struct object_id *oid, char *name, oidcpy(&tree_ctx.oid, oid); - while (tree_ctx.count == 1) { - cgit_gopher_tree_link(name, NULL, "ls-dir", ctx.qry.head, rev, +/* while (tree_ctx.count == 1) {*/ + cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head, rev, fullpath->buf); - +/* tree = lookup_tree(&tree_ctx.oid); if (!tree) return; @@ -141,6 +141,7 @@ static void write_tree_link(const struct object_id *oid, char *name, html(" / "); name = tree_ctx.name; } +*/ strbuf_setlen(fullpath, initial_length); } @@ -168,16 +169,18 @@ static int ls_item(const struct object_id *oid, struct strbuf *base, } } - cgit_gopher_start_selector(GOPHER_TXT); - cgit_print_filemode(mode); - cgit_gopher_text(" "); - cgit_gopher_text_pad(name, GOPHER_SUMMARY_NAME_LEN); - gopherf("%10ld", size); - cgit_gopher_tab(); - +/* if (S_ISGITLINK(mode)) { cgit_submodule_link("ls-mod", fullpath.buf, oid_to_hex(oid)); - } else if (S_ISDIR(mode)) { + } else +*/ + if (S_ISDIR(mode)) { + cgit_gopher_start_selector(GOPHER_MENU); + cgit_print_filemode(mode); + cgit_gopher_text(" "); + cgit_gopher_text_pad(name, GOPHER_SUMMARY_NAME_LEN); + gopherf("%10ld", size); + cgit_gopher_tab(); write_tree_link(oid, name, walk_tree_ctx->curr_rev, &fullpath); } else { @@ -185,6 +188,12 @@ static int ls_item(const struct object_id *oid, struct strbuf *base, strbuf_addstr(&class, "ls-blob"); if (ext) strbuf_addf(&class, " %s", ext + 1); + cgit_gopher_start_selector(GOPHER_TXT); + cgit_print_filemode(mode); + cgit_gopher_text(" "); + cgit_gopher_text_pad(name, GOPHER_SUMMARY_NAME_LEN); + gopherf("%10ld", size); + cgit_gopher_tab(); cgit_tree_link(name, NULL, class.buf, ctx.qry.head, walk_tree_ctx->curr_rev, fullpath.buf); } -- cgit v1.2.3