Commit 1271b4ce66d4251f8f038d8d339fbecbab2d0900

Authored by Riyad Preukschas
1 parent 7b0c7ae5

Update display of merge requests and issues to also show downvotes

app/assets/stylesheets/common.scss
@@ -406,13 +406,23 @@ p.time { @@ -406,13 +406,23 @@ p.time {
406 } 406 }
407 } 407 }
408 408
409 -.upvotes { 409 +.votes {
410 font-size: 14px; 410 font-size: 14px;
411 font-weight: bold; 411 font-weight: bold;
412 - color: #468847;  
413 - text-align: right;  
414 - padding: 4px;  
415 - margin: 2px; 412 + padding: 4px 0;
  413 + margin: 2px 0;
  414 + .upvotes {
  415 + display: inline-block;
  416 + color: #468847;
  417 + padding: 0 4px;
  418 + margin: 0 2px;
  419 + }
  420 + .downvotes {
  421 + display: inline-block;
  422 + color: #B94A48;
  423 + padding: 0 4px;
  424 + margin: 0 2px;
  425 + }
416 } 426 }
417 427
418 /* Fix for readme code (stopped it from being yellow) */ 428 /* Fix for readme code (stopped it from being yellow) */
app/views/issues/_show.html.haml
@@ -36,3 +36,5 @@ @@ -36,3 +36,5 @@
36 36
37 - if issue.upvotes > 0 37 - if issue.upvotes > 0
38 %span.badge.badge-success= "+#{issue.upvotes}" 38 %span.badge.badge-success= "+#{issue.upvotes}"
  39 + - if issue.downvotes > 0
  40 + %span.badge.badge-important= "-#{issue.downvotes}"
app/views/issues/show.html.haml
@@ -17,8 +17,10 @@ @@ -17,8 +17,10 @@
17 Edit 17 Edit
18 18
19 %br 19 %br
20 - - if @issue.upvotes > 0  
21 - .upvotes#upvotes= "+#{pluralize @issue.upvotes, 'upvote'}" 20 + .votes#votes
  21 + Votes:
  22 + .upvotes#upvotes= "#{@issue.upvotes} up"
  23 + .downvotes#downvotes= "#{@issue.downvotes} down"
22 24
23 .back_link 25 .back_link
24 = link_to project_issues_path(@project) do 26 = link_to project_issues_path(@project) do
app/views/merge_requests/_merge_request.html.haml
@@ -25,3 +25,5 @@ @@ -25,3 +25,5 @@
25 ago 25 ago
26 - if merge_request.upvotes > 0 26 - if merge_request.upvotes > 0
27 %span.badge.badge-success= "+#{merge_request.upvotes}" 27 %span.badge.badge-success= "+#{merge_request.upvotes}"
  28 + - if merge_request.downvotes > 0
  29 + %span.badge.badge-important= "-#{merge_request.downvotes}"
app/views/merge_requests/show/_mr_title.html.haml
@@ -24,8 +24,10 @@ @@ -24,8 +24,10 @@
24 Edit 24 Edit
25 25
26 %br 26 %br
27 - - if @merge_request.upvotes > 0  
28 - .upvotes#upvotes= "+#{pluralize @merge_request.upvotes, 'upvote'}" 27 + .votes#votes
  28 + Votes:
  29 + .upvotes#upvotes= "#{@merge_request.upvotes} up"
  30 + .downvotes#downvotes= "#{@merge_request.downvotes} down"
29 31
30 32
31 .back_link 33 .back_link