From c4b91de8e8d61274a923e85707402b74b910837a Mon Sep 17 00:00:00 2001 From: James Allen Date: Wed, 20 Aug 2014 14:58:01 +0100 Subject: [PATCH] Layout templates in rows of four --- services/web/app/views/templates/tag.jade | 15 +++++++++++++-- .../web/public/stylesheets/app/templates.less | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/services/web/app/views/templates/tag.jade b/services/web/app/views/templates/tag.jade index 5d1de78cab..980794d04b 100644 --- a/services/web/app/views/templates/tag.jade +++ b/services/web/app/views/templates/tag.jade @@ -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 diff --git a/services/web/public/stylesheets/app/templates.less b/services/web/public/stylesheets/app/templates.less index eeb90592d1..a08f5b8d3c 100644 --- a/services/web/public/stylesheets/app/templates.less +++ b/services/web/public/stylesheets/app/templates.less @@ -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 {