From: paul Date: Wed, 18 May 2016 11:28:52 +0000 (+0000) Subject: quicker pagination interface X-Git-Url: http://git.plutz.net/?p=serve0;a=commitdiff_plain;h=786aed0b30898b274814926a4f5548447a5e29c5 quicker pagination interface svn path=/trunk/; revision=131 --- diff --git a/static/common.css b/static/common.css index 2189498..9b32b52 100644 --- a/static/common.css +++ b/static/common.css @@ -70,13 +70,16 @@ textarea { text-decoration: none; } +.pagination_nav a.previous, +.pagination_nav a.current, +.pagination_nav a.next { display: inline; } .pagination_nav a.current { - display: inline; color: #F66; font-weight: bold; } .pagination_nav:hover { position: fixed; + padding-top: 2.5em; bottom: auto; text-align: right; background-color: #333; diff --git a/templates/list.html.sh b/templates/list.html.sh index 859878d..0d6d654 100755 --- a/templates/list.html.sh +++ b/templates/list.html.sh @@ -35,11 +35,22 @@ cat <Page: EOF + pages="$( seq 1 $(pagecount) \ | while read pn; do plink="$(($pn * $pagesize - $pagesize + 1))" - printf '%s\n' "$([ $plink = $page ] && printf class=current)" "$page_link" "$plink" "$pn" + + case "$plink" in + $(($page - $pagesize))) class=previous;; + $page) class=current;; + $(($page + $pagesize))) class=next;; + * ) class='';; + esac + + printf '%s\n' "$class" "$page_link" "$plink" "$pn" done + )" + printf %s "$pages" cat < @@ -63,12 +74,7 @@ cat < - $(seq 1 $(pagecount) \ - | while read pn; do - plink="$(($pn * $pagesize - $pagesize + 1))" - printf '%s\n' "$([ $plink = $page ] && printf class=current)" "$page_link" "$plink" "$pn" - done - ) + ${pages}