Affichage / masquage de la cible du dépôt d'images.
authorBenoît Pin <pin@cri.ensmp.fr>
Fri, 19 Jul 2013 11:58:00 +0000 (13:58 +0200)
committerBenoît Pin <pin@cri.ensmp.fr>
Fri, 19 Jul 2013 11:58:00 +0000 (13:58 +0200)
skins/photo_layout_macros.pt
skins/portfolio_view.pt

index 6e1d7aa..ec7fa3c 100644 (file)
@@ -8,7 +8,10 @@
          tal:define="slide_size portal_object/slide_size;"
          i18n:domain="portfolio">
       <div metal:use-macro="here/batch_macros/macros/navigation">batch navigation</div>
-      <div id="lightbox" class="lightbox photo-drop-target">
+      <div id="lightbox"
+           tal:define="mayBeDropable exists:dropable;
+                       dropable python:True if mayBeDropable and dropable else False"
+           tal:attributes="class python:'lightbox photo-drop-target' if dropable else 'lightbox'">
         <span tal:repeat="info infos" tal:omit-tag="">
           <span tal:define="size info/thumbSize;
                             margin_top python:(slide_size - size['height']) / 2;
index 3e55e80..482151d 100644 (file)
@@ -6,7 +6,11 @@
     <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>
+      </tal:block>
     </metal:block>
     <title>portfolio_view</title>
   </head>
@@ -22,7 +26,9 @@
     </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'}),