Enregistrement du tri par défaut.
[Portfolio.git] / skins / portfolio_view.pt
index 3e55e80..06de5c3 100644 (file)
@@ -6,7 +6,12 @@
     <metal:block metal:fill-slot="javascript_head_slot">
       <script type="text/javascript" tal:attributes="src string:$portal_url/cart_widgets.js"></script>
       <script type="text/javascript" tal:attributes="src string:$portal_url/photo_lightbox_viewer.js"></script>
     <metal:block metal:fill-slot="javascript_head_slot">
       <script type="text/javascript" tal:attributes="src string:$portal_url/cart_widgets.js"></script>
       <script type="text/javascript" tal:attributes="src string:$portal_url/photo_lightbox_viewer.js"></script>
-      <script type="text/javascript" tal:attributes="src string:$portal_url/fileupload.js"charset="utf-8"></script>
+      <tal:block
+        tal:define="AddPortalContent modules/Products/CMFCore/permissions/AddPortalContent"
+        tal:condition="python: mtool.checkPermission(AddPortalContent, here)">
+        <script type="text/javascript" tal:attributes="src string:$portal_url/fileupload.js" charset="utf-8"></script>
+        <script type="text/javascript" tal:attributes="src string:$portal_url/portfolio_upload.js" charset="utf-8"></script>
+      </tal:block>
     </metal:block>
     <title>portfolio_view</title>
   </head>
     </metal:block>
     <title>portfolio_view</title>
   </head>
@@ -22,7 +27,9 @@
     </div>
 
     <div metal:fill-slot="main" tal:omit-tag=""
     </div>
 
     <div metal:fill-slot="main" tal:omit-tag=""
-         tal:define="Batch python:modules['Products.Plinn'].Batch;
+         tal:define="AddPortalContent modules/Products/CMFCore/permissions/AddPortalContent;
+                     dropable python:mtool.checkPermission(AddPortalContent, here);
+                     Batch python:modules['Products.Plinn'].Batch;
                      pho_start python:request.get('pho_start', 0);
                      port_start python:request.get('port_start', 0);
                      portfolios python:Batch(here.listNearestFolderContents(contentFilter={'portal_type' : 'Portfolio'}),
                      pho_start python:request.get('pho_start', 0);
                      port_start python:request.get('port_start', 0);
                      portfolios python:Batch(here.listNearestFolderContents(contentFilter={'portal_type' : 'Portfolio'}),
                      infos batchInfos/infos;
                      features batchInfos/features"
          tal:omit-tag="">
                      infos batchInfos/infos;
                      features batchInfos/features"
          tal:omit-tag="">
-      <div metal:use-macro="here/photo_layout_macros/macros/grid">
-        affichage grille
-      </div>
+      <form tal:attributes="action string:${here/absolute_url}/portfolio_edit_form" method="post">
+        <div id="lightbox_toolbar" class="image_toolbar"
+             tal:define="ModifyPortalContent modules/Products/CMFCore/permissions/ModifyPortalContent"
+             tal:condition="python:mtool.checkPermission(ModifyPortalContent, here)">
+          <span>
+            <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"
+                 tal:attributes="src string:$portal_url/trash_btn.gif"
+                 i18n:attributes="alt;title"/>
+          <br/>
+        </div>
+
+        <div metal:use-macro="here/photo_layout_macros/macros/grid">
+          affichage grille
+        </div>
+      </form>
     </div>
     <br clear="all"/>
     </div>
     </div>
     <br clear="all"/>
     </div>