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 406 }
407 407 }
408 408  
409   -.upvotes {
  409 +.votes {
410 410 font-size: 14px;
411 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 428 /* Fix for readme code (stopped it from being yellow) */
... ...
app/views/issues/_show.html.haml
... ... @@ -36,3 +36,5 @@
36 36  
37 37 - if issue.upvotes > 0
38 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 17 Edit
18 18  
19 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 25 .back_link
24 26 = link_to project_issues_path(@project) do
... ...
app/views/merge_requests/_merge_request.html.haml
... ... @@ -25,3 +25,5 @@
25 25 ago
26 26 - if merge_request.upvotes > 0
27 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 24 Edit
25 25  
26 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 33 .back_link
... ...