diff --git a/index.html b/index.html index 5b4589d..d2cfbf0 100644 --- a/index.html +++ b/index.html @@ -45,12 +45,8 @@ {{/list_proposal}} - {{#each article.children}} -
- {{/each}} + {{#proposal_detail article.children}} + {{/proposal_detail}} diff --git a/js/handlebars-helpers.js b/js/handlebars-helpers.js index dc4cec7..156eb5c 100644 --- a/js/handlebars-helpers.js +++ b/js/handlebars-helpers.js @@ -29,7 +29,16 @@ Handlebars.registerHelper('list_proposal', function(proposals, options) { element = element + '' + proposals[i].body + '
'; ret = ret + element + ''; } - return ret; +}); +Handlebars.registerHelper('proposal_detail', function(proposals, options) { + var ret = ""; + for(var i=0, j=proposals.length; i