summaryrefslogtreecommitdiffabout
path: root/ui-log.c
Unidiff
Diffstat (limited to 'ui-log.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-log.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ui-log.c b/ui-log.c
index adc9a66..00ecd4e 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -33,29 +33,27 @@ void inspect_files(struct diff_filepair *pair)
33 33
34void print_commit(struct commit *commit) 34void print_commit(struct commit *commit)
35{ 35{
36 struct commitinfo *info; 36 struct commitinfo *info;
37 char *tmp; 37 char *tmp;
38 int cols = 2; 38 int cols = 2;
39 39
40 info = cgit_parse_commit(commit); 40 info = cgit_parse_commit(commit);
41 html("<tr><td>"); 41 htmlf("<tr%s><td>",
42 ctx.qry.showmsg ? " class='logheader'" : "");
42 tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1)); 43 tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
43 tmp = cgit_pageurl(ctx.repo->url, "commit", tmp); 44 tmp = cgit_pageurl(ctx.repo->url, "commit", tmp);
44 html_link_open(tmp, NULL, NULL); 45 html_link_open(tmp, NULL, NULL);
45 cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); 46 cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
46 html_link_close(); 47 html_link_close();
47 html("</td><td>"); 48 htmlf("</td><td%s>",
48 if (ctx.qry.showmsg) 49 ctx.qry.showmsg ? " class='logsubject'" : "");
49 html("<u>");
50 cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, 50 cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
51 sha1_to_hex(commit->object.sha1)); 51 sha1_to_hex(commit->object.sha1));
52 if (ctx.qry.showmsg)
53 html("</u>");
54 html("</td><td>"); 52 html("</td><td>");
55 html_txt(info->author); 53 html_txt(info->author);
56 if (ctx.repo->enable_log_filecount) { 54 if (ctx.repo->enable_log_filecount) {
57 files = 0; 55 files = 0;
58 add_lines = 0; 56 add_lines = 0;
59 rem_lines = 0; 57 rem_lines = 0;
60 cgit_diff_commit(commit, inspect_files); 58 cgit_diff_commit(commit, inspect_files);
61 html("</td><td>"); 59 html("</td><td>");
@@ -67,20 +65,20 @@ void print_commit(struct commit *commit)
67 } 65 }
68 html("</td></tr>\n"); 66 html("</td></tr>\n");
69 if (ctx.qry.showmsg) { 67 if (ctx.qry.showmsg) {
70 if (ctx.repo->enable_log_filecount) { 68 if (ctx.repo->enable_log_filecount) {
71 cols++; 69 cols++;
72 if (ctx.repo->enable_log_linecount) 70 if (ctx.repo->enable_log_linecount)
73 cols++; 71 cols++;
74 } 72 }
75 htmlf("<tr class='nohover'><td></td><td colspan='%d'><div class='commit-msg'>", 73 htmlf("<tr class='nohover'><td/><td colspan='%d' class='logmsg'>",
76 cols); 74 cols);
77 html_txt(info->msg); 75 html_txt(info->msg);
78 html("</div><br/></td></tr>\n"); 76 html("</td></tr>\n");
79 } 77 }
80 cgit_free_commitinfo(info); 78 cgit_free_commitinfo(info);
81} 79}
82 80
83 81
84void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, 82void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern,
85 char *path, int pager) 83 char *path, int pager)
86{ 84{