Skip to content

Instantly share code, notes, and snippets.

@mfd
Last active November 17, 2016 05:45
Show Gist options
  • Save mfd/bab5ece9e969ad503b52e3b1567d1390 to your computer and use it in GitHub Desktop.
Save mfd/bab5ece9e969ad503b52e3b1567d1390 to your computer and use it in GitHub Desktop.
jade data two colums
mixin listSupplInvit(obj)
ul.list.send-invit
each item in obj
li.tile
.checkbox.checkbox-styled.tile-text
label
input(type='checkbox')
span=item['name']
small=item['work']
.tile-icon
img(src=item['pic']?item['pic']:'/img/avatar0.jpg', alt=item['name'])
mixin listCols (obj, cols)
- var rows = Math.ceil(obj.length / cols)
.data
- for (i=0; i<obj.length; i=i+rows)
ul
- for (j=0; j < rows && i+j < obj.length; j++)
li= obj[i+j].name
+listSupplInvit(data_suppliers)
// BEGIN offcanvas-left2
#ofcl__contact.offcanvas-pane.width-10
- var l = data_suppliers.length
div= l +' шт.'
each item, index in data_suppliers
li= index + '. ' + item['name']
// END offcanvas-left2
+listCols(data_suppliers, 6)
- var columns = 2;
- var l = data_suppliers.length;
- var x = Math.ceil(l / columns)
.data
each item, i in data_suppliers
if i % x == 0
ul.row(title=x)
- var k = i + x
each item in data_suppliers.slice(i, k)
li.item(title=i title2=k) #{item.name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment