|
diff --git a/ui-log.c b/ui-log.c index 0536b23..41b5225 100644 --- a/ ui-log.c+++ b/ ui-log.c |
|
@@ -183,71 +183,70 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern |
183 | load_ref_decorations(DECORATE_FULL_REFS); |
183 | load_ref_decorations(DECORATE_FULL_REFS); |
184 | rev.show_decorations = 1; |
184 | rev.show_decorations = 1; |
185 | rev.grep_filter.regflags |= REG_ICASE; |
185 | rev.grep_filter.regflags |= REG_ICASE; |
186 | compile_grep_patterns(&rev.grep_filter); |
186 | compile_grep_patterns(&rev.grep_filter); |
187 | prepare_revision_walk(&rev); |
187 | prepare_revision_walk(&rev); |
188 | |
188 | |
189 | if (pager) |
189 | if (pager) |
190 | html("<table class='list nowrap'>"); |
190 | html("<table class='list nowrap'>"); |
191 | |
191 | |
192 | html("<tr class='nohover'><th class='left'>Age</th>" |
192 | html("<tr class='nohover'><th class='left'>Age</th>" |
193 | "<th class='left'>Commit message"); |
193 | "<th class='left'>Commit message"); |
194 | if (pager) { |
194 | if (pager) { |
195 | html(" ("); |
195 | html(" ("); |
196 | cgit_log_link(ctx.qry.showmsg ? "Collapse" : "Expand", NULL, |
196 | cgit_log_link(ctx.qry.showmsg ? "Collapse" : "Expand", NULL, |
197 | NULL, ctx.qry.head, ctx.qry.sha1, |
197 | NULL, ctx.qry.head, ctx.qry.sha1, |
198 | ctx.qry.vpath, ctx.qry.ofs, ctx.qry.grep, |
198 | ctx.qry.vpath, ctx.qry.ofs, ctx.qry.grep, |
199 | ctx.qry.search, ctx.qry.showmsg ? 0 : 1); |
199 | ctx.qry.search, ctx.qry.showmsg ? 0 : 1); |
200 | html(")"); |
200 | html(")"); |
201 | } |
201 | } |
202 | html("</th><th class='left'>Author</th>"); |
202 | html("</th><th class='left'>Author</th>"); |
203 | if (ctx.repo->enable_log_filecount) { |
203 | if (ctx.repo->enable_log_filecount) { |
204 | html("<th class='left'>Files</th>"); |
204 | html("<th class='left'>Files</th>"); |
205 | columns++; |
205 | columns++; |
206 | if (ctx.repo->enable_log_linecount) { |
206 | if (ctx.repo->enable_log_linecount) { |
207 | html("<th class='left'>Lines</th>"); |
207 | html("<th class='left'>Lines</th>"); |
208 | columns++; |
208 | columns++; |
209 | } |
209 | } |
210 | } |
210 | } |
211 | html("</tr>\n"); |
211 | html("</tr>\n"); |
212 | |
212 | |
213 | if (ofs<0) |
213 | if (ofs<0) |
214 | ofs = 0; |
214 | ofs = 0; |
215 | |
215 | |
216 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |
216 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |
217 | free(commit->buffer); |
217 | free(commit->buffer); |
218 | commit->buffer = NULL; |
218 | commit->buffer = NULL; |
219 | free_commit_list(commit->parents); |
219 | free_commit_list(commit->parents); |
220 | commit->parents = NULL; |
220 | commit->parents = NULL; |
221 | } |
221 | } |
222 | |
222 | |
223 | for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { |
223 | for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { |
224 | print_commit(commit); |
224 | print_commit(commit); |
225 | free(commit->buffer); |
225 | free(commit->buffer); |
226 | commit->buffer = NULL; |
226 | commit->buffer = NULL; |
227 | free_commit_list(commit->parents); |
227 | free_commit_list(commit->parents); |
228 | commit->parents = NULL; |
228 | commit->parents = NULL; |
229 | } |
229 | } |
230 | if (pager) { |
230 | if (pager) { |
231 | htmlf("</table><div class='pager'>", |
231 | html("</table><div class='pager'>"); |
232 | columns); |
| |
233 | if (ofs > 0) { |
232 | if (ofs > 0) { |
234 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, |
233 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, |
235 | ctx.qry.sha1, ctx.qry.vpath, |
234 | ctx.qry.sha1, ctx.qry.vpath, |
236 | ofs - cnt, ctx.qry.grep, |
235 | ofs - cnt, ctx.qry.grep, |
237 | ctx.qry.search, ctx.qry.showmsg); |
236 | ctx.qry.search, ctx.qry.showmsg); |
238 | html(" "); |
237 | html(" "); |
239 | } |
238 | } |
240 | if ((commit = get_revision(&rev)) != NULL) { |
239 | if ((commit = get_revision(&rev)) != NULL) { |
241 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, |
240 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, |
242 | ctx.qry.sha1, ctx.qry.vpath, |
241 | ctx.qry.sha1, ctx.qry.vpath, |
243 | ofs + cnt, ctx.qry.grep, |
242 | ofs + cnt, ctx.qry.grep, |
244 | ctx.qry.search, ctx.qry.showmsg); |
243 | ctx.qry.search, ctx.qry.showmsg); |
245 | } |
244 | } |
246 | html("</div>"); |
245 | html("</div>"); |
247 | } else if ((commit = get_revision(&rev)) != NULL) { |
246 | } else if ((commit = get_revision(&rev)) != NULL) { |
248 | html("<tr class='nohover'><td colspan='3'>"); |
247 | html("<tr class='nohover'><td colspan='3'>"); |
249 | cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, |
248 | cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, |
250 | ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg); |
249 | ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg); |
251 | html("</td></tr>\n"); |
250 | html("</td></tr>\n"); |
252 | } |
251 | } |
253 | } |
252 | } |
|