Commit | Line | Data |
7adfd53f |
1 | [% |
2 | |
3 | main_block = 'pager_main'; |
4 | |
5 | start_block = 'pager_start'; |
6 | prev_block = 'pager_prev'; |
7 | current_block = 'pager_current'; |
8 | next_block = 'pager_next'; |
9 | end_block = 'pager_end'; |
10 | list_block = 'pager_list'; |
11 | |
12 | start_label_block = 'pager_start_label'; |
13 | prev_label_block = 'pager_prev_label'; |
14 | current_label_block = 'pager_current_label'; |
15 | next_label_block = 'pager_next_label'; |
16 | end_label_block = 'pager_end_label'; |
17 | list_label_block = 'pager_list_label'; |
18 | |
19 | BLOCK pager_main; |
20 | |
21 | '<div>[ '; |
22 | data = []; |
23 | |
24 | str = BLOCK; include( 'start_block' ); END; |
25 | data.push(str) IF str; |
26 | |
27 | str = BLOCK; include( 'prev_block' ); END; |
28 | data.push(str) IF str; |
29 | |
30 | str = BLOCK; include( 'current_block' ); END; |
31 | data.push(str) IF str; |
32 | |
33 | str = BLOCK; include( 'next_block' ); END; |
34 | data.push(str) IF str; |
35 | |
36 | str = BLOCK; include( 'end_block' ); END; |
37 | data.push(str) IF str; |
38 | |
39 | data.join(" |\n"); |
40 | " ]</div>\n"; |
41 | |
42 | END; |
43 | |
44 | BLOCK pager_start; |
45 | |
46 | %]<a [% connect_href(self, 'page' => self.pager.first_page); process_attrs(attrs) %]>[% |
47 | include( 'start_label_block' ) %]</a>[% |
48 | |
49 | END; |
50 | |
51 | BLOCK pager_start_label; |
52 | |
53 | loc('Start'); ' ('; self.pager.first_page; ')'; |
54 | |
55 | END; |
56 | |
57 | BLOCK pager_prev; |
58 | |
59 | IF self.pager.current_page != 1; |
60 | %]<a [% connect_href(self, 'page' => self.pager.previous_page); process_attrs(attrs) %]>[% |
61 | include( 'prev_label_block' ) %]</a>[% |
62 | END; |
63 | |
64 | END; |
65 | |
66 | BLOCK pager_prev_label; |
67 | |
68 | loc('Previous'); ' ('; self.pager.previous_page; ')'; |
69 | |
70 | END; |
71 | |
72 | BLOCK pager_current; |
73 | |
74 | %]<a [% connect_href(self, 'page' => self.pager.current_page); process_attrs(attrs) %]>[% |
75 | include( 'current_label_block' ) %]</a>[% |
76 | |
77 | END; |
78 | |
79 | BLOCK pager_current_label; |
80 | |
81 | loc('Current'); ' ('; self.pager.current_page; ')'; |
82 | |
83 | END; |
84 | |
85 | BLOCK pager_next; |
86 | |
87 | IF self.pager.current_page != self.pager.last_page; |
88 | %]<a [% connect_href(self, 'page' => self.pager.next_page); process_attrs(attrs) %]>[% |
89 | include( 'next_label_block' ) %]</a>[% |
90 | END; |
91 | |
92 | END; |
93 | |
94 | BLOCK pager_next_label; |
95 | |
96 | loc('Next'); ' ('; self.pager.next_page; ')'; |
97 | |
98 | END; |
99 | |
100 | BLOCK pager_end; |
101 | |
102 | %]<a [% connect_href(self, 'page' => self.pager.last_page); process_attrs(attrs) %]>[% |
103 | include( 'end_label_block' ) %]</a>[% |
104 | |
105 | END; |
106 | |
107 | BLOCK pager_end_label; |
108 | |
109 | loc('End'); ' ('; self.pager.last_page; ')'; |
110 | |
111 | END; |
112 | |
113 | BLOCK pager_list; |
114 | |
115 | FOREACH page IN self.pager.list; |
116 | '<a'; connect_href(self, 'page' => page); process_attrs(attrs); '>'; |
117 | include( 'list_label_block' ); "</a>\n"; |
118 | END; |
119 | |
120 | END; |
121 | |
122 | BLOCK pager_list_label; |
123 | |
124 | page; |
125 | |
126 | END; |
127 | |
128 | %] |