diff options
| author | Lukas Fleischer | 2013-03-05 15:42:14 +0100 |
|---|---|---|
| committer | Jason A. Donenfeld | 2013-03-20 21:08:32 +0100 |
| commit | ef8a97d9c6983e4fc3710bdbe771edd4e3550dba (patch) | |
| tree | 548ea4fda8fd0ed467895de2629ea3ea587143a1 /ui-summary.c | |
| parent | 6d7e3596ebb387265d8cfdc5b312e0ea76da8c8a (diff) | |
| download | cgit-ef8a97d9c6983e4fc3710bdbe771edd4e3550dba.tar.gz cgit-ef8a97d9c6983e4fc3710bdbe771edd4e3550dba.tar.bz2 cgit-ef8a97d9c6983e4fc3710bdbe771edd4e3550dba.zip | |
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-summary.c')
| -rw-r--r-- | ui-summary.c | 24 |
1 files changed, 19 insertions, 5 deletions
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; | |||
| 17 | 17 | ||
| 18 | static void print_url(char *base, char *suffix) | 18 | static void print_url(char *base, char *suffix) |
| 19 | { | 19 | { |
| 20 | int columns = 3; | ||
| 21 | |||
| 22 | if (ctx.repo->enable_log_filecount) | ||
| 23 | columns++; | ||
| 24 | if (ctx.repo->enable_log_linecount) | ||
| 25 | columns++; | ||
| 26 | |||
| 20 | if (!base || !*base) | 27 | if (!base || !*base) |
| 21 | return; | 28 | return; |
| 22 | if (urls++ == 0) { | 29 | if (urls++ == 0) { |
| 23 | html("<tr class='nohover'><td colspan='4'> </td></tr>"); | 30 | htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns); |
| 24 | html("<tr><th class='left' colspan='4'>Clone</th></tr>\n"); | 31 | htmlf("<tr><th class='left' colspan='%d'>Clone</th></tr>\n", columns); |
| 25 | } | 32 | } |
| 26 | if (suffix && *suffix) | 33 | if (suffix && *suffix) |
| 27 | base = fmt("%s/%s", base, suffix); | 34 | base = fmt("%s/%s", base, suffix); |
| 28 | html("<tr><td colspan='4'><a href='"); | 35 | htmlf("<tr><td colspan='%d'><a href='", columns); |
| 29 | html_url_path(base); | 36 | html_url_path(base); |
| 30 | html("'>"); | 37 | html("'>"); |
| 31 | html_txt(base); | 38 | html_txt(base); |
| @@ -52,12 +59,19 @@ static void print_urls(char *txt, char *suffix) | |||
| 52 | 59 | ||
| 53 | void cgit_print_summary() | 60 | void cgit_print_summary() |
| 54 | { | 61 | { |
| 62 | int columns = 3; | ||
| 63 | |||
| 64 | if (ctx.repo->enable_log_filecount) | ||
| 65 | columns++; | ||
| 66 | if (ctx.repo->enable_log_linecount) | ||
| 67 | columns++; | ||
| 68 | |||
| 55 | html("<table summary='repository info' class='list nowrap'>"); | 69 | html("<table summary='repository info' class='list nowrap'>"); |
| 56 | cgit_print_branches(ctx.cfg.summary_branches); | 70 | cgit_print_branches(ctx.cfg.summary_branches); |
| 57 | html("<tr class='nohover'><td colspan='4'> </td></tr>"); | 71 | htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns); |
| 58 | cgit_print_tags(ctx.cfg.summary_tags); | 72 | cgit_print_tags(ctx.cfg.summary_tags); |
| 59 | if (ctx.cfg.summary_log > 0) { | 73 | if (ctx.cfg.summary_log > 0) { |
| 60 | html("<tr class='nohover'><td colspan='4'> </td></tr>"); | 74 | htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns); |
| 61 | cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, | 75 | cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, |
| 62 | NULL, NULL, 0, 0, 0); | 76 | NULL, NULL, 0, 0, 0); |
| 63 | } | 77 | } |
