diff options
author | Christian Hesse | 2016-07-06 22:42:36 +0200 |
---|---|---|
committer | Jason A. Donenfeld | 2016-11-23 05:20:42 +0100 |
commit | 81509a228c7428abeb56ecacb45ccd8dc8fc6209 (patch) | |
tree | b60adc2400493c4de91c6550ecce6f786ec7e5c3 | |
parent | 44f8c11c8d6edadedb9b83baf6f6a786c0bd8c30 (diff) | |
download | cgit-81509a228c7428abeb56ecacb45ccd8dc8fc6209.tar.gz cgit-81509a228c7428abeb56ecacb45ccd8dc8fc6209.tar.bz2 cgit-81509a228c7428abeb56ecacb45ccd8dc8fc6209.zip |
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
-rw-r--r-- | cgit.css | 20 | ||||
-rw-r--r-- | ui-log.c | 5 | ||||
-rw-r--r-- | ui-repolist.c | 2 |
3 files changed, 24 insertions, 3 deletions
@@ -134,14 +134,34 @@ div#cgit table.list tr.logheader { | |||
134 | background: #eee; | 134 | background: #eee; |
135 | } | 135 | } |
136 | 136 | ||
137 | div#cgit table.list tr:nth-child(even) { | ||
138 | background: #f7f7f7; | ||
139 | } | ||
140 | |||
141 | div#cgit table.list tr:nth-child(odd) { | ||
142 | background: white; | ||
143 | } | ||
144 | |||
137 | div#cgit table.list tr:hover { | 145 | div#cgit table.list tr:hover { |
138 | background: #eee; | 146 | background: #eee; |
139 | } | 147 | } |
140 | 148 | ||
149 | div#cgit table.list tr.nohover { | ||
150 | background: white; | ||
151 | } | ||
152 | |||
141 | div#cgit table.list tr.nohover:hover { | 153 | div#cgit table.list tr.nohover:hover { |
142 | background: white; | 154 | background: white; |
143 | } | 155 | } |
144 | 156 | ||
157 | div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { | ||
158 | background: #f7f7f7; | ||
159 | } | ||
160 | |||
161 | div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { | ||
162 | background: white; | ||
163 | } | ||
164 | |||
145 | div#cgit table.list th { | 165 | div#cgit table.list th { |
146 | font-weight: bold; | 166 | font-weight: bold; |
147 | /* color: #888; | 167 | /* color: #888; |
@@ -263,8 +263,9 @@ static void print_commit(struct commit *commit, struct rev_info *revs) | |||
263 | 263 | ||
264 | html("</td></tr>\n"); | 264 | html("</td></tr>\n"); |
265 | 265 | ||
266 | if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */ | 266 | if ((revs->graph && !graph_is_commit_finished(revs->graph)) |
267 | html("<tr class='nohover'>"); | 267 | || ctx.qry.showmsg) { /* Print a second table row */ |
268 | html("<tr class='nohover-highlight'>"); | ||
268 | 269 | ||
269 | if (ctx.qry.showmsg) { | 270 | if (ctx.qry.showmsg) { |
270 | /* Concatenate commit message + notes in msgbuf */ | 271 | /* 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) | |||
321 | (last_section != NULL && section == NULL) || | 321 | (last_section != NULL && section == NULL) || |
322 | (last_section != NULL && section != NULL && | 322 | (last_section != NULL && section != NULL && |
323 | strcmp(section, last_section)))) { | 323 | strcmp(section, last_section)))) { |
324 | htmlf("<tr class='nohover'><td colspan='%d' class='reposection'>", | 324 | htmlf("<tr class='nohover-highlight'><td colspan='%d' class='reposection'>", |
325 | columns); | 325 | columns); |
326 | html_txt(section); | 326 | html_txt(section); |
327 | html("</td></tr>"); | 327 | html("</td></tr>"); |