]> git.cameronkatri.com Git - cgit.git/commitdiff
Add link to commitdiff below diffstat
authorLars Hjemli <hjemli@gmail.com>
Tue, 15 May 2007 23:16:56 +0000 (01:16 +0200)
committerLars Hjemli <hjemli@gmail.com>
Tue, 15 May 2007 23:16:56 +0000 (01:16 +0200)
This link is a lot easier to locate than the links to the right of the
parent entries.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
cgit.css
ui-commit.c

index 87fd00a387cbb80aa67109dc2efc0e7857eae4b6..5cf8d15a70749b3bfa134f0f05fdd1c0caac10a8 100644 (file)
--- a/cgit.css
+++ b/cgit.css
@@ -236,9 +236,13 @@ div.commit-msg {
        font-family: monospace;
 }
 
+div.diffstat-header {
+       font-weight: bold;
+       padding-top: 1.5em;
+}
+
 table.diffstat {
        border-collapse: collapse;
-       margin-top: 1.5em;
        width: 100%;
        border: solid 1px #aaa;
        background-color: #eee;
index 93eb8fd156690d585f63f6ad936e2cf4b42832c9..ff1fad33c9c73f074e93d1984bff354ec1b6381e 100644 (file)
@@ -221,6 +221,7 @@ void cgit_print_commit(const char *hex)
        html_txt(info->msg);
        html("</div>");
        if (!(commit->parents && commit->parents->next && commit->parents->next->next)) {
+               html("<div class='diffstat-header'>Diffstat</div>");
                html("<table class='diffstat'>");
                max_changes = 0;
                cgit_diff_commit(commit, inspect_filepair);
@@ -228,8 +229,11 @@ void cgit_print_commit(const char *hex)
                        print_fileinfo(&items[i]);
                html("</table>");
                html("<div class='diffstat-summary'>");
-               htmlf("%d files changed, %d insertions, %d deletions\n",
+               htmlf("%d files changed, %d insertions, %d deletions (",
                      files, total_adds, total_rems);
+               query = fmt("h=%s", hex);
+               html_link_open(cgit_pageurl(cgit_query_repo, "diff", query), NULL, NULL);
+               html("show diff</a>)");
                html("</div>");
        }
        cgit_free_commitinfo(info);