From 1b2a7967d3379888ee3c6dc6ba416bd4c175f150 Mon Sep 17 00:00:00 2001 From: Leonardo Merlin Date: Mon, 4 May 2015 18:05:22 -0300 Subject: [PATCH] Add apresentacao da issue #188 --- index.html | 6 +++++- js/handlebars-helpers.js | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 33ebb75..c86c9d3 100644 --- a/index.html +++ b/index.html @@ -287,13 +287,17 @@ Propostas - Pontuação + Apoio + Participacao + {{#each articles}}

{{abstract}}

{{votes_for}} {{votes_against}} + {{#apoio .}}{{/apoio}} + {{#participacao .}}{{/participacao}} {{#score .}}{{/score}} {{/each}} diff --git a/js/handlebars-helpers.js b/js/handlebars-helpers.js index d90f549..df3ec76 100644 --- a/js/handlebars-helpers.js +++ b/js/handlebars-helpers.js @@ -65,6 +65,16 @@ define(['handlebars'], function(Handlebars){ return article.votes_for - article.votes_against; }); + Handlebars.registerHelper('apoio', function(article) { + // return (article.votes_for - article.votes_against)/(article.countViews); + return 0; + }); + + Handlebars.registerHelper('participacao', function(article) { + // return (article.votes_for + article.votes_against)/(article.countViews); + return 0; + }); + Handlebars.registerHelper('select_proposal', function(proposals, category_slug, selected_id) { var ret = '' ret = ret + '