summaryrefslogtreecommitdiffstats
path: root/tabellio/searchform/batch_macros.pt
blob: ca12bca98a67c54181a92e96079e0a367cab5674 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      i18n:domain="plone">
<body>

<tal:comment condition="nothing">You can feed in batch_base_url by enclosing
the metal:use-macro="context/batch_macros/macros/navigation" statement in your
template with a tal:define="batch_base_url YOUR_BASE_URL" tales expression.
</tal:comment>
<div id="results-nav" class="listingBar"
     metal:define-macro="navigation"
     tal:define="request request|context/request|container/request|nothing;
                 batch batch|nothing;
                 batchformkeys batchformkeys|nothing;
                 batchlinkparams view/get_batchlinkparams;
                 mq python:modules['ZTUtils'].make_query;
                 url batch_base_url | request/ACTUAL_URL;
                 currentpage batch/pagenumber;"
     tal:condition="python: batch.next or  batch.previous">

    <tal:block tal:define="p batch/previous | nothing">
      <a href="" id="results-nav-prev" tal:condition="p"
         tal:attributes="href python: '%s?%s#%s' % (url , mq( batchlinkparams, {batch.b_start_str:p.first} ), batch.b_start_str)">
         &laquo;
         <span i18n:translate="batch_previous_x_items" tal:omit-tag="">
             Previous
             <span i18n:name="number" tal:omit-tag="" tal:content="p/length">n</span>
             items
         </span>
      </a>
      <span id="results-nav-prev" tal:condition="not: p">
         &laquo;
         <span i18n:translate="batch_previous_x_items" tal:omit-tag="">
             Previous
             <span i18n:name="number" tal:omit-tag="" tal:content="b_size">n</span>
             items
         </span>
      </span>
    </tal:block>

    <tal:block tal:define="n batch/next | nothing">
      <a href="" id="results-nav-next" tal:condition="n"
         tal:attributes="href python: '%s?%s#%s' % (url , mq( batchlinkparams, {batch.b_start_str:n.first} ), batch.b_start_str)">
         <span i18n:translate="batch_next_x_items" tal:omit-tag="">
             Next
             <span i18n:name="number" tal:omit-tag="" tal:content="n/length">n</span>
             items
         </span>
         &raquo;
      </a>
      <span id="results-nav-next" tal:condition="not: n">
         <span i18n:translate="batch_next_x_items" tal:omit-tag="">
             Next
             <span i18n:name="number" tal:omit-tag="" tal:content="b_size">n</span>
             items
         </span>
         &raquo;
      </span>
    </tal:block>

    <span class="pager">Page : </span>

    <tal:comment tal:condition="nothing">
      Link to first
    </tal:comment>
    <span tal:condition="python: 1 not in batch.navlist">
        <a href=""
           tal:attributes="href python: '%s?%s#%s' % (url, batch.pageurl(batchlinkparams,1), batch.b_start_str);">1</a>
        <span tal:condition="python: 2 not in (batch.prevlist or batch.leapback)"
              tal:omit-tag="">
           &hellip;
        </span>
    </span>

    <tal:comment tal:condition="nothing">
      Pagelist with quantum leap links to previous pages for quick navigation
    </tal:comment>
    <span tal:repeat="linklist python:batch.navurls(batchlinkparams, batch.leapback)"
          tal:condition="batch/leapback"
          tal:omit-tag="" >
        <a href=""
           tal:define="page python:linklist[0];
                       query python:linklist[1];"
           tal:content="page"
           tal:attributes="href python: '%s?%s#%s' % (url,query, batch.b_start_str)" >
        </a>
        &hellip;
    </span>

    <tal:comment tal:condition="nothing">
      Pagelist with links to previous pages for quick navigation
    </tal:comment>
    <span tal:repeat="linklist python:batch.prevurls(batchlinkparams)"
          tal:condition="batch/prevlist"
          tal:omit-tag="" >
        <a href=""
           tal:define="page python:linklist[0];
                       query python:linklist[1];"
           tal:content="page"
           tal:attributes="href python: '%s?%s#%s' % (url,query, batch.b_start_str)" >
        </a>
    </span>

    <tal:comment tal:replace="nothing">
      Current page
    </tal:comment>
    <span tal:condition="batch/navlist" class="current"
           tal:content="batch/pagenumber">Current page number</span>

    <tal:comment tal:replace="nothing">
      Pagelist with links to next pages for quick navigation
    </tal:comment>
    <span tal:repeat="linklist python:batch.nexturls(batchlinkparams)"
          tal:condition="batch/nextlist"
          tal:omit-tag="" >
        <a href=""
           tal:define="page python:linklist[0];
                       query python:linklist[1];"
           tal:content="page"
           tal:attributes="href python: '%s?%s#%s' % (url,query, batch.b_start_str)" >
        </a>
    </span>

    <tal:comment tal:replace="nothing">
      Pagelist with quantum leap links to next pages for quick navigation
    </tal:comment>
    <span tal:repeat="linklist python:batch.navurls(batchlinkparams, batch.leapforward)"
          tal:condition="batch/leapforward"
          tal:omit-tag="" >
        &hellip;
        <a href=""
           tal:define="page python:linklist[0];
                       query python:linklist[1];"
           tal:content="page"
           tal:attributes="href python: '%s?%s#%s' % (url,query,batch.b_start_str)" >
        </a>
    </span>

    <tal:comment tal:replace="nothing">
      Link to last
    </tal:comment>
    <span tal:condition="python:batch.numpages not in batch.navlist">
        <span tal:condition="python: batch.numpages - 1 not in (batch.nextlist or batch.leapforward)"
              tal:omit-tag="">
        &hellip;
        </span>
        <a href=""
           tal:attributes="href python: '%s?%s#%s' % (url,batch.pageurl(batchlinkparams,batch.numpages), batch.b_start_str);"
           tal:content="batch/numpages">3457</a>
    </span>

</div>

<div id="results-feed"
     metal:define-macro="feed"
     tal:define="
                 batch batch|nothing;
                 batchformkeys batchformkeys|nothing;
                 batchlinkparams view/get_batchlinkparams;
                 ">
<a tal:attributes="href python: 'feed?%s' % batch.pageurl(batchlinkparams,1);">Abonnez-vous au flux de cette recherche</a>
<span class="note">(une application ou extension dédiée de lecture de fil RSS peut être nécessaire).</span>
</div>

</body>
</html>