Indexation de la position par utilisation d'un adaptateur, plutôt que d'utiliser...
[Plinn.git] / skins / generic / batch_macros.pt
1 <html>
2 <head>
3 <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
4 </head>
5 <body>
6
7 <!-- Navigation -->
8 <div class="listingBar"
9 metal:define-macro="navigation"
10 tal:define="request request|here/request|container/request|nothing;
11 form form|request/form/copy;
12 dummy python:form.has_key('ajax') and form.pop('ajax');
13 batch batch|nothing;
14 mq python:modules['ZTUtils'].make_query;
15 mpq python:lambda fv,pn=-1 : mq(fv, {batch.b_start_str : pn * (batch.size - batch.overlap) - batch.size}) ;
16 url python:options.get('batchBaseUrl', request.get('URL0'));
17 currentpage batch/pagenumber;"
18 tal:attributes="id navBatchBarId|nothing"
19 tal:condition="python: batch.next or batch.previous"
20 i18n:domain="plinn">
21
22 <a href="" class="previous"
23 tal:define="p batch/previous | nothing"
24 tal:attributes="href python: '%s?%s' % (url , mq( form, {batch.b_start_str:p.first} ))"
25 tal:condition="p">
26 &laquo;&nbsp;<span i18n:translate="batch_previous_x_items" tal:omit-tag="">Previous<span i18n:name="number" tal:content="p/length" tal:omit-tag="">n</span></span>
27 </a>
28 <a href="" class="next"
29 tal:define="n batch/next | nothing"
30 tal:condition="n"
31 tal:attributes="href python: '%s?%s' % (url , mq( form, {batch.b_start_str:n.first} ))">
32 <span i18n:translate="batch_next_x_items" tal:omit-tag="">Next<span i18n:name="number" tal:content="n/length">n</span>items</span>&nbsp;&raquo;
33 </a>
34
35 <span tal:condition="python: 1 not in batch.navlist">
36 <a href="" tal:attributes="href python: '%s?%s' % (url, mq(form,{batch.b_start_str:0}));" tal:content="string:1">Link to first</a>
37 <span tal:condition="python: 2 not in (batch.prevlist or batch.leapback)" tal:omit-tag="">...</span>
38 </span>
39
40 <span tal:repeat="linklist python:batch.navurls(form, batch.leapback)" tal:condition="batch/leapback" tal:omit-tag="" >
41 <a href="" tal:define="page python:linklist[0];query python:mpq(form, page)" tal:content="page" tal:attributes="href python: '%s?%s' % (url,query)" >
42 Pagelist with quantum leap links to previous pages for quick navigation
43 </a>...
44 </span>
45
46 <span tal:repeat="linklist python:batch.prevurls(form)" tal:condition="batch/prevlist" tal:omit-tag="" >
47 <a href="" tal:define="page python:linklist[0]; query python:mpq(form, page);" tal:content="page" tal:attributes="href python: '%s?%s' % (url,query)" >
48 Pagelist with links to previous pages.
49 </a>
50 </span>
51
52 <span tal:condition="batch/navlist" tal:omit-tag="">
53 [<span tal:content="batch/pagenumber">Current page number</span>]
54 </span>
55
56 <span tal:repeat="linklist python:batch.nexturls(form)" tal:condition="batch/nextlist" tal:omit-tag="" >
57 <a href="" tal:define="page python:linklist[0];query python:mpq(form, page);" tal:content="page" tal:attributes="href python: '%s?%s' % (url,query)" >
58 Pagelist with links to next pages
59 </a>
60 </span>
61
62 <span tal:repeat="linklist python:batch.navurls(form, batch.leapforward)" tal:condition="batch/leapforward" tal:omit-tag="" >...
63 <a href="" tal:define="page python:linklist[0]; query python:mpq(form, page)" tal:content="page" tal:attributes="href python: '%s?%s' % (url,query)" >
64 Pagelist with quantum leap links to next pages
65 </a>
66 </span>
67
68 <span tal:condition="python:batch.numpages not in batch.navlist">
69 <span tal:condition="python: batch.numpages - 1 not in (batch.nextlist or batch.leapforward)" tal:omit-tag="">...</span>
70 <a href="" tal:attributes="href python: '%s?%s' % (url,mpq(form,batch.numpages))" tal:content="batch/numpages">Link to last</a>
71 </span>
72
73 </div>
74
75 </body>
76 </html>