Extract displaying votes into partials
This commit is contained in:
parent
f7c70eaaed
commit
0bfcc574b6
6 changed files with 17 additions and 32 deletions
|
@ -23,12 +23,6 @@
|
|||
authored by #{merge_request.author_name}
|
||||
= time_ago_in_words(merge_request.created_at)
|
||||
ago
|
||||
|
||||
- if merge_request.votes_count > 0
|
||||
.votes.votes-inline
|
||||
.upvotes= merge_request.upvotes
|
||||
.progress
|
||||
- up_percent = 100.0/merge_request.votes_count*merge_request.upvotes
|
||||
- down_percent = 100.0-up_percent
|
||||
.bar.bar-success{style: "width: #{up_percent}%;"}
|
||||
.bar.bar-danger{style: "width: #{down_percent}%;"}
|
||||
.downvotes= merge_request.downvotes
|
||||
= render 'votes/votes_inline', votable: merge_request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue