summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.css6
-rw-r--r--ui-commit.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/cgit.css b/cgit.css
index 87fd00a..5cf8d15 100644
--- a/cgit.css
+++ b/cgit.css
@@ -227,27 +227,31 @@ table.commit-info td {
227div.commit-subject { 227div.commit-subject {
228 font-weight: bold; 228 font-weight: bold;
229 font-size: 125%; 229 font-size: 125%;
230 margin: 1.5em 0em 0.5em 0em; 230 margin: 1.5em 0em 0.5em 0em;
231 padding: 0em; 231 padding: 0em;
232} 232}
233 233
234div.commit-msg { 234div.commit-msg {
235 white-space: pre; 235 white-space: pre;
236 font-family: monospace; 236 font-family: monospace;
237} 237}
238 238
239div.diffstat-header {
240 font-weight: bold;
241 padding-top: 1.5em;
242}
243
239table.diffstat { 244table.diffstat {
240 border-collapse: collapse; 245 border-collapse: collapse;
241 margin-top: 1.5em;
242 width: 100%; 246 width: 100%;
243 border: solid 1px #aaa; 247 border: solid 1px #aaa;
244 background-color: #eee; 248 background-color: #eee;
245} 249}
246 250
247table.diffstat tr:hover { 251table.diffstat tr:hover {
248 background-color: #ccc; 252 background-color: #ccc;
249} 253}
250 254
251table.diffstat th { 255table.diffstat th {
252 font-weight: normal; 256 font-weight: normal;
253 text-align: left; 257 text-align: left;
diff --git a/ui-commit.c b/ui-commit.c
index 93eb8fd..ff1fad3 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -212,25 +212,29 @@ void cgit_print_commit(const char *hex)
212 html_attr(cgit_pageurl(cgit_query_repo, "snapshot", 212 html_attr(cgit_pageurl(cgit_query_repo, "snapshot",
213 fmt("id=%s&name=%s", hex, filename))); 213 fmt("id=%s&name=%s", hex, filename)));
214 htmlf("'>%s</a></td></tr>", filename); 214 htmlf("'>%s</a></td></tr>", filename);
215 } 215 }
216 html("</table>\n"); 216 html("</table>\n");
217 html("<div class='commit-subject'>"); 217 html("<div class='commit-subject'>");
218 html_txt(info->subject); 218 html_txt(info->subject);
219 html("</div>"); 219 html("</div>");
220 html("<div class='commit-msg'>"); 220 html("<div class='commit-msg'>");
221 html_txt(info->msg); 221 html_txt(info->msg);
222 html("</div>"); 222 html("</div>");
223 if (!(commit->parents && commit->parents->next && commit->parents->next->next)) { 223 if (!(commit->parents && commit->parents->next && commit->parents->next->next)) {
224 html("<div class='diffstat-header'>Diffstat</div>");
224 html("<table class='diffstat'>"); 225 html("<table class='diffstat'>");
225 max_changes = 0; 226 max_changes = 0;
226 cgit_diff_commit(commit, inspect_filepair); 227 cgit_diff_commit(commit, inspect_filepair);
227 for(i = 0; i<files; i++) 228 for(i = 0; i<files; i++)
228 print_fileinfo(&items[i]); 229 print_fileinfo(&items[i]);
229 html("</table>"); 230 html("</table>");
230 html("<div class='diffstat-summary'>"); 231 html("<div class='diffstat-summary'>");
231 htmlf("%d files changed, %d insertions, %d deletions\n", 232 htmlf("%d files changed, %d insertions, %d deletions (",
232 files, total_adds, total_rems); 233 files, total_adds, total_rems);
234 query = fmt("h=%s", hex);
235 html_link_open(cgit_pageurl(cgit_query_repo, "diff", query), NULL, NULL);
236 html("show diff</a>)");
233 html("</div>"); 237 html("</div>");
234 } 238 }
235 cgit_free_commitinfo(info); 239 cgit_free_commitinfo(info);
236} 240}