X-Git-Url: https://git.cameronkatri.com/cgit.git/blobdiff_plain/0ec8791ca0c980b721814cf0140204d56586fa63..f34478cbe0214a201e7ecef3e79ed6c957b7beee:/ui-commit.c diff --git a/ui-commit.c b/ui-commit.c index 4ac8955..ed25824 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -7,6 +7,7 @@ */ #include "cgit.h" +#include "html.h" static int files, slots; static int total_adds, total_rems, max_changes; @@ -62,20 +63,20 @@ void print_fileinfo(struct fileinfo *info) html(""); htmlf(""); 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("["); - html_filemode(info->old_mode); + cgit_print_filemode(info->old_mode); html("]"); } htmlf("", class); - cgit_diff_link(info->new_path, NULL, NULL, cgit_query_head, curr_rev, + cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, curr_rev, NULL, info->new_path); if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) htmlf(" (%s from %s)", @@ -84,7 +85,7 @@ void print_fileinfo(struct fileinfo *info) html(""); htmlf("%d", info->added + info->removed); html(""); - htmlf("", (max_changes > 100 ? 100 : max_changes)); + htmlf("
", (max_changes > 100 ? 100 : max_changes)); htmlf("
", info->added * 100.0 / max_changes); htmlf("", @@ -143,7 +144,7 @@ void cgit_print_commit(char *hex) int i; if (!hex) - hex = cgit_query_head; + hex = ctx.qry.head; curr_rev = hex; if (get_sha1(hex, sha1)) { @@ -157,7 +158,7 @@ void cgit_print_commit(char *hex) } info = cgit_parse_commit(commit); - html("\n"); + html("
\n"); html("\n"); for (p = commit->parents; p ; p = p->next) { parent = lookup_commit_reference(p->item->object.sha1); @@ -188,16 +189,16 @@ void cgit_print_commit(char *hex) html("" ""); } - if (cgit_repo->snapshots) { + if (ctx.repo->snapshots) { html(""); } html("
author"); html_txt(info->author); html(" "); @@ -175,7 +176,7 @@ void cgit_print_commit(char *hex) html("
tree"); tmp = xstrdup(hex); cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL, - cgit_query_head, tmp, NULL); + ctx.qry.head, tmp, NULL); html("
parent"); cgit_commit_link(sha1_to_hex(p->item->object.sha1), NULL, NULL, - cgit_query_head, sha1_to_hex(p->item->object.sha1)); + ctx.qry.head, sha1_to_hex(p->item->object.sha1)); html(" ("); - cgit_diff_link("diff", NULL, NULL, cgit_query_head, hex, + cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, sha1_to_hex(p->item->object.sha1), NULL); html(")
download"); - cgit_print_snapshot_links(cgit_query_repo, cgit_query_head, - hex, cgit_repo->snapshots); + cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head, + hex, ctx.repo->snapshots); html("
\n"); @@ -209,7 +210,7 @@ void cgit_print_commit(char *hex) html(""); if (!(commit->parents && commit->parents->next && commit->parents->next->next)) { html("
Diffstat
"); - html(""); + html("
"); max_changes = 0; cgit_diff_commit(commit, inspect_filepair); for(i = 0; i"); htmlf("%d files changed, %d insertions, %d deletions (", files, total_adds, total_rems); - cgit_diff_link("show diff", NULL, NULL, cgit_query_head, hex, + cgit_diff_link("show diff", NULL, NULL, ctx.qry.head, hex, NULL, NULL); html(")"); }