annotate montage/templates/grid.html @ 14:6a33dc59e4a6

fix layout of grid for uneven number of images
author k0s <k0scist@gmail.com>
date Sat, 26 Dec 2009 19:45:41 -0500
parents 33349e5178b3
children 17ccb1022656
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
1 <!DOCTYPE html
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
4 <html xmlns="http://www.w3.org/1999/xhtml"
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
5 xmlns:py="http://genshi.edgewall.org/"
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
6 xmlns:xi="http://www.w3.org/2001/XInclude">
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
7 <head>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
8 <title>${title or path}</title>
9
33349e5178b3 fix up templates
k0s <k0scist@gmail.com>
parents: 5
diff changeset
9 <link py:for="sheet in stylesheets" rel="stylesheet" type="text/css" href="${sheet}"/>
5
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
10 </head>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
11 <body>
9
33349e5178b3 fix up templates
k0s <k0scist@gmail.com>
parents: 5
diff changeset
12 <xi:include py:if="include" href="${include}"/>
33349e5178b3 fix up templates
k0s <k0scist@gmail.com>
parents: 5
diff changeset
13
5
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
14 <center>
9
33349e5178b3 fix up templates
k0s <k0scist@gmail.com>
parents: 5
diff changeset
15 <table class="image">
5
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
16 <tr py:for="row in range(len(files)/columns)">
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
17 <td py:for="col in range(columns)" py:with="image = files[row*columns + col]">
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
18 <center>
9
33349e5178b3 fix up templates
k0s <k0scist@gmail.com>
parents: 5
diff changeset
19 <a href="${image['link']}">
33349e5178b3 fix up templates
k0s <k0scist@gmail.com>
parents: 5
diff changeset
20 <img src="${image['path']}" width="${width or None}" height="${height or None}"/>
33349e5178b3 fix up templates
k0s <k0scist@gmail.com>
parents: 5
diff changeset
21 </a>
33349e5178b3 fix up templates
k0s <k0scist@gmail.com>
parents: 5
diff changeset
22 <br/>
5
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
23 ${image.get('title', image['description'])}
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
24 </center>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
25 </td>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
26 </tr>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
27 <tr py:if="len(files) % columns" py:with="row = len(files) / columns">
14
6a33dc59e4a6 fix layout of grid for uneven number of images
k0s <k0scist@gmail.com>
parents: 9
diff changeset
28 <td py:for="col in range(len(files) % columns)" py:with="image = files[row*columns + col]">
5
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
29 <center>
14
6a33dc59e4a6 fix layout of grid for uneven number of images
k0s <k0scist@gmail.com>
parents: 9
diff changeset
30 <a href="${image['link']}">
6a33dc59e4a6 fix layout of grid for uneven number of images
k0s <k0scist@gmail.com>
parents: 9
diff changeset
31 <img src="${image['path']}" width="${width or None}" height="${height or None}"/>
6a33dc59e4a6 fix layout of grid for uneven number of images
k0s <k0scist@gmail.com>
parents: 9
diff changeset
32 </a>
6a33dc59e4a6 fix layout of grid for uneven number of images
k0s <k0scist@gmail.com>
parents: 9
diff changeset
33 <br/>
5
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
34 ${image.get('title', image['description'])}
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
35 </center>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
36 </td>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
37 </tr>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
38 </table>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
39 </center>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
40 </body>
d60a5ffbf4f4 * include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff changeset
41 </html>