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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
3d4d89f0
Commit
3d4d89f0
authored
May 14, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use count badges with number_with_delimiter helper for issue, commit count
parent
8dde52cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+13
-4
app/views/projects/commits/_head.html.haml
app/views/projects/commits/_head.html.haml
+1
-1
No files found.
app/helpers/application_helper.rb
View file @
3d4d89f0
...
...
@@ -324,12 +324,21 @@ 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
=
""
html
+=
content_tag
:span
,
entity_title
html
+=
" "
if
count
.
present?
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 @
3d4d89f0
...
...
@@ -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