flip

log tags | changeset raw browse | file diff annotate file log raw

view pageindex.tpl @ 11:a8834c7397c4

fix bug in link to original file
author yiyus@1936
date Sat Jun 05 20:08:40 2010 +0200 (23 months ago ago)
parents 55ec17785862
children

1 % pages_base=`{echo $pages_doc | sed 's|sites|http:/|'} # this is not the way
2 % page_last=`{echo $page_num $page_tot | awk '{l=int($1/50)*50+50; if(l>$2) l=$2; print l}'}
3 <h2 style="text-transform:capitalize">%{echo $name | sed 's/_/ /g'%}
4 % echo '('$page_num'-'$page_last')'
5 </h2>
6 <div class="top-menu">
7 % if (test $page_tot -gt 50){
8 % pagelist | awk '
9 % (NR-1)%50 != 0 {next}
10 % {nf=NR+50-1}
11 % NR+50>'$page_tot' {nf='$page_tot'}
12 % {sub($0, "<a href=\"'$pages_base'/" NR "-" nf "\">(" NR "-" nf ")</a>")
13 % print}'
14 % }
15 </div>
16 <div style="text-align:right">
17 <a href="%{echo -n $pages_base^'.'^`{echo $pages_file | sed 's/.*\.//'}%}">%{echo -n `{ls -p $pages_file}%}</a>
18 </div>
19 % pagethumbs | sed -n $"page_num','$page_last'p'
20 <br>
21 % awk 'BEGIN {s=50; n='$page_num'+s; if(n<'$page_tot')
22 % print "<div style=\"text-align:right\"><a href=\"'$pages_base'/" n "-\">(next " s ")</a></div>"}'