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
3058a8fa
Commit
3058a8fa
authored
Mar 20, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix "Shared projects" tab
parent
fd8d44ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+2
-2
app/finders/group_projects_finder.rb
app/finders/group_projects_finder.rb
+8
-8
No files found.
app/controllers/groups_controller.rb
View file @
3058a8fa
...
@@ -44,7 +44,7 @@ class GroupsController < Groups::ApplicationController
...
@@ -44,7 +44,7 @@ class GroupsController < Groups::ApplicationController
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
params
[
:filter_projects
].
blank?
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
params
[
:filter_projects
].
blank?
@shared_projects
=
GroupProjectsFinder
.
new
(
group
,
shared:
true
).
execute
(
current_user
)
@shared_projects
=
GroupProjectsFinder
.
new
(
group
,
only_
shared:
true
).
execute
(
current_user
)
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
...
@@ -77,7 +77,7 @@ class GroupsController < Groups::ApplicationController
...
@@ -77,7 +77,7 @@ class GroupsController < Groups::ApplicationController
end
end
def
projects
def
projects
@projects
=
@
projects
.
sorted_by_activity
.
page
(
params
[
:page
])
@projects
=
@
group
.
projects
.
page
(
params
[
:page
])
end
end
def
update
def
update
...
...
app/finders/group_projects_finder.rb
View file @
3058a8fa
...
@@ -13,29 +13,29 @@ class GroupProjectsFinder < UnionFinder
...
@@ -13,29 +13,29 @@ class GroupProjectsFinder < UnionFinder
private
private
def
group_projects
(
current_user
)
def
group_projects
(
current_user
)
include_owned
=
@options
.
fetch
(
:owned
,
tru
e
)
only_owned
=
@options
.
fetch
(
:only_owned
,
fals
e
)
include_shared
=
@options
.
fetch
(
:shared
,
tru
e
)
only_shared
=
@options
.
fetch
(
:only_shared
,
fals
e
)
projects
=
[]
projects
=
[]
if
current_user
if
current_user
if
@group
.
users
.
include?
(
current_user
)
if
@group
.
users
.
include?
(
current_user
)
projects
<<
@group
.
projects
if
include_own
ed
projects
<<
@group
.
projects
unless
only_shar
ed
projects
<<
@group
.
shared_projects
if
include_shar
ed
projects
<<
@group
.
shared_projects
unless
only_own
ed
else
else
if
include_own
ed
unless
only_shar
ed
projects
<<
@group
.
projects
.
visible_to_user
(
current_user
)
projects
<<
@group
.
projects
.
visible_to_user
(
current_user
)
projects
<<
@group
.
projects
.
public_to_user
(
current_user
)
projects
<<
@group
.
projects
.
public_to_user
(
current_user
)
end
end
if
include_shar
ed
unless
only_own
ed
projects
<<
@group
.
shared_projects
.
visible_to_user
(
current_user
)
projects
<<
@group
.
shared_projects
.
visible_to_user
(
current_user
)
projects
<<
@group
.
shared_projects
.
public_to_user
(
current_user
)
projects
<<
@group
.
shared_projects
.
public_to_user
(
current_user
)
end
end
end
end
else
else
projects
<<
@group
.
projects
.
public_only
if
include_own
ed
projects
<<
@group
.
projects
.
public_only
unless
only_shar
ed
projects
<<
@group
.
shared_projects
.
public_only
if
include_shar
ed
projects
<<
@group
.
shared_projects
.
public_only
unless
only_own
ed
end
end
projects
projects
...
...
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