|
diff --git a/ui-log.c b/ui-log.c index a41d2b2..60c9269 100644 --- a/ ui-log.c+++ b/ ui-log.c |
|
@@ -8,4 +8,6 @@ |
8 | |
8 | |
9 | #include "cgit.h" |
9 | #include "cgit.h" |
| |
10 | #include "html.h" |
| |
11 | #include "ui-shared.h" |
10 | |
12 | |
11 | int files, add_lines, rem_lines; |
13 | int files, add_lines, rem_lines; |
@@ -26,5 +28,5 @@ void inspect_files(struct diff_filepair *pair) |
26 | { |
28 | { |
27 | files++; |
29 | files++; |
28 | if (cgit_repo->enable_log_linecount) |
30 | if (ctx.repo->enable_log_linecount) |
29 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
31 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
30 | } |
32 | } |
@@ -38,7 +40,7 @@ void print_commit(struct commit *commit) |
38 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
40 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
39 | html("</td><td>"); |
41 | html("</td><td>"); |
40 | cgit_commit_link(info->subject, NULL, NULL, cgit_query_head, |
42 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
41 | sha1_to_hex(commit->object.sha1)); |
43 | sha1_to_hex(commit->object.sha1)); |
42 | if (cgit_repo->enable_log_filecount) { |
44 | if (ctx.repo->enable_log_filecount) { |
43 | files = 0; |
45 | files = 0; |
44 | add_lines = 0; |
46 | add_lines = 0; |
@@ -47,5 +49,5 @@ void print_commit(struct commit *commit) |
47 | html("</td><td class='right'>"); |
49 | html("</td><td class='right'>"); |
48 | htmlf("%d", files); |
50 | htmlf("%d", files); |
49 | if (cgit_repo->enable_log_linecount) { |
51 | if (ctx.repo->enable_log_linecount) { |
50 | html("</td><td class='right'>"); |
52 | html("</td><td class='right'>"); |
51 | htmlf("-%d/+%d", rem_lines, add_lines); |
53 | htmlf("-%d/+%d", rem_lines, add_lines); |
@@ -68,5 +70,5 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern |
68 | |
70 | |
69 | if (!tip) |
71 | if (!tip) |
70 | argv[1] = cgit_query_head; |
72 | argv[1] = ctx.qry.head; |
71 | |
73 | |
72 | if (grep && pattern && (!strcmp(grep, "grep") || |
74 | if (grep && pattern && (!strcmp(grep, "grep") || |
@@ -95,7 +97,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern |
95 | "<th class='left'>Message</th>"); |
97 | "<th class='left'>Message</th>"); |
96 | |
98 | |
97 | if (cgit_repo->enable_log_filecount) { |
99 | if (ctx.repo->enable_log_filecount) { |
98 | html("<th class='right'>Files</th>"); |
100 | html("<th class='right'>Files</th>"); |
99 | if (cgit_repo->enable_log_linecount) |
101 | if (ctx.repo->enable_log_linecount) |
100 | html("<th class='right'>Lines</th>"); |
102 | html("<th class='right'>Lines</th>"); |
101 | } |
103 | } |
@@ -124,15 +126,15 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern |
124 | html("<div class='pager'>"); |
126 | html("<div class='pager'>"); |
125 | if (ofs > 0) { |
127 | if (ofs > 0) { |
126 | cgit_log_link("[prev]", NULL, NULL, cgit_query_head, |
128 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, |
127 | cgit_query_sha1, cgit_query_path, |
129 | ctx.qry.sha1, ctx.qry.path, |
128 | ofs - cnt, cgit_query_grep, |
130 | ofs - cnt, ctx.qry.grep, |
129 | cgit_query_search); |
131 | ctx.qry.search); |
130 | html(" "); |
132 | html(" "); |
131 | } |
133 | } |
132 | if ((commit = get_revision(&rev)) != NULL) { |
134 | if ((commit = get_revision(&rev)) != NULL) { |
133 | cgit_log_link("[next]", NULL, NULL, cgit_query_head, |
135 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, |
134 | cgit_query_sha1, cgit_query_path, |
136 | ctx.qry.sha1, ctx.qry.path, |
135 | ofs + cnt, cgit_query_grep, |
137 | ofs + cnt, ctx.qry.grep, |
136 | cgit_query_search); |
138 | ctx.qry.search); |
137 | } |
139 | } |
138 | html("</div>"); |
140 | html("</div>"); |
|