summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2018-08-01 11:42:15 +0100
committerKatolaZ <katolaz@freaknet.org>2018-08-01 11:42:15 +0100
commitbd650dd4ecc96cebf067f9d716c7f597ecdb74c5 (patch)
treee46fb1c4bdf3ca166ac57429caccff27b2405f51
parentd45de4dd4558be1db607f3315ddecf4814f37ba2 (diff)
fixed dir entries in tree view
-rw-r--r--ui_70-tree.c31
1 files 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);
}