author | Lars Hjemli <hjemli@gmail.com> | 2010-02-28 21:18:00 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2010-02-28 21:18:00 (UTC) |
commit | ff3a3b4e2b7463bb8cb370bdda393e8b3526fcb9 (patch) (side-by-side diff) | |
tree | 56a3033b87891fabd2396307fd61faa28bb8fbfa | |
parent | c151ce61d87c577ac8a067523a406938c557d650 (diff) | |
download | cgit-ff3a3b4e2b7463bb8cb370bdda393e8b3526fcb9.zip cgit-ff3a3b4e2b7463bb8cb370bdda393e8b3526fcb9.tar.gz cgit-ff3a3b4e2b7463bb8cb370bdda393e8b3526fcb9.tar.bz2 |
ui-tree: add link to plain view for blobs in tree listing
Suggested-by: Robert Weidlich <mail@robertweidlich.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-tree.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -154,48 +154,50 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen, sha1_to_hex(sha1))); html("'>"); html_txt(name); html("</a>"); } else if (S_ISDIR(mode)) { cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head, curr_rev, fullpath); } else { class = strrchr(name, '.'); if (class != NULL) { class = fmt("ls-blob %s", class + 1); } else class = "ls-blob"; cgit_tree_link(name, NULL, class, ctx.qry.head, curr_rev, fullpath); } htmlf("</td><td class='ls-size'>%li</td>", size); html("<td>"); cgit_log_link("log", NULL, "button", ctx.qry.head, curr_rev, fullpath, 0, NULL, NULL, ctx.qry.showmsg); if (ctx.repo->max_stats) cgit_stats_link("stats", NULL, "button", ctx.qry.head, fullpath); + cgit_plain_link("plain", NULL, "button", ctx.qry.head, curr_rev, + fullpath); html("</td></tr>\n"); free(name); return 0; } static void ls_head() { html("<table summary='tree listing' class='list'>\n"); html("<tr class='nohover'>"); html("<th class='left'>Mode</th>"); html("<th class='left'>Name</th>"); html("<th class='right'>Size</th>"); html("<th/>"); html("</tr>\n"); header = 1; } static void ls_tail() { if (!header) return; html("</table>\n"); header = 0; } |