Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
d6303fe39b9b
Commit
a43a3803
authored
Aug 07, 2013
by
Dmitriy Zaporozhets
Browse files
Increase amount of search results for issues, mr, projects
parent
456dd75a64a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/contexts/search_context.rb
View file @
d6303fe3
...
...
@@ -11,7 +11,7 @@ def execute
return
result
unless
query
.
present?
projects
=
Project
.
where
(
id:
project_ids
)
result
[
:projects
]
=
projects
.
search
(
query
).
limit
(
1
0
)
result
[
:projects
]
=
projects
.
search
(
query
).
limit
(
2
0
)
# Search inside singe project
project
=
projects
.
first
if
projects
.
length
==
1
...
...
@@ -19,8 +19,8 @@ def execute
if
params
[
:search_code
].
present?
result
[
:blobs
]
=
project
.
repository
.
search_files
(
query
,
params
[
:repository_ref
])
unless
project
.
empty_repo?
else
result
[
:merge_requests
]
=
MergeRequest
.
where
(
project_id:
project_ids
).
search
(
query
).
limit
(
1
0
)
result
[
:issues
]
=
Issue
.
where
(
project_id:
project_ids
).
search
(
query
).
limit
(
1
0
)
result
[
:merge_requests
]
=
MergeRequest
.
where
(
project_id:
project_ids
).
search
(
query
).
limit
(
2
0
)
result
[
:issues
]
=
Issue
.
where
(
project_id:
project_ids
).
search
(
query
).
limit
(
2
0
)
result
[
:wiki_pages
]
=
[]
end
result
...
...
app/views/shared/_issues.html.haml
View file @
d6303fe3
...
...
@@ -9,7 +9,6 @@
%ul
.well-list.issues-list
-
group
[
1
].
each
do
|
issue
|
=
render
'projects/issues/issue'
,
issue:
issue
%hr
=
paginate
@issues
,
theme:
"gitlab"
-
else
%p
.nothing_here_message
Nothing to show here
...
...
app/views/shared/_merge_requests.html.haml
View file @
d6303fe3
...
...
@@ -7,7 +7,6 @@
%ul
.well-list.mr-list
-
group
[
1
].
each
do
|
merge_request
|
=
render
'projects/merge_requests/merge_request'
,
merge_request:
merge_request
%hr
=
paginate
@merge_requests
,
theme:
"gitlab"
-
else
...
...
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