summaryrefslogtreecommitdiff
path: root/app/views/issues
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-09-08 16:44:56 +0200
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-09-08 16:44:56 +0200
commita5164ea2ed4e809cb4af7a070652ef2a6b19fbf3 (patch)
tree74b54fb5098947ca12e3e1c84710e442726c7527 /app/views/issues
parent5ca31aa252d67372d9a90cceb61f16721dca3841 (diff)
downloadgitlab-ce-a5164ea2ed4e809cb4af7a070652ef2a6b19fbf3.tar.gz
Show votes as a bar
Diffstat (limited to 'app/views/issues')
-rw-r--r--app/views/issues/_show.html.haml13
-rw-r--r--app/views/issues/show.html.haml15
2 files changed, 19 insertions, 9 deletions
diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml
index e37ea3dfec3..db3948734f0 100644
--- a/app/views/issues/_show.html.haml
+++ b/app/views/issues/_show.html.haml
@@ -34,7 +34,12 @@
- else
&nbsp;
- - if issue.upvotes > 0
- %span.badge.badge-success= "+#{issue.upvotes}"
- - if issue.downvotes > 0
- %span.badge.badge-important= "-#{issue.downvotes}"
+ - if issue.votes_count > 0
+ .votes.votes-inline
+ .upvotes= issue.upvotes
+ .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}%;"}
+ .downvotes= issue.downvotes
diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml
index 12394ac5077..1ec0395173b 100644
--- a/app/views/issues/show.html.haml
+++ b/app/views/issues/show.html.haml
@@ -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
&larr; To issues list
+
.main_box
.top_box_content
%h4