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
Boxiang Sun
gitlab-ce
Commits
69778103
Commit
69778103
authored
Mar 31, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add issue and merge request count for state filters.
parent
b0ed2ff1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+12
-0
app/views/shared/_issuable_filter.html.haml
app/views/shared/_issuable_filter.html.haml
+3
-3
No files found.
app/helpers/application_helper.rb
View file @
69778103
...
...
@@ -318,4 +318,16 @@ module ApplicationHelper
profile_key_path
(
key
)
end
end
def
state_filters_text_for
(
entity
,
project
)
entity_title
=
entity
.
to_s
.
humanize
count
=
if
current_controller?
(
:issues
)
" (
#{
project
.
issues
.
send
(
entity
).
count
}
)"
elsif
current_controller?
(
:merge_requests
)
" (
#{
project
.
merge_requests
.
send
(
entity
).
count
}
)"
end
"
#{
entity_title
}#{
count
}
"
end
end
app/views/shared/_issuable_filter.html.haml
View file @
69778103
...
...
@@ -4,15 +4,15 @@
%li
{
class:
(
"active"
if
params
[
:state
]
==
'opened'
)}
=
link_to
page_filter_path
(
state:
'opened'
)
do
%i
.fa.fa-exclamation-circle
Open
#{
state_filters_text_for
(
:opened
,
@project
)
}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'closed'
)}
=
link_to
page_filter_path
(
state:
'closed'
)
do
%i
.fa.fa-check-circle
Closed
#{
state_filters_text_for
(
:closed
,
@project
)
}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'all'
)}
=
link_to
page_filter_path
(
state:
'all'
)
do
%i
.fa.fa-compass
All
#{
state_filters_text_for
(
:all
,
@project
)
}
.issues-details-filters
=
form_tag
page_filter_path
(
without:
[
:assignee_id
,
:author_id
,
:milestone_id
,
:label_name
]),
method: :get
,
class:
'filter-form'
do
...
...
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