]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-commit.c
More layout fixes
[ps-cgit] / ui-commit.c
index 25721ca76a3ad7614e2b46363545c48d4e3314f7..c2fafd78f1c60f3c93705ec4ffed96918fdaa5e8 100644 (file)
@@ -7,6 +7,9 @@
  */
 
 #include "cgit.h"
+#include "html.h"
+#include "ui-shared.h"
+#include "ui-diff.h"
 
 static int files, slots;
 static int total_adds, total_rems, max_changes;
@@ -62,16 +65,16 @@ void print_fileinfo(struct fileinfo *info)
        html("<tr>");
        htmlf("<td class='mode'>");
        if (is_null_sha1(info->new_sha1)) {
-               html_filemode(info->old_mode);
+               cgit_print_filemode(info->old_mode);
        } else {
-               html_filemode(info->new_mode);
+               cgit_print_filemode(info->new_mode);
        }
 
        if (info->old_mode != info->new_mode &&
            !is_null_sha1(info->old_sha1) &&
            !is_null_sha1(info->new_sha1)) {
                html("<span class='modechange'>[");
-               html_filemode(info->old_mode);
+               cgit_print_filemode(info->old_mode);
                html("]</span>");
        }
        htmlf("</td><td class='%s'>", class);
@@ -216,10 +219,11 @@ void cgit_print_commit(char *hex)
                        print_fileinfo(&items[i]);
                html("</table>");
                html("<div class='diffstat-summary'>");
-               htmlf("%d files changed, %d insertions, %d deletions (",
+               htmlf("%d files changed, %d insertions, %d deletions",
                      files, total_adds, total_rems);
-               cgit_diff_link("show diff", NULL, NULL, ctx.qry.head, hex,
-                              NULL, NULL);
+               cgit_print_diff(ctx.qry.sha1,
+                               sha1_to_hex(commit->parents->item->object.sha1),
+                               NULL);
                html(")</div>");
        }
        cgit_free_commitinfo(info);