Show votes as a bar
This commit is contained in:
parent
5ca31aa252
commit
a5164ea2ed
5 changed files with 70 additions and 27 deletions
|
@ -16,16 +16,21 @@
|
|||
%i.icon-edit
|
||||
Edit
|
||||
|
||||
%br
|
||||
.votes#votes
|
||||
Votes:
|
||||
.upvotes#upvotes= "#{@issue.upvotes} up"
|
||||
.downvotes#downvotes= "#{@issue.downvotes} down"
|
||||
.right
|
||||
.span3.votes.votes-block#votes
|
||||
.progress
|
||||
- up_percent = 100.0/@issue.votes_count*@issue.upvotes
|
||||
- down_percent = 100.0-up_percent
|
||||
.bar.bar-success{style: "width: #{up_percent}%;"}
|
||||
.bar.bar-danger{style: "width: #{down_percent}%;"}
|
||||
.upvotes= "#{@issue.upvotes} up"
|
||||
.downvotes= "#{@issue.downvotes} down"
|
||||
|
||||
.back_link
|
||||
= link_to project_issues_path(@project) do
|
||||
← To issues list
|
||||
|
||||
|
||||
.main_box
|
||||
.top_box_content
|
||||
%h4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue