7d25a0213379676c95541f61a5759385504510e6
[Plinn.git] / skins / photo_theme / folder_contents_macros.pt
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
3 <html xmlns="http://www.w3.org/1999/xhtml">
4
5 <head>
6 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7 <title>folder contents macros</title>
8 </head>
9
10 <body i18n:domain="cmf_default" metal:define-macro="FolderListing"
11 tal:define="batch_dict options/batch;
12 batch batch_dict/batch_obj;
13 listColumnInfos batch_dict/listColumnInfos;
14 listItemInfos batch_dict/listItemInfos;"
15 tal:omit-tag="">
16 <div style="display:none">
17 <span id="FolderUrl" tal:content="here/absolute_url" >Folder url for script</span>
18 <span tal:condition="options/form/is_orderable" tal:omit-tag="">
19 <span id="FirstItemPos" tal:content="python:listItemInfos[0]['position']">first batch item position</span>
20 <span id="BatchNavigationSize" tal:content="batch/size"></span>
21 </span>
22 </div>
23 <!-- batch navigation -->
24 <div tal:define="navBatchBarId string:topNavBatchBar" tal:omit-tag="">
25 <span metal:use-macro="here/batch_macros/macros/navigation">batch navigation</span>
26 </div>
27 <table class="listing" cellspacing="0">
28 <thead id="FolderListingHeader">
29 <tr>
30 <th tal:attributes="width column_info/width; colspan column_info/colspan" tal:repeat="column_info listColumnInfos" nowrap="nowrap" >
31 <a href="." tal:attributes="href column_info/url" tal:content="column_info/title" i18n:translate="">Type</a>
32 <span tal:repeat="img column_info/images" tal:omit-tag="">
33 <a tal:omit-tag="python:not img.has_key('href')"
34 tal:attributes="href img/href|nothing ; title img/alt" i18n:attributes="title"
35 ><img tal:attributes="src img/src ; alt img/alt ; id img/id|nothing" border="0" i18n:attributes="alt" /></a>
36 </span>
37 </th>
38 <td colspan="5" tal:replace="nothing"></td>
39 </tr>
40 </thead>
41 <tbody id="FolderListingBody">
42 <tbody tal:repeat="item_info listItemInfos" tal:omit-tag="" metal:define-macro="itemListing">
43 <tr class="" tal:attributes="class python: (even and 'even') or 'odd'" tal:define="even repeat/item_info/even">
44 <td><img src="." alt="lock" height="16" width="16" border="0"
45 tal:condition="python:not isAnon and item_info['lock']"
46 tal:attributes="src here/lock.gif/absolute_url"
47 i18n:attributes="alt" /></td>
48 <td>
49 <input id="" type="checkbox" name="ids:list" value=""
50 tal:attributes="value item_info/id; id item_info/checkbox" tal:condition="item_info/checkbox" />
51 </td>
52 <td>
53 <a href="." tal:attributes="href item_info/url" tal:condition="item_info/icon">
54 <img src="." alt="" tal:attributes="src item_info/icon; alt item_info/type" border="0" i18n:attributes="alt" />
55 </a>
56 </td>
57 <td>
58 <a href="." tal:attributes="href item_info/url" tal:define="tod item_info/title_or_id; id item_info/id">
59 <span tal:replace="id">id</span>
60 <span tal:condition="python:tod != id">
61 • <span tal:replace="tod">title</span>
62 </span>
63 </a>
64 </td>
65 <td>
66 <span tal:replace="item_info/modified">2001</span>
67 </td>
68 <td>
69 <span tal:replace="item_info/position">1</span>
70 </td>
71 </tr>
72 </tbody>
73 </tbody>
74 </table>
75 <!-- batch navigation -->
76 <div tal:define="navBatchBarId string:bottomNavBatchBar" tal:omit-tag="">
77 <span metal:use-macro="here/batch_macros/macros/navigation">batch navigation</span>
78 </div>
79 <script type="text/javascript">
80 (function(){
81 // variables for drag-and-drop ordered support
82 var ddEnabled = false
83 try {
84 var firstItemPos = parseInt(document.getElementById("FirstItemPos").innerHTML);
85 ddEnabled = true;
86 }
87 catch (e) {}
88
89 var topNavBatchBar = document.getElementById("topNavBatchBar");
90 var bottomNavBatchBar = document.getElementById("bottomNavBatchBar");
91 var listing = document.getElementById("FolderListingBody");
92
93 if (ddEnabled) {
94 var rows = listing.getElementsByTagName("TR")
95 for ( var i = 0 ; i < rows.length ; i++ )
96 rows[i].pos = i + firstItemPos;
97
98 var fDDcontroler = new FolderDDropControler(listing);
99 var topNavBatchBar = document.getElementById("topNavBatchBar");
100 var bottomNavBatchBar = document.getElementById("bottomNavBatchBar");
101 if (topNavBatchBar && bottomNavBatchBar) {
102 new DropTarget(topNavBatchBar, fDDcontroler);
103 new DropTarget(bottomNavBatchBar, fDDcontroler);
104 }
105 }
106
107
108 addListener(document.getElementById("FolderListingHeader"), "click", loadListing);
109 if (topNavBatchBar && bottomNavBatchBar) {
110 addListener(topNavBatchBar, "click", loadListing);
111 addListener(bottomNavBatchBar, "click", loadListing);
112 }
113
114 var uploadUrl = absolute_url() + '/put_upload';
115 new DDFolderUploader(document.getElementById('ForematterCell'), uploadUrl, listing);
116
117 }());
118 </script>
119 </body>
120
121 </html>