Abandon de l’affichage de la position (c’est moche). Il faudra trouver un moyen de...
authorBenoît Pin <benoit.pin@gmail.com>
Sun, 8 Dec 2013 14:30:23 +0000 (15:30 +0100)
committerBenoît Pin <benoit.pin@gmail.com>
Sun, 8 Dec 2013 14:30:23 +0000 (15:30 +0100)
skins/photo_theme/folder_contents.py
skins/photo_theme/folder_contents_macros.pt

index e0bc4d8..2659868 100755 (executable)
@@ -110,10 +110,10 @@ columns = ( {'key': 'Lock',
                         'title': 'Last Modified',
                         'width': None,
                         'colspan': None}
                         'title': 'Last Modified',
                         'width': None,
                         'colspan': None}
-                       , {'key': 'position',
-                        'title': 'Position',
-                        'width': None,
-                        'colspan': None }
+            # , {'key': 'position',
+            #  'title': 'Position',
+            #  'width': None,
+            #  'colspan': None }
                        )
 
 for column in columns: 
                        )
 
 for column in columns: 
@@ -161,13 +161,10 @@ sortFunc = key in ['Type'] and 'nocase' or 'cmp'
 items = sequence.sort( items, ((key, sortFunc, sort_dir),) )
 batch_obj = Batch(items, context.default_batch_size, b_start, orphan=0, quantumleap=1)
 items = []
 items = sequence.sort( items, ((key, sortFunc, sort_dir),) )
 batch_obj = Batch(items, context.default_batch_size, b_start, orphan=0, quantumleap=1)
 items = []
-i = 1
-display_delete_button = True # TODO : à revoirs
+display_delete_button = True # TODO : à revoir
 for item in batch_obj:
        item_icon = item.getIcon
        item_id = item.getId
 for item in batch_obj:
        item_icon = item.getIcon
        item_id = item.getId
-       item_position = key == 'position' and str(b_start + i) or '...'
-       i += 1
        item_url = item.getURL()
        #try : item_delete_allowed = context.objectIdCanBeDeleted(item_id)
        #except : item_delete_allowed = checkPermission(DeleteObjects, context) # std zope perm
        item_url = item.getURL()
        #try : item_delete_allowed = context.objectIdCanBeDeleted(item_id)
        #except : item_delete_allowed = checkPermission(DeleteObjects, context) # std zope perm
@@ -179,13 +176,13 @@ for item in batch_obj:
                 'icon': item_icon and ( '%s/%s' % (portal_url, item_icon) ) or '',
                 'id': item_id,
                 'modified': item.modified.strftime(locale_date_fmt),
                 'icon': item_icon and ( '%s/%s' % (portal_url, item_icon) ) or '',
                 'id': item_id,
                 'modified': item.modified.strftime(locale_date_fmt),
-                'position': item_position,
                 'title_or_id': item.Title or item_id,
                 'type': item.Type or None,
                 'url': item_url } )
 
 options['batch'] = { 'listColumnInfos': tuple(columns),
                                         'listItemInfos': tuple(items),
                 'title_or_id': item.Title or item_id,
                 'type': item.Type or None,
                 'url': item_url } )
 
 options['batch'] = { 'listColumnInfos': tuple(columns),
                                         'listItemInfos': tuple(items),
+                                        'firstItemPos' : b_start + 1,
                                         'sort_key' : key,
                                         'sort_dir' : sort_dir,
                                         'batch_obj': batch_obj }
                                         'sort_key' : key,
                                         'sort_dir' : sort_dir,
                                         'batch_obj': batch_obj }
@@ -229,4 +226,3 @@ if template and macro :
        return context.use_macro(**options)
 else :
        return context.folder_contents_template(**options)
        return context.use_macro(**options)
 else :
        return context.folder_contents_template(**options)
-
index c2c3780..b359ad3 100644 (file)
@@ -16,7 +16,7 @@
     <div style="display:none">
       <span id="FolderUrl" tal:content="here/absolute_url" >Folder url for script</span>
       <span tal:condition="options/form/is_orderable" tal:omit-tag="">
     <div style="display:none">
       <span id="FolderUrl" tal:content="here/absolute_url" >Folder url for script</span>
       <span tal:condition="options/form/is_orderable" tal:omit-tag="">
-             <span id="FirstItemPos" tal:content="python:listItemInfos[0]['position']">first batch item position</span>
+             <span id="FirstItemPos" tal:content="batch_dict/firstItemPos">first batch item position</span>
              <span id="BatchNavigationSize" tal:content="batch/size"></span>
            </span>
     </div>
              <span id="BatchNavigationSize" tal:content="batch/size"></span>
            </span>
     </div>
@@ -65,9 +65,6 @@
                      <td>
                        <span tal:replace="item_info/modified">2001</span>
                      </td>
                      <td>
                        <span tal:replace="item_info/modified">2001</span>
                      </td>
-                     <td>
-                       <span tal:replace="item_info/position">1</span>
-                     </td>
                    </tr>
 </tbody>
                </tbody>
                    </tr>
 </tbody>
                </tbody>