1 | <!-- a content_lib macro --> |
---|
2 | <!-- $Id: academics_content_lib_display_contents_column.pt 486 2006-09-06 10:09:39Z joachim $ --> |
---|
3 | |
---|
4 | <!-- Final display of items in a column using the given format --> |
---|
5 | |
---|
6 | <metal:block define-macro="display_contents_column"> |
---|
7 | <tal:block define="no_form no_form|nothing; |
---|
8 | site_wide site_wide|nothing; |
---|
9 | format python:format or 'detail'; |
---|
10 | choosen_ids python:request.SESSION.get('choosen_ids', []); |
---|
11 | dummy python:request.SESSION.update({'choosen_ids': []}); |
---|
12 | no_table python:format == 'detail_tab'; |
---|
13 | use_radio use_radio|nothing; |
---|
14 | input_type python: test(use_radio, 'radio', 'checkbox'); |
---|
15 | input_name python: test(use_radio, 'ids', 'ids:list'); |
---|
16 | member here/portal_membership/getAuthenticatedMember; |
---|
17 | member_id member/id; |
---|
18 | is_local_manager python:member.has_role( |
---|
19 | ('Manager', 'WorkspaceManager'), here); |
---|
20 | "> |
---|
21 | <div id="ajax_psm" style="display:none" tal:condition="python:not no_form"> |
---|
22 | ajax feedback |
---|
23 | </div> |
---|
24 | <tal:block condition="no_table"> |
---|
25 | <tal:block repeat="item batch_items"> |
---|
26 | <tal:block define="info python:here.getContentInfo(item, level=1, cpsmcat=cpsmcat); |
---|
27 | review_state python:info['review_state']; |
---|
28 | proxy_creator python:item.Creator(); |
---|
29 | start repeat/item/start|nothing; |
---|
30 | end repeat/item/end|nothing"> |
---|
31 | <tal:block tal:condition="python:review_state!='draft' or (review_state=='draft' and proxy_creator == member_id) or is_local_manager"> |
---|
32 | <metal:block use-macro="here/academics_content_lib_info_detail_tab/macros/info_detail_tab" /> |
---|
33 | </tal:block> |
---|
34 | </tal:block> |
---|
35 | </tal:block> |
---|
36 | <br /> |
---|
37 | </tal:block> |
---|
38 | </tal:block> |
---|
39 | <tal:block tal:replace="nothing"> |
---|
40 | XXX Deactivated for CPS 3.4.0, will be re-enabled for 3.4.1 |
---|
41 | |
---|
42 | <tal:block tal:condition="python:not no_form and sort_by is None" |
---|
43 | tal:define="ajax_working_msg python:cpsmcat('ajax_working'); |
---|
44 | ajax_working_msg python:ajax_working_msg.replace('\'', '\\\''); |
---|
45 | ajax_failing_msg python:cpsmcat('ajax_failing'); |
---|
46 | ajax_failing_msg python:ajax_failing_msg.replace('\'', '\\\'')"> |
---|
47 | |
---|
48 | <script type="text/javascript" tal:content="structure string: |
---|
49 | var editor = new CPSContainerEditor('draggable', 'droppable', |
---|
50 | 'droppable-in', '${format}', |
---|
51 | '${ajax_working_msg}', |
---|
52 | 'folder_content', 'ajax_psm', |
---|
53 | '${ajax_failing_msg}'); |
---|
54 | // hooking observers |
---|
55 | if (treeview_editor) { |
---|
56 | loadScript('portletrefresher', '++resource++portletrefresher.js'); |
---|
57 | |
---|
58 | function refresh(event_id, trigger_id) { |
---|
59 | |
---|
60 | portlet_refresher.refreshPortlet(trigger_id); |
---|
61 | editor.reload(); |
---|
62 | } |
---|
63 | |
---|
64 | if ($$('portlet_navigation_sections')) |
---|
65 | container_events.observeEvent('element_dropped', 'portlet_navigation_sections', |
---|
66 | refresh); |
---|
67 | |
---|
68 | if ($$('portlet_navigation_workspaces')) |
---|
69 | container_events.observeEvent('element_dropped', 'portlet_navigation_workspaces', |
---|
70 | refresh); |
---|
71 | |
---|
72 | } |
---|
73 | |
---|
74 | "> |
---|
75 | </script> |
---|
76 | |
---|
77 | </tal:block> |
---|
78 | </tal:block> |
---|
79 | </metal:block> |
---|