author | Lars Hjemli <hjemli@gmail.com> | 2008-04-14 20:13:38 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-04-14 20:13:38 (UTC) |
commit | 5764fe95469f65fdee285467f0f87d188fc1a780 (patch) (unidiff) | |
tree | 0dc9e9545bd8b43fbf1a571f3ef239ff3aea771c | |
parent | 35d19bbb641aa56a21fb2c238994716c272e154f (diff) | |
download | cgit-5764fe95469f65fdee285467f0f87d188fc1a780.zip cgit-5764fe95469f65fdee285467f0f87d188fc1a780.tar.gz cgit-5764fe95469f65fdee285467f0f87d188fc1a780.tar.bz2 |
Make branches, tags and log play better together in the summary view
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-log.c | 42 | ||||
-rw-r--r-- | ui-refs.c | 25 | ||||
-rw-r--r-- | ui-summary.c | 10 |
3 files changed, 43 insertions, 34 deletions
@@ -43,2 +43,4 @@ void print_commit(struct commit *commit) | |||
43 | sha1_to_hex(commit->object.sha1)); | 43 | sha1_to_hex(commit->object.sha1)); |
44 | html("</td><td>"); | ||
45 | html_txt(info->author); | ||
44 | if (ctx.repo->enable_log_filecount) { | 46 | if (ctx.repo->enable_log_filecount) { |
@@ -48,6 +50,6 @@ void print_commit(struct commit *commit) | |||
48 | cgit_diff_commit(commit, inspect_files); | 50 | cgit_diff_commit(commit, inspect_files); |
49 | html("</td><td class='right'>"); | 51 | html("</td><td>"); |
50 | htmlf("%d", files); | 52 | htmlf("%d", files); |
51 | if (ctx.repo->enable_log_linecount) { | 53 | if (ctx.repo->enable_log_linecount) { |
52 | html("</td><td class='right'>"); | 54 | html("</td><td>"); |
53 | htmlf("-%d/+%d", rem_lines, add_lines); | 55 | htmlf("-%d/+%d", rem_lines, add_lines); |
@@ -55,4 +57,2 @@ void print_commit(struct commit *commit) | |||
55 | } | 57 | } |
56 | html("</td><td>"); | ||
57 | html_txt(info->author); | ||
58 | html("</td></tr>\n"); | 58 | html("</td></tr>\n"); |
@@ -62,3 +62,4 @@ void print_commit(struct commit *commit) | |||
62 | 62 | ||
63 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, char *path, int pager) | 63 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, |
64 | char *path, int pager) | ||
64 | { | 65 | { |
@@ -68,3 +69,3 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
68 | int argc = 2; | 69 | int argc = 2; |
69 | int i; | 70 | int i, columns = 3; |
70 | 71 | ||
@@ -94,12 +95,17 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
94 | 95 | ||
95 | html("<table summary='log' class='list nowrap'>"); | 96 | if (pager) |
96 | html("<tr class='nohover'><th class='left'>Age</th>" | 97 | html("<table class='list nowrap'>"); |
97 | "<th class='left'>Message</th>"); | ||
98 | 98 | ||
99 | html("<tr class='nohover'><th class='left'>Age</th>" | ||
100 | "<th class='left'>Commit message</th>" | ||
101 | "<th class='left'>Author</th>"); | ||
99 | if (ctx.repo->enable_log_filecount) { | 102 | if (ctx.repo->enable_log_filecount) { |
100 | html("<th class='right'>Files</th>"); | 103 | html("<th class='left'>Files</th>"); |
101 | if (ctx.repo->enable_log_linecount) | 104 | columns++; |
102 | html("<th class='right'>Lines</th>"); | 105 | if (ctx.repo->enable_log_linecount) { |
106 | html("<th class='left'>Lines</th>"); | ||
107 | columns++; | ||
108 | } | ||
103 | } | 109 | } |
104 | html("<th class='left'>Author</th></tr>\n"); | 110 | html("</tr>\n"); |
105 | 111 | ||
@@ -122,6 +128,5 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
122 | } | 128 | } |
123 | html("</table>\n"); | ||
124 | |||
125 | if (pager) { | 129 | if (pager) { |
126 | html("<div class='pager'>"); | 130 | htmlf("</table><div class='pager'>", |
131 | columns); | ||
127 | if (ofs > 0) { | 132 | if (ofs > 0) { |
@@ -140,2 +145,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
140 | html("</div>"); | 145 | html("</div>"); |
146 | } else if ((commit = get_revision(&rev)) != NULL) { | ||
147 | html("<tr class='nohover'><td colspan='3'>"); | ||
148 | cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, NULL, 0, | ||
149 | NULL, NULL); | ||
150 | html("</td></tr>\n"); | ||
141 | } | 151 | } |
@@ -64,7 +64,7 @@ static int print_branch(struct refinfo *ref) | |||
64 | if (ref->object->type == OBJ_COMMIT) { | 64 | if (ref->object->type == OBJ_COMMIT) { |
65 | cgit_print_age(info->commit->date, -1, NULL); | 65 | cgit_commit_link(info->subject, NULL, NULL, name, NULL); |
66 | html("</td><td>"); | 66 | html("</td><td>"); |
67 | html_txt(info->author); | 67 | html_txt(info->author); |
68 | html("</td><td>"); | 68 | html("</td><td colspan='2'>"); |
69 | cgit_commit_link(info->subject, NULL, NULL, name, NULL); | 69 | cgit_print_age(info->commit->date, -1, NULL); |
70 | } else { | 70 | } else { |
@@ -80,5 +80,5 @@ static void print_tag_header() | |||
80 | html("<tr class='nohover'><th class='left'>Tag</th>" | 80 | html("<tr class='nohover'><th class='left'>Tag</th>" |
81 | "<th class='left'>Age</th>" | 81 | "<th class='left'>Reference</th>" |
82 | "<th class='left'>Author</th>" | 82 | "<th class='left'>Author</th>" |
83 | "<th class='left'>Reference</th></tr>\n"); | 83 | "<th class='left' colspan='2'>Age</th></tr>\n"); |
84 | header = 1; | 84 | header = 1; |
@@ -104,4 +104,3 @@ static int print_tag(struct refinfo *ref) | |||
104 | html("</td><td>"); | 104 | html("</td><td>"); |
105 | if (info->tagger_date > 0) | 105 | cgit_object_link(tag->tagged); |
106 | cgit_print_age(info->tagger_date, -1, NULL); | ||
107 | html("</td><td>"); | 106 | html("</td><td>"); |
@@ -109,4 +108,5 @@ static int print_tag(struct refinfo *ref) | |||
109 | html(info->tagger); | 108 | html(info->tagger); |
110 | html("</td><td>"); | 109 | html("</td><td colspan='2'>"); |
111 | cgit_object_link(tag->tagged); | 110 | if (info->tagger_date > 0) |
111 | cgit_print_age(info->tagger_date, -1, NULL); | ||
112 | html("</td></tr>\n"); | 112 | html("</td></tr>\n"); |
@@ -117,3 +117,3 @@ static int print_tag(struct refinfo *ref) | |||
117 | html_txt(name); | 117 | html_txt(name); |
118 | html("</td><td colspan='2'/><td>"); | 118 | html("</td><td>"); |
119 | cgit_object_link(ref->object); | 119 | cgit_object_link(ref->object); |
@@ -137,5 +137,5 @@ void cgit_print_branches(int maxcount) | |||
137 | html("<tr class='nohover'><th class='left'>Branch</th>" | 137 | html("<tr class='nohover'><th class='left'>Branch</th>" |
138 | "<th class='left'>Idle</th>" | 138 | "<th class='left'>Commit message</th>" |
139 | "<th class='left'>Author</th>" | 139 | "<th class='left'>Author</th>" |
140 | "<th class='left'>Head commit</th></tr>\n"); | 140 | "<th class='left' colspan='2'>Age</th></tr>\n"); |
141 | 141 | ||
@@ -198,3 +198,2 @@ void cgit_print_refs() | |||
198 | } | 198 | } |
199 | |||
200 | html("</table>"); | 199 | html("</table>"); |
diff --git a/ui-summary.c b/ui-summary.c index 0b66b52..318148a 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -20,8 +20,3 @@ void cgit_print_summary() | |||
20 | } | 20 | } |
21 | if (ctx.cfg.summary_log > 0) | ||
22 | cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, | ||
23 | NULL, NULL, 0); | ||
24 | html("<table summary='repository info' class='list nowrap'>"); | 21 | html("<table summary='repository info' class='list nowrap'>"); |
25 | if (ctx.cfg.summary_log > 0) | ||
26 | html("<tr class='nohover'><td colspan='4'> </td></tr>"); | ||
27 | cgit_print_branches(ctx.cfg.summary_branches); | 22 | cgit_print_branches(ctx.cfg.summary_branches); |
@@ -29,2 +24,7 @@ void cgit_print_summary() | |||
29 | cgit_print_tags(ctx.cfg.summary_tags); | 24 | cgit_print_tags(ctx.cfg.summary_tags); |
25 | if (ctx.cfg.summary_log > 0) { | ||
26 | html("<tr class='nohover'><td colspan='4'> </td></tr>"); | ||
27 | cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, | ||
28 | NULL, NULL, 0); | ||
29 | } | ||
30 | html("</table>"); | 30 | html("</table>"); |