aboutsummaryrefslogtreecommitdiffstats
path: root/ui-log.c
diff options
context:
space:
mode:
authorGravatar Lukas Fleischer <cgit@cryptocrack.de>2013-03-05 23:42:14 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2013-03-21 05:08:32 (JST)
commitef8a97d9c6983e4fc3710bdbe771edd4e3550dba (patch)
tree548ea4fda8fd0ed467895de2629ea3ea587143a1 /ui-log.c
parent6d7e3596ebb387265d8cfdc5b312e0ea76da8c8a (diff)
downloadcgit-ef8a97d9c6983e4fc3710bdbe771edd4e3550dba.zip
cgit-ef8a97d9c6983e4fc3710bdbe771edd4e3550dba.tar.gz
Fix colspan values
This fixes a couple of minor oversights in previous commits and adjusts all cells using colspan to use the correct width. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Diffstat (limited to 'ui-log.c')
-rw-r--r--ui-log.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ui-log.c b/ui-log.c
index 857c05c..954d3e1 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -98,14 +98,14 @@ next:
98static void print_commit(struct commit *commit, struct rev_info *revs) 98static void print_commit(struct commit *commit, struct rev_info *revs)
99{ 99{
100 struct commitinfo *info; 100 struct commitinfo *info;
101 int cols = revs->graph ? 3 : 2; 101 int columns = revs->graph ? 4 : 3;
102 struct strbuf graphbuf = STRBUF_INIT; 102 struct strbuf graphbuf = STRBUF_INIT;
103 struct strbuf msgbuf = STRBUF_INIT; 103 struct strbuf msgbuf = STRBUF_INIT;
104 104
105 if (ctx.repo->enable_log_filecount) 105 if (ctx.repo->enable_log_filecount)
106 cols++; 106 columns++;
107 if (ctx.repo->enable_log_linecount) 107 if (ctx.repo->enable_log_linecount)
108 cols++; 108 columns++;
109 109
110 if (revs->graph) { 110 if (revs->graph) {
111 /* Advance graph until current commit */ 111 /* Advance graph until current commit */
@@ -113,7 +113,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
113 /* Print graph segment in otherwise empty table row */ 113 /* Print graph segment in otherwise empty table row */
114 html("<tr class='nohover'><td class='commitgraph'>"); 114 html("<tr class='nohover'><td class='commitgraph'>");
115 html(graphbuf.buf); 115 html(graphbuf.buf);
116 htmlf("</td><td colspan='%d' /></tr>\n", cols); 116 htmlf("</td><td colspan='%d' /></tr>\n", columns);
117 strbuf_setlen(&graphbuf, 0); 117 strbuf_setlen(&graphbuf, 0);
118 } 118 }
119 /* Current commit's graph segment is now ready in graphbuf */ 119 /* Current commit's graph segment is now ready in graphbuf */
@@ -232,7 +232,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
232 html("<td/>"); /* Empty 'Age' column */ 232 html("<td/>"); /* Empty 'Age' column */
233 233
234 /* Print msgbuf into remainder of table row */ 234 /* Print msgbuf into remainder of table row */
235 htmlf("<td colspan='%d'%s>\n", cols, 235 htmlf("<td colspan='%d'%s>\n", columns - (revs->graph ? 1 : 0),
236 ctx.qry.showmsg ? " class='logmsg'" : ""); 236 ctx.qry.showmsg ? " class='logmsg'" : "");
237 html_txt(msgbuf.buf); 237 html_txt(msgbuf.buf);
238 html("</td></tr>\n"); 238 html("</td></tr>\n");
@@ -283,7 +283,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
283 struct rev_info rev; 283 struct rev_info rev;
284 struct commit *commit; 284 struct commit *commit;
285 struct vector vec = VECTOR_INIT(char *); 285 struct vector vec = VECTOR_INIT(char *);
286 int i, columns = 3; 286 int i, columns = commit_graph ? 4 : 3;
287 char *arg; 287 char *arg;
288 288
289 /* First argv is NULL */ 289 /* First argv is NULL */
@@ -421,7 +421,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
421 } 421 }
422 html("</div>"); 422 html("</div>");
423 } else if ((commit = get_revision(&rev)) != NULL) { 423 } else if ((commit = get_revision(&rev)) != NULL) {
424 html("<tr class='nohover'><td colspan='3'>"); 424 htmlf("<tr class='nohover'><td colspan='%d'>", columns);
425 cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, 425 cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL,
426 ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg); 426 ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg);
427 html("</td></tr>\n"); 427 html("</td></tr>\n");