From ef8a97d9c6983e4fc3710bdbe771edd4e3550dba Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 5 Mar 2013 15:42:14 +0100 Subject: 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 --- ui-log.c | 14 +++++++------- ui-refs.c | 4 ++-- ui-summary.c | 24 +++++++++++++++++++----- 3 files changed, 28 insertions(+), 14 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: static void print_commit(struct commit *commit, struct rev_info *revs) { struct commitinfo *info; - int cols = revs->graph ? 3 : 2; + int columns = revs->graph ? 4 : 3; struct strbuf graphbuf = STRBUF_INIT; struct strbuf msgbuf = STRBUF_INIT; if (ctx.repo->enable_log_filecount) - cols++; + columns++; if (ctx.repo->enable_log_linecount) - cols++; + columns++; if (revs->graph) { /* Advance graph until current commit */ @@ -113,7 +113,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) /* Print graph segment in otherwise empty table row */ html(""); html(graphbuf.buf); - htmlf("\n", cols); + htmlf("\n", columns); strbuf_setlen(&graphbuf, 0); } /* 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) html(""); /* Empty 'Age' column */ /* Print msgbuf into remainder of table row */ - htmlf("\n", cols, + htmlf("\n", columns - (revs->graph ? 1 : 0), ctx.qry.showmsg ? " class='logmsg'" : ""); html_txt(msgbuf.buf); html("\n"); @@ -283,7 +283,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern struct rev_info rev; struct commit *commit; struct vector vec = VECTOR_INIT(char *); - int i, columns = 3; + int i, columns = commit_graph ? 4 : 3; char *arg; /* First argv is NULL */ @@ -421,7 +421,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern } html(""); } else if ((commit = get_revision(&rev)) != NULL) { - html(""); + htmlf("", columns); cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg); html("\n"); diff --git a/ui-refs.c b/ui-refs.c index e89f836..45db2ac 100644 --- a/ui-refs.c +++ b/ui-refs.c @@ -177,7 +177,7 @@ static int print_tag(struct refinfo *ref) static void print_refs_link(char *path) { - html(""); + html(""); cgit_refs_link("[...]", NULL, NULL, ctx.qry.head, NULL, path); html(""); } @@ -252,7 +252,7 @@ void cgit_print_refs() cgit_print_tags(0); else { cgit_print_branches(0); - html(" "); + html(" "); cgit_print_tags(0); } html(""); diff --git a/ui-summary.c b/ui-summary.c index b4fdd57..38639ce 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -17,15 +17,22 @@ int urls = 0; static void print_url(char *base, char *suffix) { + int columns = 3; + + if (ctx.repo->enable_log_filecount) + columns++; + if (ctx.repo->enable_log_linecount) + columns++; + if (!base || !*base) return; if (urls++ == 0) { - html(" "); - html("Clone\n"); + htmlf(" ", columns); + htmlf("Clone\n", columns); } if (suffix && *suffix) base = fmt("%s/%s", base, suffix); - html(""); html_txt(base); @@ -52,12 +59,19 @@ static void print_urls(char *txt, char *suffix) void cgit_print_summary() { + int columns = 3; + + if (ctx.repo->enable_log_filecount) + columns++; + if (ctx.repo->enable_log_linecount) + columns++; + html(""); cgit_print_branches(ctx.cfg.summary_branches); - html(""); + htmlf("", columns); cgit_print_tags(ctx.cfg.summary_tags); if (ctx.cfg.summary_log > 0) { - html(""); + htmlf("", columns); cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, NULL, NULL, 0, 0, 0); } -- cgit 1.4.1