Conservation de l'état de déroulement de l'arborescence (seulement pour le déroulement).
[MosaicDocument.git] / default_blocks / tree_block_template.pt
1 <html xmlns="http://www.w3.org/1999/xhtml" tal:omit-tag="">
2
3 <head tal:replace="nothing">
4 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
5 <title>tree_block_template</title>
6 </head>
7
8 <body tal:define="block nocall:options/block;
9 slots block/getSlotsDic;
10 displayAction options/displayAction;
11 rootObject nocall:slots/rootObject;
12 filteredMetaTypes nocall:slots/filteredMetaTypes;"
13 tal:omit-tag=""
14 i18n:domain="plinn">
15 <div tal:condition="python:displayAction=='edit'" tal:omit-tag="">
16 <h3 i18n:translate="">Tree box settings</h3>
17 <form action="." metal:use-macro="here/block_utils/macros/block_form">
18 <table border="0" cellspacing="4" cellpadding="0" metal:fill-slot="html_block_content">
19 <tr>
20 <td i18n:translate="">Root object expression:</td>
21 </tr>
22 <tr>
23 <td valign="top" tal:content="structure python:rootObject.callAction(displayAction)">
24 rootObject slot here
25 </td>
26 </tr>
27 <tr>
28 <td valign="top" i18n:translate="">
29 Filter (meta_type list) :
30 </td>
31 </tr>
32 <tr>
33 <td valign="top" tal:content="structure python:filteredMetaTypes.callAction(displayAction)">filteredMetaTypes slot here</td>
34 </tr>
35 </table>
36 </form>
37 </div>
38 <div tal:define="treeRoot python:rootObject.text(rootObject.getExprContext());
39 treeDict python:block.make_nav_tree(rootObject=treeRoot, filtered_meta_types=filteredMetaTypes.text );
40 tree treeDict/tree;
41 rows treeDict/rows;
42 height tree/height;
43 rootNode python:rows.pop(0);
44 box_id tree/tree_pre;
45 portal_url here/portal_url"
46 tal:condition="python:displayAction=='view' and rows"
47 tal:omit-tag=""
48 tal:on-error="string:Path Error">
49 <script type="text/javascript" tal:attributes="src here/tree_block_script.js/absolute_url"></script>
50 <table class="tree_box" cellspacing="0">
51 <tr>
52 <th>
53 <table>
54 <tr>
55 <td width="16" tal:condition="nothing">
56 <a title="collapse all" href="." tal:attributes="href string:?collapse_all=${rootNode/object/id}" i18n:attributes="title"><img src="../skins/collapse_all.gif" alt="collapse all" height="16" width="16" border="0" tal:attributes="src here/collapse_all.gif/absolute_url" i18n:attributes="alt" /></a>
57 </td>
58 <th tal:content="rootNode/object/title_or_id" style="border : none">Root Node</th>
59 </tr>
60 </table>
61 </th>
62 </tr>
63
64 <tr>
65 <td>
66 <table cellspacing="0">
67 <tbody tal:attributes="id box_id; name rootNode/id">
68 <tr tal:repeat="row rows">
69 <td tal:define="indent python: row.depth - 1" tal:attributes="colspan indent" tal:condition="indent">&nbsp;</td>
70 <td tal:define="state row/state ; rlink row/branch ; msg python:state > 0 and 'collapse' or 'expand'" width="16"
71 ><a href="#" tal:condition="state" tal:attributes="name row/id ; href rlink/link ; title msg" i18n:attributes="title"
72 ><img src="/p_/pl" alt="" tal:attributes="src python:'%s/%s' % (portal_url, state > 0 and 'mi.gif' or 'pl.gif') ; alt msg" i18n:attributes="alt" border="0" height="16" width="16" /></a>
73 <a href="#" tal:attributes="name row/id ; href rlink/link" tal:condition="not:state">&nbsp;&nbsp;</a>
74 </td>
75 <td colspan="1" tal:define="obj nocall: row/object; url obj/absolute_url; description obj/Description"
76 tal:attributes="colspan python: height - row.depth"
77 width="99%" tal:on-error="string:erreur"
78 ><a href="." tal:attributes="href url; title description"
79 ><img src="." alt="" tal:define="icon python:here.restrictedTraverse(obj.icon())" tal:attributes="src icon/absolute_url; height icon/height; width icon/width" border="0" />
80 <span tal:replace="obj/title_or_id">Title</span></a></td>
81 </tr>
82 </tbody>
83 </table>
84 <tal:include content="structure python:here.inline_tree_script(box_id=box_id, filter_str=','.join(filteredMetaTypes.text))" />
85 </td>
86 </tr>
87 </table>
88 </div>
89
90 </body>
91
92 </html>