1 | <metal:html tal:define="display_change request/change_display|nothing; |
---|
2 | params here/academicsDisplayParams; |
---|
3 | sort_by params/sort_by; |
---|
4 | direction params/direction; |
---|
5 | format string:detail_tab; |
---|
6 | displayed python:request.get('displayed', None); |
---|
7 | display_buttons context/academics_contents_display_buttons; |
---|
8 | "> |
---|
9 | |
---|
10 | <metal:body use-macro="here/main_template/macros/master"> |
---|
11 | |
---|
12 | <metal:header metal:fill-slot="header"> |
---|
13 | |
---|
14 | <a href="" tal:attributes="href string:${here/academicsParent}"> |
---|
15 | <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/> |
---|
16 | Up one level |
---|
17 | </a> |
---|
18 | |
---|
19 | <h3 tal:content="here/LongTitle|here/Title|here/title_or_id"> |
---|
20 | Page Title |
---|
21 | </h3> |
---|
22 | </metal:header> |
---|
23 | |
---|
24 | <metal:main fill-slot="javascript_head_slot"> |
---|
25 | <tal:block tal:replace="nothing"> |
---|
26 | XXX Deactivated for CPS 3.4.0, will be re-enabled for 3.4.1 |
---|
27 | <script type="text/javascript" src="prototype.js" |
---|
28 | tal:attributes="src string:${base_url}prototype.js"></script> |
---|
29 | <script type="text/javascript" src="effects.js" |
---|
30 | tal:attributes="src string:${base_url}effects.js"></script> |
---|
31 | <script type="text/javascript" src="dragdrop.js" |
---|
32 | tal:attributes="src string:${base_url}dragdrop.js"></script> |
---|
33 | <script type="text/javascript" src="cpsdefault.js" |
---|
34 | tal:attributes="src string:${base_url}cpsdefault.js"></script> |
---|
35 | </tal:block> |
---|
36 | </metal:main> |
---|
37 | |
---|
38 | <metal:main fill-slot="main" |
---|
39 | tal:define="list_here python:checkPerm('List folder contents', here);"> |
---|
40 | <div tal:condition="not: list_here" |
---|
41 | tal:define="response request/RESPONSE;url here_url;"> |
---|
42 | <span tal:define="redirect python: response.redirect(url)"></span> |
---|
43 | </div> |
---|
44 | <span tal:omit-tag="" tal:condition="python:display_buttons or context.display_content()" |
---|
45 | tal:content="structure python: doc.render(proxy=here,layout_mode='view')" /> |
---|
46 | |
---|
47 | <form action="" method="post" class="group" |
---|
48 | tal:attributes="action here_url" |
---|
49 | tal:define="no_form python:not checkPerm('Modify portal content', here); |
---|
50 | |
---|
51 | nav_action string:folder_contents; |
---|
52 | items python:here.getFolderContents(displayed=displayed);"> |
---|
53 | |
---|
54 | <!-- a content_lib macro --> |
---|
55 | <!-- from content_lib_display_contents_column.pt academics_contents.pt --> |
---|
56 | |
---|
57 | <!-- List contents in 'items' in the specified number of columns |
---|
58 | with the given format --> |
---|
59 | |
---|
60 | <tal:block |
---|
61 | define="no_ajax not:nothing; |
---|
62 | tmp_format format|nothing; |
---|
63 | tmp_sort_by sort_by|nothing; |
---|
64 | tmp_direction direction|nothing; |
---|
65 | tmp_columns columns|nothing; |
---|
66 | tmp_items_per_page items_per_page|nothing; |
---|
67 | tmp_nav_action nav_action|nothing; |
---|
68 | tmp_filter filter|nothing; |
---|
69 | tmp_detail_tab_columns detail_tab_columns|nothing; |
---|
70 | params python:here.getDisplayParams(format=tmp_format, |
---|
71 | sort_by=tmp_sort_by, |
---|
72 | direction=tmp_direction, |
---|
73 | columns=tmp_columns, |
---|
74 | items_per_page=tmp_items_per_page, |
---|
75 | nav_action=tmp_nav_action, |
---|
76 | nb_items=len(items), |
---|
77 | filter=tmp_filter, |
---|
78 | detail_tab_columns=tmp_detail_tab_columns); |
---|
79 | format params/format; |
---|
80 | sort_by params/sort_by; |
---|
81 | direction params/direction; |
---|
82 | columns params/columns; |
---|
83 | items_per_page params/items_per_page; |
---|
84 | nav_action params/nav_action; |
---|
85 | filter params/filter; |
---|
86 | detail_tab_columns params/detail_tab_columns; |
---|
87 | mq nocall:modules/ZTUtils/make_query; |
---|
88 | form request/form; |
---|
89 | zoom zoom|python:0; |
---|
90 | batches_all python:here.getBatchList(items, columns, items_per_page, |
---|
91 | zoom); |
---|
92 | batches python:batches_all[0]; |
---|
93 | batch_info python:batches_all[1]; |
---|
94 | zoomed python:batches_all[2]; |
---|
95 | "> |
---|
96 | <span tal:condition="python:0"> |
---|
97 | <span tal:content="params" /><br /> |
---|
98 | <span tal:content="batches_all" /><br /> |
---|
99 | </span> |
---|
100 | <tal:block tal:condition="python: batch_info and batch_info['nb_pages'] > 1"> |
---|
101 | <div class="batchLayout"> |
---|
102 | <span i18n:translate=""> |
---|
103 | Objects: |
---|
104 | <strong> |
---|
105 | <tal:block replace="batch_info/start" |
---|
106 | i18n:name="batch_start" /> - <tal:block replace="batch_info/limit" |
---|
107 | i18n:name="batch_limit" /> |
---|
108 | </strong> |
---|
109 | of <tal:block replace="batch_info/length" |
---|
110 | i18n:name="batch_length" /> |
---|
111 | </span> |
---|
112 | </div> |
---|
113 | <br /> |
---|
114 | </tal:block> |
---|
115 | <table width="100%" cellspacing="0" cellpadding="0" |
---|
116 | summary="zoomed layout" |
---|
117 | tal:condition="zoomed"> |
---|
118 | <tr tal:repeat="item zoomed"> |
---|
119 | <td align="left" valign="top"> |
---|
120 | <tal:block define="no_form not:nothing; |
---|
121 | no_ajax no_ajax|nothing; |
---|
122 | info python:here.getContentInfo(item, level=1, cpsmcat=cpsmcat);"> |
---|
123 | <metal:block use-macro="here/content_lib_info_summary/macros/info_summary" /> |
---|
124 | <br /><br /> |
---|
125 | </tal:block> |
---|
126 | </td> |
---|
127 | </tr> |
---|
128 | </table> |
---|
129 | <table width="100%" cellspacing="0" cellpadding="0" |
---|
130 | summary="content layout column" |
---|
131 | tal:condition="batches"> |
---|
132 | <tr> |
---|
133 | <td align="left" valign="top" |
---|
134 | tal:repeat="batch_items batches"> |
---|
135 | <tal:block condition="batch_items"> |
---|
136 | <!-- a content_lib macro --> |
---|
137 | <!-- from content_lib_info_detail_tab.pt --> |
---|
138 | |
---|
139 | <!-- Final display of items in a column using the given format --> |
---|
140 | <tal:block define="no_form no_form|nothing; |
---|
141 | site_wide site_wide|nothing; |
---|
142 | format python:format or 'detail'; |
---|
143 | choosen_ids python:request.SESSION.get('choosen_ids', []); |
---|
144 | dummy python:request.SESSION.update({'choosen_ids': []}); |
---|
145 | no_table python:format == 'detail_tab'; |
---|
146 | use_radio use_radio|nothing; |
---|
147 | input_type python: test(use_radio, 'radio', 'checkbox'); |
---|
148 | input_name python: test(use_radio, 'ids', 'ids:list'); |
---|
149 | member here/portal_membership/getAuthenticatedMember; |
---|
150 | member_id member/id; |
---|
151 | is_local_manager python:member.has_role( |
---|
152 | ('Manager', 'WorkspaceManager'), here); |
---|
153 | "> |
---|
154 | <div id="ajax_psm" style="display:none" tal:condition="python:not no_form and not no_ajax"> |
---|
155 | ajax feedback |
---|
156 | </div> |
---|
157 | <tal:block condition="no_table"> |
---|
158 | <tal:block repeat="item batch_items"> |
---|
159 | <tal:block define="info python:here.getContentInfo(item, level=1, cpsmcat=cpsmcat); |
---|
160 | review_state python:info['review_state']; |
---|
161 | start repeat/item/start|nothing; |
---|
162 | end repeat/item/end|nothing"> |
---|
163 | <tal:block tal:condition="python:review_state!='draft' or (review_state=='draft' and proxy_creator == member_id) or is_local_manager"> |
---|
164 | <metal:block use-macro="here/academics_content_lib_info_detail_tab/macros/info_detail_tab" /> |
---|
165 | </tal:block> |
---|
166 | </tal:block> |
---|
167 | </tal:block> |
---|
168 | <br /> |
---|
169 | </tal:block> |
---|
170 | </tal:block> |
---|
171 | <tal:block tal:replace="nothing"> |
---|
172 | XXX Deactivated for CPS 3.4.0, will be re-enabled for 3.4.1 |
---|
173 | |
---|
174 | <tal:block tal:condition="python:not no_form and not no_ajax and sort_by is None" |
---|
175 | tal:define="ajax_working_msg python:cpsmcat('ajax_working'); |
---|
176 | ajax_working_msg python:ajax_working_msg.replace('\'', '\\\''); |
---|
177 | ajax_failing_msg python:cpsmcat('ajax_failing'); |
---|
178 | ajax_failing_msg python:ajax_failing_msg.replace('\'', '\\\'')"> |
---|
179 | |
---|
180 | <script type="text/javascript" tal:content="structure string: |
---|
181 | var editor = new CPSContainerEditor('draggable', 'droppable', |
---|
182 | 'droppable-in', '${format}', |
---|
183 | '${ajax_working_msg}', |
---|
184 | 'folder_content', 'ajax_psm', |
---|
185 | '${ajax_failing_msg}'); |
---|
186 | // hooking observers |
---|
187 | if (treeview_editor) { |
---|
188 | loadScript('portletrefresher', '++resource++portletrefresher.js'); |
---|
189 | |
---|
190 | function refresh(event_id, trigger_id) { |
---|
191 | |
---|
192 | portlet_refresher.refreshPortlet(trigger_id); |
---|
193 | editor.reload(); |
---|
194 | } |
---|
195 | |
---|
196 | if ($$('portlet_navigation_sections')) |
---|
197 | container_events.observeEvent('element_dropped', 'portlet_navigation_sections', |
---|
198 | refresh); |
---|
199 | |
---|
200 | if ($$('portlet_navigation_workspaces')) |
---|
201 | container_events.observeEvent('element_dropped', 'portlet_navigation_workspaces', |
---|
202 | refresh); |
---|
203 | |
---|
204 | } |
---|
205 | |
---|
206 | "> |
---|
207 | </script> |
---|
208 | |
---|
209 | </tal:block> |
---|
210 | </tal:block> |
---|
211 | </tal:block> |
---|
212 | |
---|
213 | </td> |
---|
214 | </tr> |
---|
215 | </table> |
---|
216 | <tal:block condition="python:batch_info and batch_info['nb_pages'] > 1"> |
---|
217 | <div class="pageNavigationLayout"> |
---|
218 | <a tal:define="previous batch_info/previous" |
---|
219 | tal:condition="python:previous is not None" |
---|
220 | tal:attributes="href python:'%s?%s'%(request['URL'], |
---|
221 | mq(request.form, b_start=0))"> |
---|
222 | (<<)</a> |
---|
223 | <a tal:define="previous batch_info/previous" |
---|
224 | tal:condition="python:previous is not None" |
---|
225 | tal:attributes="href python:'%s?%s'%(request['URL'], |
---|
226 | mq(request.form, b_start=previous))" |
---|
227 | i18n:translate="batch_previous">Previous</a> |
---|
228 | <tal:block repeat="page batch_info/pages"> |
---|
229 | <tal:block condition="python:page != batch_info['start'] - 1"> |
---|
230 | <a tal:attributes="href python:'%s?%s'%(request['URL'], |
---|
231 | mq(request.form, b_start=page))" |
---|
232 | tal:content="repeat/page/number">1</a> |
---|
233 | </tal:block> |
---|
234 | <tal:block condition="python:page == batch_info['start'] - 1"> |
---|
235 | <span tal:content="string:${repeat/page/number}" /> |
---|
236 | </tal:block> |
---|
237 | </tal:block> |
---|
238 | <a tal:define="next batch_info/next" |
---|
239 | tal:condition="python:next is not None" |
---|
240 | tal:attributes="href python:'%s?%s'%(request['URL'], |
---|
241 | mq(request.form, b_start=next))" |
---|
242 | i18n:translate="batch_next">Next</a> |
---|
243 | <a tal:define="next batch_info/next; |
---|
244 | last_page python:batch_info['pages'][-1]" |
---|
245 | tal:condition="python:next is not None" |
---|
246 | tal:attributes="href python:'%s?%s'%(request['URL'], |
---|
247 | mq(request.form, b_start=last_page))"> |
---|
248 | (>>)</a> |
---|
249 | </div> |
---|
250 | </tal:block> |
---|
251 | </tal:block> |
---|
252 | |
---|
253 | <table width="100%" cellspacing="0" cellpadding="2" |
---|
254 | summary="contents of the folder" |
---|
255 | class="folderButtons" |
---|
256 | tal:define="can_add python:checkPerm('Add portal content', here); |
---|
257 | can_del python:checkPerm('Delete objects', here); |
---|
258 | "> |
---|
259 | <tr> |
---|
260 | <td align="left" valign="top" rowspan="3"></td> |
---|
261 | <td align="left" valign="top"> |
---|
262 | <span tal:condition="display_buttons"> |
---|
263 | <span tal:condition="can_del"> |
---|
264 | <input type="button" value="button_select_all" class="context" |
---|
265 | onclick="someJavaScriptFunctionThatWillBeReplaced" |
---|
266 | i18n:attributes="value" |
---|
267 | tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')' |
---|
268 | % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))" /> |
---|
269 | <span tal:omit-tag="" tal:condition="python: context.portal_type != 'Certificate'"> |
---|
270 | <input type="submit" name="approve_checked:method" |
---|
271 | class="context" value="Approve" /> |
---|
272 | <input type="submit" name="retract_checked:method" |
---|
273 | class="context" value="Retract" /> |
---|
274 | </span> |
---|
275 | <input type="submit" name="folder_delete:method" value="button_delete" |
---|
276 | class="destructive" i18n:attributes="value" |
---|
277 | tal:attributes="onclick python:'return window.confirm(\'%s\')' % |
---|
278 | (cpsmcat('description_confirm_delete'), )" /> |
---|
279 | <input tal:condition="python: context.portal_type not in ('Semester','Certificate')" |
---|
280 | type="submit" name="id_rename_form:method" |
---|
281 | class="context" value="Change Object ID" i18n:attributes="value" /> |
---|
282 | </span> |
---|
283 | </span> |
---|
284 | </td> |
---|
285 | </tr> |
---|
286 | </table> |
---|
287 | </form> |
---|
288 | </metal:main> |
---|
289 | |
---|
290 | <metal:sub fill-slot="sub"/> |
---|
291 | |
---|
292 | </metal:body> |
---|
293 | </metal:html> |
---|