summaryrefslogtreecommitdiff
path: root/app/views/votes
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-09-10 15:27:14 +0200
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-09-11 16:48:11 +0200
commit0bfcc574b660108646bd2c99a611163a0c847251 (patch)
treef57e3c2f42a113741db6e559e12ca2e791afb01b /app/views/votes
parentf7c70eaaedd196accbe8e952ddc4738a96b81998 (diff)
downloadgitlab-ce-0bfcc574b660108646bd2c99a611163a0c847251.tar.gz
Extract displaying votes into partials
Diffstat (limited to 'app/views/votes')
-rw-r--r--app/views/votes/_votes_block.html.haml6
-rw-r--r--app/views/votes/_votes_inline.html.haml6
2 files changed, 12 insertions, 0 deletions
diff --git a/app/views/votes/_votes_block.html.haml b/app/views/votes/_votes_block.html.haml
new file mode 100644
index 00000000000..bded53b2f21
--- /dev/null
+++ b/app/views/votes/_votes_block.html.haml
@@ -0,0 +1,6 @@
+.votes.votes-block
+ .progress
+ .bar.bar-success{style: "width: #{votable.upvotes_in_percent}%;"}
+ .bar.bar-danger{style: "width: #{votable.downvotes_in_percent}%;"}
+ .upvotes= "#{votable.upvotes} up"
+ .downvotes= "#{votable.downvotes} down"
diff --git a/app/views/votes/_votes_inline.html.haml b/app/views/votes/_votes_inline.html.haml
new file mode 100644
index 00000000000..91bd200df44
--- /dev/null
+++ b/app/views/votes/_votes_inline.html.haml
@@ -0,0 +1,6 @@
+.votes.votes-inline
+ .upvotes= votable.upvotes
+ .progress
+ .bar.bar-success{style: "width: #{votable.upvotes_in_percent}%;"}
+ .bar.bar-danger{style: "width: #{votable.downvotes_in_percent}%;"}
+ .downvotes= votable.downvotes