author | Lars Hjemli <hjemli@gmail.com> | 2007-05-08 21:52:56 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-08 21:52:56 (UTC) |
commit | 7250a154678477a1e8260efbc9810ec389754ef9 (patch) (unidiff) | |
tree | 519559a2f9238fc386b7715c55bc3e2326be8d54 /ui-view.c | |
parent | 61c3ca978c586c673aec618cb94210657278dda8 (diff) | |
download | cgit-7250a154678477a1e8260efbc9810ec389754ef9.zip cgit-7250a154678477a1e8260efbc9810ec389754ef9.tar.gz cgit-7250a154678477a1e8260efbc9810ec389754ef9.tar.bz2 |
ui-view: show pathname if specified in querystring
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-view.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -7,9 +7,9 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | 10 | ||
11 | void cgit_print_view(const char *hex) | 11 | void cgit_print_view(const char *hex, char *path) |
12 | { | 12 | { |
13 | unsigned char sha1[20]; | 13 | unsigned char sha1[20]; |
14 | enum object_type type; | 14 | enum object_type type; |
15 | unsigned char *buf; | 15 | unsigned char *buf; |
@@ -33,10 +33,15 @@ void cgit_print_view(const char *hex) | |||
33 | } | 33 | } |
34 | 34 | ||
35 | buf[size] = '\0'; | 35 | buf[size] = '\0'; |
36 | html("<table class='list'>\n"); | 36 | html("<table class='list'>\n"); |
37 | htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n", | 37 | html("<tr class='nohover'><th class='left'>"); |
38 | typename(type), hex, size); | 38 | if (path) |
39 | htmlf("%s (", path); | ||
40 | htmlf("%s %s, %li bytes", typename(type), hex, size); | ||
41 | if (path) | ||
42 | html(")"); | ||
43 | html("</th></tr>\n"); | ||
39 | html("<tr><td class='blob'>\n"); | 44 | html("<tr><td class='blob'>\n"); |
40 | html_txt(buf); | 45 | html_txt(buf); |
41 | html("\n</td></tr>\n"); | 46 | html("\n</td></tr>\n"); |
42 | html("</table>\n"); | 47 | html("</table>\n"); |