List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] Convert pager navigation into a unordered list
@ 2013-03-07  7:56 cgit
  2013-03-20 20:03 ` Jason
  0 siblings, 1 reply; 5+ messages in thread
From: cgit @ 2013-03-07  7:56 UTC (permalink / raw)


It is common practice and semantically appropriate to use unordered
lists for long navigation lists.

This also fixes the layout of very long pager navigations in
Webkit-based browsers.

Signed-off-by: Lukas Fleischer <cgit at cryptocrack.de>
---
 cgit.css      | 14 ++++++++++----
 ui-log.c      |  9 ++++++---
 ui-repolist.c |  6 ++++--
 3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/cgit.css b/cgit.css
index 54da076..a50d62b 100644
--- a/cgit.css
+++ b/cgit.css
@@ -538,17 +538,23 @@ div#cgit table.list td.sublevel-repo {
 	padding-left: 1.5em;
 }
 
-div#cgit div.pager {
+div#cgit ul.pager {
+	list-style-type: none;
 	text-align: center;
 	margin: 1em 0em 0em 0em;
+	padding: 0;
 }
 
-div#cgit div.pager a {
+div#cgit ul.pager li {
+	display: inline-block;
+	margin: 0.25em 0.5em;
+}
+
+div#cgit ul.pager a {
 	color: #777;
-	margin: 0em 0.5em;
 }
 
-div#cgit div.pager .current {
+div#cgit ul.pager .current {
 	font-weight: bold;
 }
 
diff --git a/ui-log.c b/ui-log.c
index 954d3e1..aaffb4e 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -405,21 +405,24 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
 		commit->parents = NULL;
 	}
 	if (pager) {
-		html("</table><div class='pager'>");
+		html("</table><ul class='pager'>");
 		if (ofs > 0) {
+			html("<li>");
 			cgit_log_link("[prev]", NULL, NULL, ctx.qry.head,
 				      ctx.qry.sha1, ctx.qry.vpath,
 				      ofs - cnt, ctx.qry.grep,
 				      ctx.qry.search, ctx.qry.showmsg);
-			html("&nbsp;");
+			html("</li>");
 		}
 		if ((commit = get_revision(&rev)) != NULL) {
+			html("<li>");
 			cgit_log_link("[next]", NULL, NULL, ctx.qry.head,
 				      ctx.qry.sha1, ctx.qry.vpath,
 				      ofs + cnt, ctx.qry.grep,
 				      ctx.qry.search, ctx.qry.showmsg);
+			html("</li>");
 		}
-		html("</div>");
+		html("</ul>");
 	} else if ((commit = get_revision(&rev)) != NULL) {
 		htmlf("<tr class='nohover'><td colspan='%d'>", columns);
 		cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL,
diff --git a/ui-repolist.c b/ui-repolist.c
index 66c88c4..a9751f6 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -128,13 +128,15 @@ static void print_pager(int items, int pagelen, char *search, char *sort)
 {
 	int i, ofs;
 	char *class = NULL;
-	html("<div class='pager'>");
+	html("<ul class='pager'>");
 	for (i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) {
 		class = (ctx.qry.ofs == ofs) ? "current" : NULL;
+		html("<li>");
 		cgit_index_link(fmt("[%d]", i + 1), fmt("Page %d", i + 1),
 				class, search, sort, ofs);
+		html("</li>");
 	}
-	html("</div>");
+	html("</ul>");
 }
 
 static int cmp(const char *s1, const char *s2)
-- 
1.8.2.rc2.352.g908df73





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

* [PATCH] Convert pager navigation into a unordered list
  2013-03-07  7:56 [PATCH] Convert pager navigation into a unordered list cgit
@ 2013-03-20 20:03 ` Jason
  2013-03-22  9:59   ` william.bell
  0 siblings, 1 reply; 5+ messages in thread
From: Jason @ 2013-03-20 20:03 UTC (permalink / raw)


Merged to lf/unordered-list to try it out for a bit.




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

* [PATCH] Convert pager navigation into a unordered list
  2013-03-20 20:03 ` Jason
@ 2013-03-22  9:59   ` william.bell
  2013-03-22 10:03     ` cgit
  0 siblings, 1 reply; 5+ messages in thread
From: william.bell @ 2013-03-22  9:59 UTC (permalink / raw)


On 20/03/2013 22:03, Jason A. Donenfeld wrote:
> Merged to lf/unordered-list to try it out for a bit.
>
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit
>


The css should be adjusted as it looks very ugly, having an unordered 
list of all the pages at the bottom of the page.
In my own build of the wip branch I reverted this patch because I prefer 
how it used to look.




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

* [PATCH] Convert pager navigation into a unordered list
  2013-03-22  9:59   ` william.bell
@ 2013-03-22 10:03     ` cgit
  2013-03-22 10:08       ` william.bell
  0 siblings, 1 reply; 5+ messages in thread
From: cgit @ 2013-03-22 10:03 UTC (permalink / raw)


On Fri, Mar 22, 2013 at 11:59:20AM +0200, William Bell wrote:
> On 20/03/2013 22:03, Jason A. Donenfeld wrote:
> >Merged to lf/unordered-list to try it out for a bit.
> >
> >_______________________________________________
> >cgit mailing list
> >cgit at hjemli.net
> >http://hjemli.net/mailman/listinfo/cgit
> >
> 
> 
> The css should be adjusted as it looks very ugly, having an
> unordered list of all the pages at the bottom of the page.
> In my own build of the wip branch I reverted this patch because I
> prefer how it used to look.

It actually is adjusted and the list shouldn't look different to how it
looked before. Are you sure you reinstalled/updated your CSS and cleared
the cache?

> 
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit




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

* [PATCH] Convert pager navigation into a unordered list
  2013-03-22 10:03     ` cgit
@ 2013-03-22 10:08       ` william.bell
  0 siblings, 0 replies; 5+ messages in thread
From: william.bell @ 2013-03-22 10:08 UTC (permalink / raw)




On 22/03/2013 12:03, Lukas Fleischer wrote:
> On Fri, Mar 22, 2013 at 11:59:20AM +0200, William Bell wrote:
>> On 20/03/2013 22:03, Jason A. Donenfeld wrote:
>>> Merged to lf/unordered-list to try it out for a bit.
>>>
>>> _______________________________________________
>>> cgit mailing list
>>> cgit at hjemli.net
>>> http://hjemli.net/mailman/listinfo/cgit
>>>
>>
>>
>> The css should be adjusted as it looks very ugly, having an
>> unordered list of all the pages at the bottom of the page.
>> In my own build of the wip branch I reverted this patch because I
>> prefer how it used to look.
>
> It actually is adjusted and the list shouldn't look different to how it
> looked before. Are you sure you reinstalled/updated your CSS and cleared
> the cache?
>
>>
>> _______________________________________________
>> cgit mailing list
>> cgit at hjemli.net
>> http://hjemli.net/mailman/listinfo/cgit
>
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit
>

My bad, will update to the new css.




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

end of thread, other threads:[~2013-03-22 10:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07  7:56 [PATCH] Convert pager navigation into a unordered list cgit
2013-03-20 20:03 ` Jason
2013-03-22  9:59   ` william.bell
2013-03-22 10:03     ` cgit
2013-03-22 10:08       ` william.bell

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).