]> granicus.if.org Git - cgit/commitdiff
css: highlight even table rows and skip empty rows
authorChristian Hesse <mail@eworm.de>
Wed, 6 Jul 2016 20:42:36 +0000 (22:42 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 23 Nov 2016 04:20:42 +0000 (05:20 +0100)
This is stolen from kernel.org css [0].

[0] https://git.kernel.org/cgit-korg-0.10.1.css

cgit.css
ui-log.c
ui-repolist.c

index a4331f8afc04d717c642697629b7450c811778ea..1dc2c11c203ca654d93e801e8e881447af6b941a 100644 (file)
--- a/cgit.css
+++ b/cgit.css
@@ -134,14 +134,34 @@ div#cgit table.list tr.logheader {
        background: #eee;
 }
 
+div#cgit table.list tr:nth-child(even) {
+       background: #f7f7f7;
+}
+
+div#cgit table.list tr:nth-child(odd) {
+       background: white;
+}
+
 div#cgit table.list tr:hover {
        background: #eee;
 }
 
+div#cgit table.list tr.nohover {
+       background: white;
+}
+
 div#cgit table.list tr.nohover:hover {
        background: white;
 }
 
+div#cgit table.list tr.nohover-highlight:hover:nth-child(even) {
+       background: #f7f7f7;
+}
+
+div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) {
+       background: white;
+}
+
 div#cgit table.list th {
        font-weight: bold;
        /* color: #888;
index 6cc81a3b1dce99fee225603b9991b738ffd97e73..3220fd98aad9c7e65ea3307db361ea7b8a718ff0 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -263,8 +263,9 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
 
        html("</td></tr>\n");
 
-       if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */
-               html("<tr class='nohover'>");
+       if ((revs->graph && !graph_is_commit_finished(revs->graph))
+                       || ctx.qry.showmsg) { /* Print a second table row */
+               html("<tr class='nohover-highlight'>");
 
                if (ctx.qry.showmsg) {
                        /* Concatenate commit message + notes in msgbuf */
index 7158bf7cf643b3b90c47cfab040796ff013ad2ea..b57ea60c4cf2113d294808360465777224edd395 100644 (file)
@@ -321,7 +321,7 @@ void cgit_print_repolist(void)
                    (last_section != NULL && section == NULL) ||
                    (last_section != NULL && section != NULL &&
                     strcmp(section, last_section)))) {
-                       htmlf("<tr class='nohover'><td colspan='%d' class='reposection'>",
+                       htmlf("<tr class='nohover-highlight'><td colspan='%d' class='reposection'>",
                              columns);
                        html_txt(section);
                        html("</td></tr>");