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
234b86c9
Unverified
Commit
234b86c9
authored
Jan 15, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use FilteringService for project issuus, mrs
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
4a5e4b18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
issues_controller.rb
app/controllers/projects/issues_controller.rb
+4
-1
merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+9
-3
_project_filter.html.haml
app/views/shared/_project_filter.html.haml
+4
-4
No files found.
app/controllers/projects/issues_controller.rb
View file @
234b86c9
...
@@ -116,7 +116,10 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -116,7 +116,10 @@ class Projects::IssuesController < Projects::ApplicationController
end
end
def
issues_filtered
def
issues_filtered
@issues
=
Issues
::
ListContext
.
new
(
project
,
current_user
,
params
).
execute
params
[
:scope
]
=
'all'
if
params
[
:scope
].
blank?
params
[
:state
]
=
'opened'
if
params
[
:state
].
blank?
params
[
:project_id
]
=
@project
.
id
@issues
=
FilteringService
.
new
.
execute
(
Issue
,
current_user
,
params
)
end
end
# Since iids are implemented only in 6.1
# Since iids are implemented only in 6.1
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
234b86c9
...
@@ -17,9 +17,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -17,9 +17,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
before_filter
:authorize_modify_merge_request!
,
only:
[
:close
,
:edit
,
:update
,
:sort
]
before_filter
:authorize_modify_merge_request!
,
only:
[
:close
,
:edit
,
:update
,
:sort
]
def
index
def
index
sort_param
=
params
[
:sort
]
||
'newest'
params
[
:sort
]
||=
'newest'
@sort
=
sort_param
.
humanize
unless
sort_param
.
empty?
params
[
:scope
]
=
'all'
if
params
[
:scope
].
blank?
@merge_requests
=
MergeRequestsLoadContext
.
new
(
project
,
current_user
,
params
).
execute
params
[
:state
]
=
'opened'
if
params
[
:state
].
blank?
params
[
:project_id
]
=
@project
.
id
@merge_requests
=
FilteringService
.
new
.
execute
(
MergeRequest
,
current_user
,
params
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
@sort
=
params
[
:sort
].
humanize
assignee_id
,
milestone_id
=
params
[
:assignee_id
],
params
[
:milestone_id
]
assignee_id
,
milestone_id
=
params
[
:assignee_id
],
params
[
:milestone_id
]
@assignee
=
@project
.
team
.
find
(
assignee_id
)
if
assignee_id
.
present?
&&
!
assignee_id
.
to_i
.
zero?
@assignee
=
@project
.
team
.
find
(
assignee_id
)
if
assignee_id
.
present?
&&
!
assignee_id
.
to_i
.
zero?
@milestone
=
@project
.
milestones
.
find
(
milestone_id
)
if
milestone_id
.
present?
&&
!
milestone_id
.
to_i
.
zero?
@milestone
=
@project
.
milestones
.
find
(
milestone_id
)
if
milestone_id
.
present?
&&
!
milestone_id
.
to_i
.
zero?
...
...
app/views/shared/_project_filter.html.haml
View file @
234b86c9
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
-
if
current_user
-
if
current_user
%fieldset
%fieldset
%ul
.nav.nav-pills.nav-stacked
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
params
[
:scope
]
.
blank?
)}
%li
{
class:
(
"active"
if
params
[
:scope
]
==
'all'
)}
=
link_to
project_filter_path
(
scope:
nil
)
do
=
link_to
project_filter_path
(
scope:
'all'
)
do
Everyone's
Everyone's
%li
{
class:
(
"active"
if
params
[
:scope
]
==
'assigned-to-me'
)}
%li
{
class:
(
"active"
if
params
[
:scope
]
==
'assigned-to-me'
)}
=
link_to
project_filter_path
(
scope:
'assigned-to-me'
)
do
=
link_to
project_filter_path
(
scope:
'assigned-to-me'
)
do
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
%fieldset
%fieldset
%legend
State
%legend
State
%ul
.nav.nav-pills
%ul
.nav.nav-pills
%li
{
class:
(
"active"
if
params
[
:state
]
.
blank?
)}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'opened'
)}
=
link_to
project_filter_path
(
state:
nil
)
do
=
link_to
project_filter_path
(
state:
'opened'
)
do
Open
Open
%li
{
class:
(
"active"
if
params
[
:state
]
==
'closed'
)}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'closed'
)}
=
link_to
project_filter_path
(
state:
'closed'
)
do
=
link_to
project_filter_path
(
state:
'closed'
)
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