]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-log.c
ui-log: use css to make full-log prettier
[ps-cgit] / ui-log.c
index 631e46da94509a833b5305a9c6b14e13744e7b00..00ecd4e3e0c8d3200a716c77daacb00b4a62da2b 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -35,21 +35,20 @@ void print_commit(struct commit *commit)
 {
        struct commitinfo *info;
        char *tmp;
+       int cols = 2;
 
        info = cgit_parse_commit(commit);
-       html("<tr><td>");
+       htmlf("<tr%s><td>",
+               ctx.qry.showmsg ? " class='logheader'" : "");
        tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
        tmp = cgit_pageurl(ctx.repo->url, "commit", tmp);
        html_link_open(tmp, NULL, NULL);
        cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
        html_link_close();
-       html("</td><td>");
-       if (ctx.qry.showmsg)
-               html("<u>");
+       htmlf("</td><td%s>",
+               ctx.qry.showmsg ? " class='logsubject'" : "");
        cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
                         sha1_to_hex(commit->object.sha1));
-       if (ctx.qry.showmsg)
-               html("</u>");
        html("</td><td>");
        html_txt(info->author);
        if (ctx.repo->enable_log_filecount) {
@@ -66,15 +65,15 @@ void print_commit(struct commit *commit)
        }
        html("</td></tr>\n");
        if (ctx.qry.showmsg) {
-               html("<tr class='nohover'><td></td><td><div class='commit-msg'>");
-               html_txt(info->msg);
-               html("</div><br/></td><td></td>");
                if (ctx.repo->enable_log_filecount) {
-                       html("<td></td>");
+                       cols++;
                        if (ctx.repo->enable_log_linecount)
-                               html("<td></td>");
+                               cols++;
                }
-               html("</tr>\n");
+               htmlf("<tr class='nohover'><td/><td colspan='%d' class='logmsg'>",
+                       cols);
+               html_txt(info->msg);
+               html("</td></tr>\n");
        }
        cgit_free_commitinfo(info);
 }