From 81509a228c7428abeb56ecacb45ccd8dc8fc6209 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 6 Jul 2016 22:42:36 +0200 Subject: css: highlight even table rows and skip empty rows This is stolen from kernel.org css [0]. [0] https://git.kernel.org/cgit-korg-0.10.1.css --- cgit.css | 20 ++++++++++++++++++++ ui-log.c | 5 +++-- ui-repolist.c | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/cgit.css b/cgit.css index a4331f8..1dc2c11 100644 --- 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; diff --git a/ui-log.c b/ui-log.c index 6cc81a3..3220fd9 100644 --- a/ui-log.c +++ b/ui-log.c @@ -263,8 +263,9 @@ static void print_commit(struct commit *commit, struct rev_info *revs) html("\n"); - if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */ - html(""); + if ((revs->graph && !graph_is_commit_finished(revs->graph)) + || ctx.qry.showmsg) { /* Print a second table row */ + html(""); if (ctx.qry.showmsg) { /* Concatenate commit message + notes in msgbuf */ diff --git a/ui-repolist.c b/ui-repolist.c index 7158bf7..b57ea60 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -321,7 +321,7 @@ void cgit_print_repolist(void) (last_section != NULL && section == NULL) || (last_section != NULL && section != NULL && strcmp(section, last_section)))) { - htmlf("", + htmlf("", columns); html_txt(section); html(""); -- cgit 1.4.1