Simplifications. On vire le pictogramme du cadenas : personne ne savait à quoi ça...
[Plinn.git] / skins / photo_theme / folder_contents_macros.pt
index 042dfbc..2cb5b03 100644 (file)
       <tbody id="FolderListingBody">
 <tbody tal:repeat="item_info listItemInfos" tal:omit-tag="" metal:define-macro="itemListing">
         <tr class="" tal:attributes="class python: (even and 'even') or 'odd'" tal:define="even repeat/item_info/even">
-          <td><img src="." alt="lock" height="16" width="16" border="0"
-                   tal:condition="python:not isAnon and item_info['lock']"
-                   tal:attributes="src here/lock.gif/absolute_url"
-                   i18n:attributes="alt" /></td>
           <td>
             <input id="" type="checkbox" name="ids:list" value=""
                    tal:attributes="value item_info/id; id item_info/checkbox" tal:condition="item_info/checkbox" />
     </div>
     <script type="text/javascript">
                (function(){
-                       // variables for drag-and-drop ordered support
-                       var ddEnabled = false
-                       try {
-                               var firstItemPos = parseInt(document.getElementById("FirstItemPos").innerHTML);
-                               ddEnabled = true;
-                       }
-                       catch (e) {}
-
-                       var topNavBatchBar              = document.getElementById("topNavBatchBar");
-                       var bottomNavBatchBar   = document.getElementById("bottomNavBatchBar");
+                       // ordering / selecting
+                       var firsItemPosElement = document.getElementById('FirstItemPos');
                        var listing = document.getElementById("FolderListingBody");
-
-                       if (ddEnabled) {
-                               var fDDcontroler = new FolderDDropControler(listing, firstItemPos);
-                               var topNavBatchBar              = document.getElementById("topNavBatchBar");
-                               var bottomNavBatchBar   = document.getElementById("bottomNavBatchBar");
+                       var orderable = firsItemPosElement ? true : false;
+                       var firstItemPos = orderable ? parseInt(firsItemPosElement.innerHTML, 10) : 1;
+                       var fDDcontroler = new FolderDDropControler(listing, orderable, firstItemPos);
+                       var topNavBatchBar, bottomNavBatchBar;
+                       if (orderable) {
+                               topNavBatchBar = document.getElementById("topNavBatchBar");
+                               bottomNavBatchBar = document.getElementById("bottomNavBatchBar");
                                if (topNavBatchBar && bottomNavBatchBar) {
                                        new DropTarget(topNavBatchBar, fDDcontroler);
                                        new DropTarget(bottomNavBatchBar, fDDcontroler);
                                }
                        }
-
-
                        addListener(document.getElementById("FolderListingHeader"), "click", loadListing);
                        if (topNavBatchBar && bottomNavBatchBar) {
                                addListener(topNavBatchBar, "click", loadListing);
                                addListener(bottomNavBatchBar, "click", loadListing);
                        }
-                       
-                       var uploadUrl = absolute_url() + '/put_upload';
-      new DDFolderUploader(document.getElementById('ForematterCell'), uploadUrl, listing);
 
                }());
     </script>
+    <script type="text/javascript" tal:condition="options/form/items_add_allowed">
+               (function(){
+                       // upload by drag and drop
+                       var uploadUrl = absolute_url() + '/put_upload';
+                       new DDFolderUploader(document.getElementById('ForematterCell'), uploadUrl, document.getElementById("FolderListingBody"));
+               }());
+    </script>
   </body>
 
 </html>
\ No newline at end of file