List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 1/1] css: highlight even table rows
@ 2016-07-06 20:56 list
  2016-07-06 22:00 ` Jason
  0 siblings, 1 reply; 10+ messages in thread
From: list @ 2016-07-06 20:56 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

This is stolen from kernel.org css [0].

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

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 cgit.css | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/cgit.css b/cgit.css
index a4331f8..e039970 100644
--- a/cgit.css
+++ b/cgit.css
@@ -134,10 +134,22 @@ 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;
 }
-- 
2.9.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] css: highlight even table rows
  2016-07-06 20:56 [PATCH 1/1] css: highlight even table rows list
@ 2016-07-06 22:00 ` Jason
  2016-07-06 22:00   ` Jason
  0 siblings, 1 reply; 10+ messages in thread
From: Jason @ 2016-07-06 22:00 UTC (permalink / raw)


I like all this beautification work you've been sending recently. I'll
give this a try for a little bit on git.zx2c4.com to see how folks
like it, and if it works, I'll merge it.

Thanks a bunch.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] css: highlight even table rows
  2016-07-06 22:00 ` Jason
@ 2016-07-06 22:00   ` Jason
  2016-07-07  6:08     ` list
  0 siblings, 1 reply; 10+ messages in thread
From: Jason @ 2016-07-06 22:00 UTC (permalink / raw)


This seems not to work as well on the log:
https://git.zx2c4.com/cgit/log/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] css: highlight even table rows
  2016-07-06 22:00   ` Jason
@ 2016-07-07  6:08     ` list
  2016-07-07  7:12       ` [PATCH 1/1] ui-log: do not print empty " list
  0 siblings, 1 reply; 10+ messages in thread
From: list @ 2016-07-07  6:08 UTC (permalink / raw)


"Jason A. Donenfeld" <Jason at zx2c4.com> on Thu, 2016/07/07 00:00:
> This seems not to work as well on the log:
> https://git.zx2c4.com/cgit/log/

Works for me... (on a local installation)

Possibly this is caused but the commit graph? I will take a look.
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20160707/c616507d/attachment.asc>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] ui-log: do not print empty table rows
  2016-07-07  6:08     ` list
@ 2016-07-07  7:12       ` list
  2016-07-07 10:28         ` Jason
  0 siblings, 1 reply; 10+ messages in thread
From: list @ 2016-07-07  7:12 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

This saves some bandwidth and unbreaks line highlighting based on even
and odd line numbers.

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 ui-log.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui-log.c b/ui-log.c
index c97b8e0..6592267 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -263,7 +263,8 @@ 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 */
+	if ((revs->graph && !graph_is_commit_finished(revs->graph))
+			|| ctx.qry.showmsg) { /* Print a second table row */
 		html("<tr class='nohover'>");
 
 		if (ctx.qry.showmsg) {
-- 
2.9.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] ui-log: do not print empty table rows
  2016-07-07  7:12       ` [PATCH 1/1] ui-log: do not print empty " list
@ 2016-07-07 10:28         ` Jason
  2016-07-07 10:54           ` list
  0 siblings, 1 reply; 10+ messages in thread
From: Jason @ 2016-07-07 10:28 UTC (permalink / raw)


Hmm, so this fixes the problem with the log highlighting, but it might
not be a full fix:

https://git.zx2c4.com/systemd/log/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] ui-log: do not print empty table rows
  2016-07-07 10:28         ` Jason
@ 2016-07-07 10:54           ` list
  2016-07-07 11:41             ` [PATCH 1/1] css, ui-log: highlight empty rows in commit graph, but do not hover list
  2016-07-12  8:59             ` [PATCH 1/1] ui-log: do not print empty table rows list
  0 siblings, 2 replies; 10+ messages in thread
From: list @ 2016-07-07 10:54 UTC (permalink / raw)


"Jason A. Donenfeld" <Jason at zx2c4.com> on Thu, 2016/07/07 12:28:
> Hmm, so this fixes the problem with the log highlighting, but it might
> not be a full fix:
> 
> https://git.zx2c4.com/systemd/log/

I attached a screenshot from what it looks like currently.

You speak about the rows pointed to by arrows? First one is odd-nohover-odd,
second one is even-nohover-even. As neither odd nor nohover rows are
highlighted we have three white rows here.

As the middle row is blank anyway... We could declare that to be expected. :D
Note that all rows containing text still have hover active.

How would you like it to look like?
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot_2016-07-07_12-42-34.png
Type: image/png
Size: 35800 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20160707/ebf2dd98/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20160707/ebf2dd98/attachment-0001.asc>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] css, ui-log: highlight empty rows in commit graph, but do not hover
  2016-07-07 10:54           ` list
@ 2016-07-07 11:41             ` list
  2016-07-07 12:39               ` [PATCH 1/1] ui-repolist: highlight section rows, " list
  2016-07-12  8:59             ` [PATCH 1/1] ui-log: do not print empty table rows list
  1 sibling, 1 reply; 10+ messages in thread
From: list @ 2016-07-07 11:41 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

Add more CSS to highlight empty rows in commit graph, but do not hover.

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 cgit.css | 8 ++++++++
 ui-log.c | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/cgit.css b/cgit.css
index e039970..1dc2c11 100644
--- a/cgit.css
+++ b/cgit.css
@@ -154,6 +154,14 @@ 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 6592267..ea494af 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -265,7 +265,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
 
 	if ((revs->graph && !graph_is_commit_finished(revs->graph))
 			|| ctx.qry.showmsg) { /* Print a second table row */
-		html("<tr class='nohover'>");
+		html("<tr class='nohover-highlight'>");
 
 		if (ctx.qry.showmsg) {
 			/* Concatenate commit message + notes in msgbuf */
-- 
2.9.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] ui-repolist: highlight section rows, but do not hover
  2016-07-07 11:41             ` [PATCH 1/1] css, ui-log: highlight empty rows in commit graph, but do not hover list
@ 2016-07-07 12:39               ` list
  0 siblings, 0 replies; 10+ messages in thread
From: list @ 2016-07-07 12:39 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 ui-repolist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui-repolist.c b/ui-repolist.c
index 30915df..bef565a 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -320,7 +320,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>");
-- 
2.9.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] ui-log: do not print empty table rows
  2016-07-07 10:54           ` list
  2016-07-07 11:41             ` [PATCH 1/1] css, ui-log: highlight empty rows in commit graph, but do not hover list
@ 2016-07-12  8:59             ` list
  1 sibling, 0 replies; 10+ messages in thread
From: list @ 2016-07-12  8:59 UTC (permalink / raw)


Christian Hesse <list at eworm.de> on Thu, 2016/07/07 12:54:
> "Jason A. Donenfeld" <Jason at zx2c4.com> on Thu, 2016/07/07 12:28:
> > Hmm, so this fixes the problem with the log highlighting, but it might
> > not be a full fix:
> > 
> > https://git.zx2c4.com/systemd/log/  
> 
> I attached a screenshot from what it looks like currently.
> 
> You speak about the rows pointed to by arrows? First one is odd-nohover-odd,
> second one is even-nohover-even. As neither odd nor nohover rows are
> highlighted we have three white rows here.
> 
> As the middle row is blank anyway... We could declare that to be
> expected. :D Note that all rows containing text still have hover active.
> 
> How would you like it to look like?

Any comment on this? Did you notice my follow up patches?
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20160712/86e14e74/attachment.asc>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-07-12  8:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-06 20:56 [PATCH 1/1] css: highlight even table rows list
2016-07-06 22:00 ` Jason
2016-07-06 22:00   ` Jason
2016-07-07  6:08     ` list
2016-07-07  7:12       ` [PATCH 1/1] ui-log: do not print empty " list
2016-07-07 10:28         ` Jason
2016-07-07 10:54           ` list
2016-07-07 11:41             ` [PATCH 1/1] css, ui-log: highlight empty rows in commit graph, but do not hover list
2016-07-07 12:39               ` [PATCH 1/1] ui-repolist: highlight section rows, " list
2016-07-12  8:59             ` [PATCH 1/1] ui-log: do not print empty table rows list

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).