diff --git a/index.html b/index.html
index 7ffc9eb..b957766 100644
--- a/index.html
+++ b/index.html
@@ -173,26 +173,29 @@
Pular
- Resultado
+ Resultado
diff --git a/js/handlebars-helpers.js b/js/handlebars-helpers.js
index 5f6da68..b46000d 100644
--- a/js/handlebars-helpers.js
+++ b/js/handlebars-helpers.js
@@ -48,3 +48,7 @@ Handlebars.registerHelper('proposal_detail', function(proposals, options) {
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;
+});
diff --git a/js/main.js b/js/main.js
index a22d8ae..02cd02b 100644
--- a/js/main.js
+++ b/js/main.js
@@ -158,8 +158,8 @@ function loadRandomProposal(topic_id, private_token) {
});
e.preventDefault();
});
- $(document.body).off('click', '.vote-actions .result');
- $(document.body).on('click', '.vote-actions .result', function(e) {
+ $(document.body).off('click', '.vote-result');
+ $(document.body).on('click', '.vote-result', function(e) {
$('.results-container').toggle();
if($('.results-container').is(":visible")) {
var url = host + '/api/v1/articles/' + topic_id + '/children' + '?private_token=' + private_token + '&limit=10&fields=id,name,abstract,votes_for,votes_against&content_type=ProposalsDiscussionPlugin::Proposal';
diff --git a/sass/_proposal_detail.scss b/sass/_proposal_detail.scss
index 898c36b..f6c0435 100644
--- a/sass/_proposal_detail.scss
+++ b/sass/_proposal_detail.scss
@@ -76,14 +76,33 @@
}
}
.results-container {
- th, td {
- border: 1px solid rgb(223, 223, 223);
+ &:before {
+ content:"";
+ display:table;
+ clear:both;
}
.results-content {
border: 1px solid #00a9bd;
+ margin-top: 20px;
+ .vote-result {
+ font-weight: bolder;
+ font-size: 12px;
+ text-transform: uppercase;
+ background-color: gray;
+ color: white;
+ width: 4%;
+ border: none;
+ margin: 10px;
+ border-radius: 6px;
+ text-align: center;
+ text-decoration: none;
+ padding: 9px;
+ display: block;
+ float: right;
+ }
}
table {
- border-collapse: collapse;
+ clear: both;
margin-top: 20px;
tbody tr:nth-child(odd) {
background-color: #e5e5e5;
@@ -99,9 +118,14 @@
.votes-against {
@extend .votes-for;
}
+ .score {
+ @extend .votes-for;
+ }
.header {
+ line-height: 32px;
font-weight: bold;
text-align: center;
+ color: rgb(68, 68, 68);
}
.truncate {
@@ -114,6 +138,9 @@
text-overflow: ellipsis;
white-space: nowrap;
}
+ tr {
+ color: rgb(77, 77, 77);
+ }
}
}
@@ -287,7 +314,7 @@
padding: 20px;
display: block;
}
- .result {
+ .vote-result {
@extend .skip
}
}
--
libgit2 0.21.2