author | Lars Hjemli <hjemli@gmail.com> | 2007-01-11 23:46:17 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-01-11 23:46:17 (UTC) |
commit | 5cd2bf7e7f3f3daf6107cd3a269bad78e342de70 (patch) (unidiff) | |
tree | 7ce9368e94b39114e772c279f741bd8106f611d2 /ui-tree.c | |
parent | 2c2047ff67a1e0053f95776e5079e432f69cea54 (diff) | |
download | cgit-5cd2bf7e7f3f3daf6107cd3a269bad78e342de70.zip cgit-5cd2bf7e7f3f3daf6107cd3a269bad78e342de70.tar.gz cgit-5cd2bf7e7f3f3daf6107cd3a269bad78e342de70.tar.bz2 |
WIP: add paths/backlinks to tree/blobview
-rw-r--r-- | ui-tree.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -30,9 +30,14 @@ static int print_entry(const unsigned char *sha1, const char *base, | |||
30 | html("<div class='ls-dir'><a href='"); | 30 | html("<div class='ls-dir'><a href='"); |
31 | html_attr(cgit_pageurl(cgit_query_repo, "tree", | 31 | html_attr(cgit_pageurl(cgit_query_repo, "tree", |
32 | fmt("id=%s", sha1_to_hex(sha1)))); | 32 | fmt("id=%s&path=%s%s/", |
33 | sha1_to_hex(sha1), | ||
34 | cgit_query_path ? cgit_query_path : "", | ||
35 | pathname))); | ||
33 | } else { | 36 | } else { |
34 | html("<div class='ls-blob'><a href='"); | 37 | html("<div class='ls-blob'><a href='"); |
35 | html_attr(cgit_pageurl(cgit_query_repo, "view", | 38 | html_attr(cgit_pageurl(cgit_query_repo, "view", |
36 | fmt("id=%s", sha1_to_hex(sha1)))); | 39 | fmt("id=%s&path=%s%s", sha1_to_hex(sha1), |
40 | cgit_query_path ? cgit_query_path : "", | ||
41 | pathname))); | ||
37 | } | 42 | } |
38 | html("'>"); | 43 | html("'>"); |
@@ -47,5 +52,5 @@ static int print_entry(const unsigned char *sha1, const char *base, | |||
47 | } | 52 | } |
48 | 53 | ||
49 | void cgit_print_tree(const char *hex) | 54 | void cgit_print_tree(const char *hex, char *path) |
50 | { | 55 | { |
51 | struct tree *tree; | 56 | struct tree *tree; |
@@ -63,4 +68,5 @@ void cgit_print_tree(const char *hex) | |||
63 | 68 | ||
64 | html("<h2>Tree content</h2>\n"); | 69 | html("<h2>Tree content</h2>\n"); |
70 | html_txt(path); | ||
65 | html("<table class='list'>\n"); | 71 | html("<table class='list'>\n"); |
66 | html("<tr>"); | 72 | html("<tr>"); |