fixed dir entries in tree view

gopher
KatolaZ 7 years ago
parent d45de4dd45
commit bd650dd4ec
  1. 25
      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); oidcpy(&tree_ctx.oid, oid);
while (tree_ctx.count == 1) { /* while (tree_ctx.count == 1) {*/
cgit_gopher_tree_link(name, NULL, "ls-dir", ctx.qry.head, rev, cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head, rev,
fullpath->buf); fullpath->buf);
/*
tree = lookup_tree(&tree_ctx.oid); tree = lookup_tree(&tree_ctx.oid);
if (!tree) if (!tree)
return; return;
@ -141,6 +141,7 @@ static void write_tree_link(const struct object_id *oid, char *name,
html(" / "); html(" / ");
name = tree_ctx.name; name = tree_ctx.name;
} }
*/
strbuf_setlen(fullpath, initial_length); 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); /*
if (S_ISGITLINK(mode)) {
cgit_submodule_link("ls-mod", fullpath.buf, oid_to_hex(oid));
} else
*/
if (S_ISDIR(mode)) {
cgit_gopher_start_selector(GOPHER_MENU);
cgit_print_filemode(mode); cgit_print_filemode(mode);
cgit_gopher_text(" "); cgit_gopher_text(" ");
cgit_gopher_text_pad(name, GOPHER_SUMMARY_NAME_LEN); cgit_gopher_text_pad(name, GOPHER_SUMMARY_NAME_LEN);
gopherf("%10ld", size); gopherf("%10ld", size);
cgit_gopher_tab(); cgit_gopher_tab();
if (S_ISGITLINK(mode)) {
cgit_submodule_link("ls-mod", fullpath.buf, oid_to_hex(oid));
} else if (S_ISDIR(mode)) {
write_tree_link(oid, name, walk_tree_ctx->curr_rev, write_tree_link(oid, name, walk_tree_ctx->curr_rev,
&fullpath); &fullpath);
} else { } else {
@ -185,6 +188,12 @@ static int ls_item(const struct object_id *oid, struct strbuf *base,
strbuf_addstr(&class, "ls-blob"); strbuf_addstr(&class, "ls-blob");
if (ext) if (ext)
strbuf_addf(&class, " %s", ext + 1); 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, cgit_tree_link(name, NULL, class.buf, ctx.qry.head,
walk_tree_ctx->curr_rev, fullpath.buf); walk_tree_ctx->curr_rev, fullpath.buf);
} }

Loading…
Cancel
Save