]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-tree.c
added snapshot filename to the link
[ps-cgit] / ui-tree.c
index d503bee9cc8b316c0ced1ad96f694bc480fa90f7..c5d64ffe81246cd6fbf937b8ae1fe9dfd84bfdd9 100644 (file)
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -58,7 +58,6 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
        char *fullpath;
        enum object_type type;
        unsigned long size = 0;
-       char *url, *qry;
 
        name = xstrdup(pathname);
        fullpath = fmt("%s%s%s", cgit_query_path ? cgit_query_path : "",
@@ -92,14 +91,10 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
        }
        htmlf("</td><td class='ls-size'>%li</td>", size);
 
-       html("<td><a href='");
-       qry = fmt("h=%s&amp;path=%s%s%s", curr_rev,
-                 cgit_query_path ? cgit_query_path : "",
-                 cgit_query_path ? "/" : "", pathname);
-       url = cgit_pageurl(cgit_query_repo, "log", qry);
-       html_attr(url);
-       html("' title='Log' class='button'>L</a></td>");
-       html("</tr>\n");
+       html("<td>");
+       cgit_log_link("log", NULL, "button", cgit_query_head, curr_rev,
+                     fullpath, 0);
+       html("</td></tr>\n");
        free(name);
        return 0;
 }