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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
dab00e69
Commit
dab00e69
authored
Jun 05, 2019
by
Martin Wortschack
Committed by
Mayra Cabrera
Jun 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add render_projects method to controller
- Render EE specific partial if exists
parent
54cc3b64
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+13
-6
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-0
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+2
-0
No files found.
app/controllers/dashboard/projects_controller.rb
View file @
dab00e69
...
@@ -6,18 +6,14 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
...
@@ -6,18 +6,14 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
prepend_before_action
(
only:
[
:index
])
{
authenticate_sessionless_user!
(
:rss
)
}
prepend_before_action
(
only:
[
:index
])
{
authenticate_sessionless_user!
(
:rss
)
}
before_action
:set_non_archived_param
before_action
:set_non_archived_param
before_action
:projects
,
only:
[
:index
]
before_action
:default_sorting
before_action
:default_sorting
skip_cross_project_access_check
:index
,
:starred
skip_cross_project_access_check
:index
,
:starred
def
index
def
index
@projects
=
load_projects
(
params
.
merge
(
non_public:
true
))
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
do
format
.
html
do
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/40260
render_projects
Gitlab
::
GitalyClient
.
allow_n_plus_1_calls
do
render
end
end
end
format
.
atom
do
format
.
atom
do
load_events
load_events
...
@@ -51,6 +47,17 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
...
@@ -51,6 +47,17 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
private
private
def
projects
@projects
||=
load_projects
(
params
.
merge
(
non_public:
true
))
end
def
render_projects
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/40260
Gitlab
::
GitalyClient
.
allow_n_plus_1_calls
do
render
end
end
def
default_sorting
def
default_sorting
params
[
:sort
]
||=
'latest_activity_desc'
params
[
:sort
]
||=
'latest_activity_desc'
@sort
=
params
[
:sort
]
@sort
=
params
[
:sort
]
...
...
app/helpers/projects_helper.rb
View file @
dab00e69
...
@@ -241,6 +241,7 @@ module ProjectsHelper
...
@@ -241,6 +241,7 @@ module ProjectsHelper
# TODO: Remove this method when removing the feature flag
# TODO: Remove this method when removing the feature flag
# https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/11209#note_162234863
# https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/11209#note_162234863
# make sure to remove from the EE specific controller as well: ee/app/controllers/ee/dashboard/projects_controller.rb
def
show_projects?
(
projects
,
params
)
def
show_projects?
(
projects
,
params
)
Feature
.
enabled?
(
:project_list_filter_bar
)
||
!!
(
params
[
:personal
]
||
params
[
:name
]
||
any_projects?
(
projects
))
Feature
.
enabled?
(
:project_list_filter_bar
)
||
!!
(
params
[
:personal
]
||
params
[
:name
]
||
any_projects?
(
projects
))
end
end
...
...
app/views/layouts/application.html.haml
View file @
dab00e69
...
@@ -10,4 +10,6 @@
...
@@ -10,4 +10,6 @@
=
render
'layouts/page'
,
sidebar:
sidebar
,
nav:
nav
=
render
'layouts/page'
,
sidebar:
sidebar
,
nav:
nav
=
footer_message
=
footer_message
=
render_if_exists
"shared/onboarding_guide"
=
yield
:scripts_body
=
yield
:scripts_body
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