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
23f0020b
Commit
23f0020b
authored
Dec 07, 2018
by
George Tsiolis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ProjectsFinder into the controller
parent
e8d97173
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+3
-0
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+3
-0
app/views/dashboard/_projects_head.html.haml
app/views/dashboard/_projects_head.html.haml
+2
-2
No files found.
app/controllers/dashboard/projects_controller.rb
View file @
23f0020b
...
...
@@ -53,6 +53,9 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def
load_projects
(
finder_params
)
@total_user_projects_count
=
ProjectsFinder
.
new
(
params:
{
non_public:
true
},
current_user:
current_user
).
execute
@total_starred_projects_count
=
ProjectsFinder
.
new
(
params:
{
starred:
true
},
current_user:
current_user
).
execute
projects
=
ProjectsFinder
.
new
(
params:
finder_params
,
current_user:
current_user
)
.
execute
...
...
app/controllers/explore/projects_controller.rb
View file @
23f0020b
...
...
@@ -55,6 +55,9 @@ class Explore::ProjectsController < Explore::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def
load_projects
@total_user_projects_count
=
ProjectsFinder
.
new
(
params:
{
non_public:
true
},
current_user:
current_user
).
execute
@total_starred_projects_count
=
ProjectsFinder
.
new
(
params:
{
starred:
true
},
current_user:
current_user
).
execute
projects
=
ProjectsFinder
.
new
(
current_user:
current_user
,
params:
params
)
.
execute
.
includes
(
:route
,
:creator
,
:group
,
namespace:
[
:route
,
:owner
])
...
...
app/views/dashboard/_projects_head.html.haml
View file @
23f0020b
...
...
@@ -15,11 +15,11 @@
=
nav_link
(
page:
[
dashboard_projects_path
,
root_path
])
do
=
link_to
dashboard_projects_path
,
class:
'shortcuts-activity'
,
data:
{
placement:
'right'
}
do
Your projects
%span
.badge.badge-pill
=
limited_counter_with_delimiter
(
ProjectsFinder
.
new
(
params:
{
non_public:
true
},
current_user:
current_user
).
execute
)
%span
.badge.badge-pill
=
limited_counter_with_delimiter
(
@total_user_projects_count
)
=
nav_link
(
page:
starred_dashboard_projects_path
)
do
=
link_to
starred_dashboard_projects_path
,
data:
{
placement:
'right'
}
do
Starred projects
%span
.badge.badge-pill
=
limited_counter_with_delimiter
(
ProjectsFinder
.
new
(
params:
{
starred:
true
},
current_user:
current_user
).
execute
)
%span
.badge.badge-pill
=
limited_counter_with_delimiter
(
@total_starred_projects_count
)
=
nav_link
(
page:
[
explore_root_path
,
trending_explore_projects_path
,
starred_explore_projects_path
,
explore_projects_path
])
do
=
link_to
explore_root_path
,
data:
{
placement:
'right'
}
do
Explore 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