summaryrefslogtreecommitdiffabout
path: root/ui-commit.c
authorLars Hjemli <hjemli@gmail.com>2007-11-11 12:04:28 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-11-11 12:04:28 (UTC)
commit2915483ef6c9c29ac1493e6945688bb62f7825b4 (patch) (unidiff)
tree3ee4afec27ec8cb0ad5e10008f3bd8c994747c39 /ui-commit.c
parentb4649fc90597910c89c3f37a6aec9af54d9f416b (diff)
downloadcgit-2915483ef6c9c29ac1493e6945688bb62f7825b4.zip
cgit-2915483ef6c9c29ac1493e6945688bb62f7825b4.tar.gz
cgit-2915483ef6c9c29ac1493e6945688bb62f7825b4.tar.bz2
Fix html error detected by test-suite
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-commit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-commit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui-commit.c b/ui-commit.c
index 4ac8955..bd55a33 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -75,25 +75,25 @@ void print_fileinfo(struct fileinfo *info)
75 html("]</span>"); 75 html("]</span>");
76 } 76 }
77 htmlf("</td><td class='%s'>", class); 77 htmlf("</td><td class='%s'>", class);
78 cgit_diff_link(info->new_path, NULL, NULL, cgit_query_head, curr_rev, 78 cgit_diff_link(info->new_path, NULL, NULL, cgit_query_head, curr_rev,
79 NULL, info->new_path); 79 NULL, info->new_path);
80 if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) 80 if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED)
81 htmlf(" (%s from %s)", 81 htmlf(" (%s from %s)",
82 info->status == DIFF_STATUS_COPIED ? "copied" : "renamed", 82 info->status == DIFF_STATUS_COPIED ? "copied" : "renamed",
83 info->old_path); 83 info->old_path);
84 html("</td><td class='right'>"); 84 html("</td><td class='right'>");
85 htmlf("%d", info->added + info->removed); 85 htmlf("%d", info->added + info->removed);
86 html("</td><td class='graph'>"); 86 html("</td><td class='graph'>");
87 htmlf("<table width='%d%%'><tr>", (max_changes > 100 ? 100 : max_changes)); 87 htmlf("<table summary='file diffstat' width='%d%%'><tr>", (max_changes > 100 ? 100 : max_changes));
88 htmlf("<td class='add' style='width: %.1f%%;'/>", 88 htmlf("<td class='add' style='width: %.1f%%;'/>",
89 info->added * 100.0 / max_changes); 89 info->added * 100.0 / max_changes);
90 htmlf("<td class='rem' style='width: %.1f%%;'/>", 90 htmlf("<td class='rem' style='width: %.1f%%;'/>",
91 info->removed * 100.0 / max_changes); 91 info->removed * 100.0 / max_changes);
92 htmlf("<td class='none' style='width: %.1f%%;'/>", 92 htmlf("<td class='none' style='width: %.1f%%;'/>",
93 (max_changes - info->removed - info->added) * 100.0 / max_changes); 93 (max_changes - info->removed - info->added) * 100.0 / max_changes);
94 html("</tr></table></td></tr>\n"); 94 html("</tr></table></td></tr>\n");
95} 95}
96 96
97void cgit_count_diff_lines(char *line, int len) 97void cgit_count_diff_lines(char *line, int len)
98{ 98{
99 if (line && (len > 0)) { 99 if (line && (len > 0)) {
@@ -148,25 +148,25 @@ void cgit_print_commit(char *hex)
148 148
149 if (get_sha1(hex, sha1)) { 149 if (get_sha1(hex, sha1)) {
150 cgit_print_error(fmt("Bad object id: %s", hex)); 150 cgit_print_error(fmt("Bad object id: %s", hex));
151 return; 151 return;
152 } 152 }
153 commit = lookup_commit_reference(sha1); 153 commit = lookup_commit_reference(sha1);
154 if (!commit) { 154 if (!commit) {
155 cgit_print_error(fmt("Bad commit reference: %s", hex)); 155 cgit_print_error(fmt("Bad commit reference: %s", hex));
156 return; 156 return;
157 } 157 }
158 info = cgit_parse_commit(commit); 158 info = cgit_parse_commit(commit);
159 159
160 html("<table class='commit-info'>\n"); 160 html("<table summary='commit info' class='commit-info'>\n");
161 html("<tr><th>author</th><td>"); 161 html("<tr><th>author</th><td>");
162 html_txt(info->author); 162 html_txt(info->author);
163 html(" "); 163 html(" ");
164 html_txt(info->author_email); 164 html_txt(info->author_email);
165 html("</td><td class='right'>"); 165 html("</td><td class='right'>");
166 cgit_print_date(info->author_date, FMT_LONGDATE); 166 cgit_print_date(info->author_date, FMT_LONGDATE);
167 html("</td></tr>\n"); 167 html("</td></tr>\n");
168 html("<tr><th>committer</th><td>"); 168 html("<tr><th>committer</th><td>");
169 html_txt(info->committer); 169 html_txt(info->committer);
170 html(" "); 170 html(" ");
171 html_txt(info->committer_email); 171 html_txt(info->committer_email);
172 html("</td><td class='right'>"); 172 html("</td><td class='right'>");
@@ -200,25 +200,25 @@ void cgit_print_commit(char *hex)
200 hex, cgit_repo->snapshots); 200 hex, cgit_repo->snapshots);
201 html("</td></tr>"); 201 html("</td></tr>");
202 } 202 }
203 html("</table>\n"); 203 html("</table>\n");
204 html("<div class='commit-subject'>"); 204 html("<div class='commit-subject'>");
205 html_txt(info->subject); 205 html_txt(info->subject);
206 html("</div>"); 206 html("</div>");
207 html("<div class='commit-msg'>"); 207 html("<div class='commit-msg'>");
208 html_txt(info->msg); 208 html_txt(info->msg);
209 html("</div>"); 209 html("</div>");
210 if (!(commit->parents && commit->parents->next && commit->parents->next->next)) { 210 if (!(commit->parents && commit->parents->next && commit->parents->next->next)) {
211 html("<div class='diffstat-header'>Diffstat</div>"); 211 html("<div class='diffstat-header'>Diffstat</div>");
212 html("<table class='diffstat'>"); 212 html("<table summary='diffstat' class='diffstat'>");
213 max_changes = 0; 213 max_changes = 0;
214 cgit_diff_commit(commit, inspect_filepair); 214 cgit_diff_commit(commit, inspect_filepair);
215 for(i = 0; i<files; i++) 215 for(i = 0; i<files; i++)
216 print_fileinfo(&items[i]); 216 print_fileinfo(&items[i]);
217 html("</table>"); 217 html("</table>");
218 html("<div class='diffstat-summary'>"); 218 html("<div class='diffstat-summary'>");
219 htmlf("%d files changed, %d insertions, %d deletions (", 219 htmlf("%d files changed, %d insertions, %d deletions (",
220 files, total_adds, total_rems); 220 files, total_adds, total_rems);
221 cgit_diff_link("show diff", NULL, NULL, cgit_query_head, hex, 221 cgit_diff_link("show diff", NULL, NULL, cgit_query_head, hex,
222 NULL, NULL); 222 NULL, NULL);
223 html(")</div>"); 223 html(")</div>");
224 } 224 }