Mercurial > hg > montage
annotate montage/templates/grid.html @ 17:17ccb1022656
fix templates
author | egj@socialplanning.org |
---|---|
date | Sun, 03 Jan 2010 22:13:25 +0000 |
parents | 6a33dc59e4a6 |
children | ee74cf1e444b |
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> |
17 | 9 <link py:for="sheet in css" 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 | 12 <xi:include py:if="include" href="${include}"/> |
13 | |
5
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
14 <center> |
9 | 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 | 19 <a href="${image['link']}"> |
20 <img src="${image['path']}" width="${width or None}" height="${height or None}"/> | |
21 </a> | |
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> |