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
Tatuya Kamada
gitlab-ce
Commits
643afcbe
Commit
643afcbe
authored
Mar 02, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce amount of sql queries on dashboard projects page
parent
ed3bd155
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+1
-1
app/views/dashboard/projects.html.haml
app/views/dashboard/projects.html.haml
+1
-1
No files found.
app/controllers/dashboard_controller.rb
View file @
643afcbe
...
@@ -47,7 +47,7 @@ class DashboardController < ApplicationController
...
@@ -47,7 +47,7 @@ class DashboardController < ApplicationController
@projects
=
@projects
.
where
(
namespace_id:
Group
.
find_by
(
name:
params
[
:group
]))
if
params
[
:group
].
present?
@projects
=
@projects
.
where
(
namespace_id:
Group
.
find_by
(
name:
params
[
:group
]))
if
params
[
:group
].
present?
@projects
=
@projects
.
where
(
visibility_level:
params
[
:visibility_level
])
if
params
[
:visibility_level
].
present?
@projects
=
@projects
.
where
(
visibility_level:
params
[
:visibility_level
])
if
params
[
:visibility_level
].
present?
@projects
=
@projects
.
includes
(
:namespace
)
@projects
=
@projects
.
includes
(
:namespace
,
:forked_from_project
,
:tags
)
@projects
=
@projects
.
tagged_with
(
params
[
:tag
])
if
params
[
:tag
].
present?
@projects
=
@projects
.
tagged_with
(
params
[
:tag
])
if
params
[
:tag
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
...
...
app/views/dashboard/projects.html.haml
View file @
643afcbe
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
%li
.my-project-row
%li
.my-project-row
%h4
.project-title
%h4
.project-title
.pull-left
.pull-left
=
project_icon
(
"
#{
project
.
namespace
.
to_param
}
/
#{
project
.
to_param
}
"
,
alt:
''
,
class:
'avatar project-avatar s60'
)
=
project_icon
(
project
,
alt:
''
,
class:
'avatar project-avatar s60'
)
.project-access-icon
.project-access-icon
=
visibility_level_icon
(
project
.
visibility_level
)
=
visibility_level_icon
(
project
.
visibility_level
)
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
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