Layout templates in rows of four

This commit is contained in:
James Allen 2014-08-20 14:58:01 +01:00
parent d0eee7a1e5
commit c4b91de8e8
2 changed files with 16 additions and 2 deletions

View file

@ -1,5 +1,12 @@
extends ../layout
mixin template(template)
.template-thumbnail
a(href=template.templatePagePath ? template.templatePagePath : template.canonicalUrl).thumbnail
img(src=template.thumbnailUrl)
div.caption
h3 #{template.name}
block content
.content.content-alt
.container
@ -9,8 +16,12 @@ block content
a(href="/templates") #{translate("templates")}
|
a(href=tag.tagPagePath) #{tag.name}
.row
- _.groupBy(templates, function(e, i) { return Math.floor(index/4) });
- for (var row = 0; row <= Math.floor(templates.length / 4); row++)
.row
- for (var column = 0; column < 4; column++)
- if (templates[row*4 + column])
.col-md-3
+template(templates[row*4 + column])
//- -each template in templates
//- a(href=template.templatePagePath || template.canonicalUrl)
//- .col-md-3.template-thumbnail

View file

@ -12,6 +12,9 @@
.thumbnail {
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);
img {
width: 100%;
}
}
a {