X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/9927e63f387e6c9328eb3c347ecb0e339f8ac023..57f6a8bf0de6c112cabc1d8e20ade2698bd886b7:/ui-commit.c
diff --git a/ui-commit.c b/ui-commit.c
index b6a106f..59eeb1d 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -29,7 +29,6 @@ void print_fileinfo(struct fileinfo *info)
{
char *query, *query2;
char *class;
- double width;
switch (info->status) {
case DIFF_STATUS_ADDED:
@@ -96,18 +95,15 @@ void print_fileinfo(struct fileinfo *info)
}
html("
");
htmlf("%d", info->added + info->removed);
-
html(" | ");
- width = (info->added + info->removed) * 100.0 / max_changes;
- if (width < 0.1)
- width = 0.1;
- html_link_open(cgit_pageurl(cgit_query_repo, "diff", query),
- NULL, NULL);
- htmlf(" ",
- info->added * width / (info->added + info->removed));
- htmlf(" ",
- info->removed * width / (info->added + info->removed));
- html(" | \n");
+ htmlf("", (max_changes > 100 ? 100 : max_changes));
+ htmlf(" | ",
+ info->added * 100.0 / max_changes);
+ htmlf(" | ",
+ info->removed * 100.0 / max_changes);
+ htmlf(" | ",
+ (max_changes - info->removed - info->added) * 100.0 / max_changes);
+ html("
\n");
}
void cgit_count_diff_lines(char *line, int len)
@@ -176,14 +172,14 @@ void cgit_print_commit(const char *hex)
html(" ");
html_txt(info->author_email);
html("");
- cgit_print_date(info->author_date);
+ cgit_print_date(info->author_date, FMT_LONGDATE);
html(" | \n");
html("| committer | ");
html_txt(info->committer);
html(" ");
html_txt(info->committer_email);
html(" | ");
- cgit_print_date(info->committer_date);
+ cgit_print_date(info->committer_date, FMT_LONGDATE);
html(" |
\n");
html("| tree | "
"%s (Diffstat");
html("");
max_changes = 0;
cgit_diff_commit(commit, inspect_filepair);
@@ -232,8 +229,11 @@ void cgit_print_commit(const char *hex)
print_fileinfo(&items[i]);
html(" ");
html("");
- 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)");
html(" ");
}
cgit_free_commitinfo(info);
|
|---|