From 2f87425cf091e8a39b63633e024c6810ed9fdb1c Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 7 May 2015 18:29:03 -0300 Subject: [PATCH] New proposal ranking --- index.html | 20 +++++++++++--------- js/handlebars-helpers.js | 20 +++++--------------- js/jquery.timeago.js | 221 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ js/jquery.timeago.pt-br.js | 18 ++++++++++++++++++ js/main.js | 5 +++-- js/requirejs-config.js | 10 +++++++++- sass/_proposal_detail.scss | 22 +++++++++++----------- 7 files changed, 278 insertions(+), 38 deletions(-) create mode 100644 js/jquery.timeago.js create mode 100644 js/jquery.timeago.pt-br.js diff --git a/index.html b/index.html index 9d69ad4..168ad30 100644 --- a/index.html +++ b/index.html @@ -298,21 +298,23 @@ Propostas - {{!-- Apoio --}} - {{!-- Participacao --}} - Pontuação + Apoio + Participação - {{#each articles}} + {{#each proposals}}

{{abstract}}

- {{votes_for}} - {{votes_against}} - {{!-- {{#apoio .}}{{/apoio}} --}} - {{!-- {{#participacao .}}{{/participacao}} --}} - {{#score .}}{{/score}} + {{votes_for}} + {{votes_against}} + {{#round effective_support}}{{/round}} + {{#round effective_participation}}{{/round}} {{/each}} +
+ Atualizado + +
diff --git a/js/handlebars-helpers.js b/js/handlebars-helpers.js index df3ec76..4b8b4af 100644 --- a/js/handlebars-helpers.js +++ b/js/handlebars-helpers.js @@ -60,21 +60,7 @@ define(['handlebars'], function(Handlebars){ Handlebars.registerHelper('replace', function(string, to_replace, replacement) { return (string || '').replace(new RegExp(to_replace, 'g'), replacement); }); - - Handlebars.registerHelper('score', function(article) { - 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 + '