BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3b4c0ea0
Commit
3b4c0ea0
authored
May 15, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'use-count-badges' into 'master'
Use count badges with number_with_delimiter helper for issue, commit count See merge request !658
parents
a13e6f13
ded82ed4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
application_helper.rb
app/helpers/application_helper.rb
+12
-4
_head.html.haml
app/views/projects/commits/_head.html.haml
+1
-1
No files found.
app/helpers/application_helper.rb
View file @
3b4c0ea0
...
...
@@ -324,12 +324,20 @@ module ApplicationHelper
count
=
if
project
.
nil?
""
nil
elsif
current_controller?
(
:issues
)
" (
#{
project
.
issues
.
send
(
entity
).
count
}
)"
project
.
issues
.
send
(
entity
).
count
elsif
current_controller?
(
:merge_requests
)
" (
#{
project
.
merge_requests
.
send
(
entity
).
count
}
)"
project
.
merge_requests
.
send
(
entity
).
count
end
"
#{
entity_title
}#{
count
}
"
html
=
content_tag
:span
,
entity_title
if
count
.
present?
html
+=
" "
html
+=
content_tag
:span
,
number_with_delimiter
(
count
),
class:
'badge'
end
html
.
html_safe
end
end
app/views/projects/commits/_head.html.haml
View file @
3b4c0ea0
...
...
@@ -3,7 +3,7 @@
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@ref
||
@repository
.
root_ref
)
do
=
icon
(
"history"
)
Commits
%span
.badge
=
number_with_
precision
(
@repository
.
commit_count
,
precision:
0
,
delimiter:
','
)
%span
.badge
=
number_with_
delimiter
(
@repository
.
commit_count
)
=
nav_link
(
controller: :compare
)
do
=
link_to
namespace_project_compare_index_path
(
@project
.
namespace
,
@project
,
from:
@repository
.
root_ref
,
to:
@ref
||
@repository
.
root_ref
)
do
=
icon
(
"exchange"
)
...
...
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