changeset 66:5d34e9d14666

improvements to the inclusion template
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 27 Oct 2011 21:14:41 -0700
parents ac1dc088e37e
children fdb77c57bd22
files decoupage/templates/inclusion.html
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/decoupage/templates/inclusion.html	Wed Oct 26 21:21:47 2011 -0700
+++ b/decoupage/templates/inclusion.html	Thu Oct 27 21:14:41 2011 -0700
@@ -12,12 +12,24 @@
     <xi:include py:if="include" href="${include}"/>
     <h1 py:if="title">${title}</h1>
 
+    <ul py:if="[i for i in files if i['type'] == 'directory']">
+      <li py:for="f in [d for d in files if d['type'] == 'directory']">
+        <a href="${f['path']}">
+          ${f.get('title', f['description']) or f['name']}</a><span py:if="'title' in f and f['description']">: ${f['description']}</span>
+        <py:if test="'links' in f">
+          <span py:for="link in f['links']" class="link">
+            <a href="${link['link']}">${link['text']}</a>
+          </span>
+        </py:if>
+      </li>
+    </ul>
+
     <py:for each="index, f in enumerate([i for i in files if i['type'] == 'file'])">
       <!-- separate with an hr -->
       <hr py:if="index"/>
       <a name="${f['name']}"></a>
-      ${file(filepath(f['name'])).read()}
-      <a href="#${f['name']}">#</a>
+      <div class="inclusion">${file(filepath(f['name'])).read()}</div>
+      <a href="${f['name']}">#</a>
     </py:for>
   </body>
 </html>