Merge branch 'dd_ordering' into zope-2.13
[Portfolio.git] / skins / portfolio_view.pt
index a168fca..a194d6f 100644 (file)
@@ -28,7 +28,9 @@
 
     <div metal:fill-slot="main" tal:omit-tag=""
          tal:define="AddPortalContent modules/Products/CMFCore/permissions/AddPortalContent;
+                     ManageProperties modules/Products/CMFCore/permissions/ManageProperties;
                      dropable python:mtool.checkPermission(AddPortalContent, here);
+                     orderable python:mtool.checkPermission(ManageProperties, here) and here.getDefaultSorting()[0] == 'position';
                      Batch python:modules['Products.Plinn'].Batch;
                      pho_start python:request.get('pho_start', 0);
                      port_start python:request.get('port_start', 0);
              tal:define="ModifyPortalContent modules/Products/CMFCore/permissions/ModifyPortalContent"
              tal:condition="python:mtool.checkPermission(ModifyPortalContent, here)">
           <span>
-            <span i18n:translate="" tal:omit-tag="">sort:</span>
-            <select name="sort">
-              <option value="position" i18n:translate="">manual</option>
-              <option value="DateTimeOriginal" i18n:translate="">shooting</option>
-              <option value="modified" i18n:translate="">modification</option>
+            <span i18n:translate="" tal:omit-tag="">sorting:</span>
+            <select tal:define="sort_on batchInfos/sorting/sort_on"
+                    name="sort_on">
+              <option tal:attributes="selected python:sort_on=='position'"
+                      value="position" i18n:translate="">manual</option>
+              <option tal:attributes="selected python:sort_on=='DateTimeOriginal'"
+                      value="DateTimeOriginal" i18n:translate="">shooting</option>
+              <option tal:attributes="selected python:sort_on=='modified'"
+                      value="modified" i18n:translate="">modification</option>
             </select>
+            <noscript>
+              <input type="submit" name="set_sorting" value="ok"/>
+            </noscript>
           </span>
           <input type="image" width="17" height="27" alt="delete" title="delete"
                  name="delete"