changeset 98:d29425348cbd

show image without caption in project description if its the first one.
author casties
date Tue, 21 May 2013 16:15:35 +0200
parents 7b96a85552aa
children 84fa3f62ed85
files zpt/project/project_index_html.zpt
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/zpt/project/project_index_html.zpt	Tue May 21 15:51:32 2013 +0200
+++ b/zpt/project/project_index_html.zpt	Tue May 21 16:15:35 2013 +0200
@@ -51,19 +51,22 @@
 
     <div class="description">
       <!-- inline image -->
-      <div class="figure" tal:condition="images" tal:repeat="image python:images">
-        <div class="image" tal:condition="image/caption">
-          <a tal:define="url image/getLink" tal:attributes="href url" tal:omit-tag="not:url" target="_blank"><img
-            tal:attributes="src image/getUrl" alt="" /></a>
+      <tal:block tal:condition="images" tal:repeat="image python:images">
+        <div class="figure" tal:condition="python:image.getCaption() or repeat['image'].start">
+          <div class="image">
+            <a tal:define="url image/getLink" tal:attributes="href url" tal:omit-tag="not:url" target="_blank"><img
+              tal:attributes="src image/getUrl" alt="" /></a>
+          </div>
+          <div class="figcaption" tal:condition="image/caption" tal:content="structure image/getCaption">
+            J.-A.-D. Ingres: Mme Moitessier, 1856. Oel/Lw. 120 x 92,1 cm. London, National Gallery.
+          </div>
         </div>
-        <div class="figcaption" tal:condition="image/caption" tal:content="structure image/caption">J.-A.-D. Ingres: Mme Moitessier, 1856. Oel/Lw. 120 x 92,1
-          cm. London, National Gallery.</div>
-      </div>
+      </tal:block>
       <!-- project description -->
       <div tal:content="structure python:here.getDescription(filter=True)">Project description</div>
     </div>
 
-  </div>
+  </div><!-- /center -->
 
   <!-- right column -->
   <div class="sidebar" metal:fill-slot="sidebar">