Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0bfcc574
Commit
0bfcc574
authored
Sep 10, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract displaying votes into partials
parent
f7c70eaa
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
32 deletions
+17
-32
app/views/issues/_show.html.haml
app/views/issues/_show.html.haml
+1
-8
app/views/issues/show.html.haml
app/views/issues/show.html.haml
+1
-8
app/views/merge_requests/_merge_request.html.haml
app/views/merge_requests/_merge_request.html.haml
+2
-8
app/views/merge_requests/show/_mr_title.html.haml
app/views/merge_requests/show/_mr_title.html.haml
+1
-8
app/views/votes/_votes_block.html.haml
app/views/votes/_votes_block.html.haml
+6
-0
app/views/votes/_votes_inline.html.haml
app/views/votes/_votes_inline.html.haml
+6
-0
No files found.
app/views/issues/_show.html.haml
View file @
0bfcc574
...
...
@@ -35,11 +35,4 @@
-
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
=
render
'votes/votes_inline'
,
votable:
issue
app/views/issues/show.html.haml
View file @
0bfcc574
...
...
@@ -17,14 +17,7 @@
Edit
.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"
.span3
#votes
=
render
'votes/votes_block'
,
votable:
@issue
.back_link
=
link_to
project_issues_path
(
@project
)
do
...
...
app/views/merge_requests/_merge_request.html.haml
View file @
0bfcc574
...
...
@@ -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
app/views/merge_requests/show/_mr_title.html.haml
View file @
0bfcc574
...
...
@@ -24,14 +24,7 @@
Edit
.right
.span3.votes.votes-block
#votes
.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}%;"
}
.upvotes
=
"
#{
@merge_request
.
upvotes
}
up"
.downvotes
=
"
#{
@merge_request
.
downvotes
}
down"
.span3
#votes
=
render
'votes/votes_block'
,
votable:
@merge_request
.back_link
=
link_to
project_merge_requests_path
(
@project
)
do
...
...
app/views/votes/_votes_block.html.haml
0 → 100644
View file @
0bfcc574
.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"
app/views/votes/_votes_inline.html.haml
0 → 100644
View file @
0bfcc574
.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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment