fixed dir entries in tree view

gopher
KatolaZ 6 years ago
parent d45de4dd45
commit bd650dd4ec
  1. 31
      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);
}

Loading…
Cancel
Save