Skip to content

Instantly share code, notes, and snippets.

@dbouwman
Last active April 28, 2016 19:22
Show Gist options
  • Save dbouwman/3f5616ed3497a8b3bfd8083536017527 to your computer and use it in GitHub Desktop.
Save dbouwman/3f5616ed3497a8b3bfd8083536017527 to your computer and use it in GitHub Desktop.
//Pseudo Templates
// Run-Time
{{#page-layout model=model }} //the model here is the something with a `.rows[]` property
{{#each model.rows as |row|}}
{{#layout-row model=row }}
{{#layout-cards model=row.cards}} //formerly grid-layout; uses nester to conver x,y,h,w --> bootstrap rows and cols
{{#each bootstrapifiedCards.rows as |row|}}
{{#bs-row model=row onSearch=(action onSearch)}}
{{#each row.cols as |col|}}
{{bs-col model=col}}
{{#if model.rows}}
{{#each model.rows as |row| ~}}
{{bs-row model=row onSearch=onSearch}}
{{/each}}
{{else}}
{{component model.component.name model=model onSearch=onSearch}}
{{/if}}
{{/bs-col}}
{{/each}}
{{/bs-row}}
{{/layout-cards}}
{{/layout-row}}
{{/each}}
{{/layout}}
//edit
{{#page-layout-editor model=model}}
{{#each model.rows as |row|}}
{{#layout-row-editor style=row.style}}
{{#layout-cards-editor model=row.cards}} //formerly card-canvas
{{#each model.cards as |card|}}
{{#card-editor model=card}}
{{component model.componentName ...}}
{{/card-editor}}
{{/each}}
{{/layout-cards-editor}}
{{/layout-row-editor}}
{{/each}}
{{/layout-editor}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment