Commit 1b2a7967d3379888ee3c6dc6ba416bd4c175f150
1 parent
15d5b7cb
Exists in
master
and in
8 other branches
Add apresentacao da issue #188
Showing
2 changed files
with
15 additions
and
1 deletions
Show diff stats
index.html
| ... | ... | @@ -287,13 +287,17 @@ |
| 287 | 287 | <td class="abstract-text">Propostas</td> |
| 288 | 288 | <td class="votes-for"></td> |
| 289 | 289 | <td class="votes-against"></td> |
| 290 | - <td class="score">Pontuação</td> | |
| 290 | + <td class="apoio">Apoio</td> | |
| 291 | + <td class="participacao">Participacao</td> | |
| 292 | + <td class="score"></td> | |
| 291 | 293 | </tr> |
| 292 | 294 | {{#each articles}} |
| 293 | 295 | <tr> |
| 294 | 296 | <td class="abstract-text"><div class="truncate"><p class="truncated">{{abstract}}</p></div></td> |
| 295 | 297 | <td class="votes-for">{{votes_for}}</td> |
| 296 | 298 | <td class="votes-against">{{votes_against}}</td> |
| 299 | + <td class="apoio">{{#apoio .}}{{/apoio}}</td> | |
| 300 | + <td class="participacao">{{#participacao .}}{{/participacao}}</td> | |
| 297 | 301 | <td class="score">{{#score .}}{{/score}}</td> |
| 298 | 302 | </tr> |
| 299 | 303 | {{/each}} | ... | ... |
js/handlebars-helpers.js
| ... | ... | @@ -65,6 +65,16 @@ define(['handlebars'], function(Handlebars){ |
| 65 | 65 | return article.votes_for - article.votes_against; |
| 66 | 66 | }); |
| 67 | 67 | |
| 68 | + Handlebars.registerHelper('apoio', function(article) { | |
| 69 | + // return (article.votes_for - article.votes_against)/(article.countViews); | |
| 70 | + return 0; | |
| 71 | + }); | |
| 72 | + | |
| 73 | + Handlebars.registerHelper('participacao', function(article) { | |
| 74 | + // return (article.votes_for + article.votes_against)/(article.countViews); | |
| 75 | + return 0; | |
| 76 | + }); | |
| 77 | + | |
| 68 | 78 | Handlebars.registerHelper('select_proposal', function(proposals, category_slug, selected_id) { |
| 69 | 79 | var ret = '<label for="proposal-selection" class="sr-only">Selecione o programa</label>' |
| 70 | 80 | ret = ret + '<select id="proposal-selection" name="proposal-selection" data-proposal="'+selected_id+'" title="Selecione o programa" class="proposal-selection">'; | ... | ... |