Mercurial > hg > montage
annotate montage/templates/grid.html @ 40:77c3439e76bb default tip
py3
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Wed, 25 Nov 2020 11:00:17 -0800 |
parents | ee74cf1e444b |
children |
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> |
26
ee74cf1e444b
* update templates to use head.html
Jeff Hammel <jhammel@mozilla.com>
parents:
17
diff
changeset
|
8 <xi:include href="head.html"/> |
5
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
9 </head> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
10 <body> |
9 | 11 <xi:include py:if="include" href="${include}"/> |
12 | |
5
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
13 <center> |
9 | 14 <table class="image"> |
5
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
15 <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
|
16 <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
|
17 <center> |
9 | 18 <a href="${image['link']}"> |
19 <img src="${image['path']}" width="${width or None}" height="${height or None}"/> | |
20 </a> | |
21 <br/> | |
5
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
22 ${image.get('title', image['description'])} |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
23 </center> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
24 </td> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
25 </tr> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
26 <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
|
27 <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
|
28 <center> |
14
6a33dc59e4a6
fix layout of grid for uneven number of images
k0s <k0scist@gmail.com>
parents:
9
diff
changeset
|
29 <a href="${image['link']}"> |
6a33dc59e4a6
fix layout of grid for uneven number of images
k0s <k0scist@gmail.com>
parents:
9
diff
changeset
|
30 <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
|
31 </a> |
6a33dc59e4a6
fix layout of grid for uneven number of images
k0s <k0scist@gmail.com>
parents:
9
diff
changeset
|
32 <br/> |
5
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
33 ${image.get('title', image['description'])} |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
34 </center> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
35 </td> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
36 </tr> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
37 </table> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
38 </center> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
39 </body> |
d60a5ffbf4f4
* include a new template to display images in a grid
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
40 </html> |