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
db881906
Commit
db881906
authored
Aug 28, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'improve-search-output' into 'master'
Improve search output See merge request !1046
parents
c9bf3581
1056d91c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
68 additions
and
74 deletions
+68
-74
app/assets/stylesheets/sections/search.scss
app/assets/stylesheets/sections/search.scss
+7
-0
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+1
-1
app/views/search/_global_filter.html.haml
app/views/search/_global_filter.html.haml
+16
-0
app/views/search/_global_results.html.haml
app/views/search/_global_results.html.haml
+0
-27
app/views/search/_project_filter.html.haml
app/views/search/_project_filter.html.haml
+25
-0
app/views/search/_project_results.html.haml
app/views/search/_project_results.html.haml
+0
-36
app/views/search/_results.html.haml
app/views/search/_results.html.haml
+14
-5
app/views/search/results/_issue.html.haml
app/views/search/results/_issue.html.haml
+1
-1
app/views/search/results/_merge_request.html.haml
app/views/search/results/_merge_request.html.haml
+1
-1
app/views/search/results/_note.html.haml
app/views/search/results/_note.html.haml
+2
-2
app/views/search/results/_project.html.haml
app/views/search/results/_project.html.haml
+1
-1
No files found.
app/assets/stylesheets/sections/search.scss
0 → 100644
View file @
db881906
.search-results
{
.search-result-row
{
border-bottom
:
1px
solid
#EEE
;
padding-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
app/helpers/search_helper.rb
View file @
db881906
...
...
@@ -106,6 +106,6 @@ module SearchHelper
# Sanitize html generated after parsing markdown from issue description or comment
def
search_md_sanitize
(
html
)
sanitize
(
html
,
tags:
%w(a p ul li pre code)
)
sanitize
(
html
,
tags:
%w(a p
ol
ul li pre code)
)
end
end
app/views/search/_global_filter.html.haml
0 → 100644
View file @
db881906
%ul
.nav.nav-pills.nav-stacked.search-filter
%li
{
class:
(
"active"
if
@scope
==
'projects'
)}
=
link_to
search_filter_path
(
scope:
'projects'
)
do
Projects
.pull-right
=
@search_results
.
projects_count
%li
{
class:
(
"active"
if
@scope
==
'issues'
)}
=
link_to
search_filter_path
(
scope:
'issues'
)
do
Issues
.pull-right
=
@search_results
.
issues_count
%li
{
class:
(
"active"
if
@scope
==
'merge_requests'
)}
=
link_to
search_filter_path
(
scope:
'merge_requests'
)
do
Merge requests
.pull-right
=
@search_results
.
merge_requests_count
app/views/search/_global_results.html.haml
deleted
100644 → 0
View file @
c9bf3581
.row
.col-sm-3
%ul
.nav.nav-pills.nav-stacked.search-filter
%li
{
class:
(
"active"
if
@scope
==
'projects'
)}
=
link_to
search_filter_path
(
scope:
'projects'
)
do
Projects
.pull-right
=
@search_results
.
projects_count
%li
{
class:
(
"active"
if
@scope
==
'issues'
)}
=
link_to
search_filter_path
(
scope:
'issues'
)
do
Issues
.pull-right
=
@search_results
.
issues_count
%li
{
class:
(
"active"
if
@scope
==
'merge_requests'
)}
=
link_to
search_filter_path
(
scope:
'merge_requests'
)
do
Merge requests
.pull-right
=
@search_results
.
merge_requests_count
.col-sm-9
.search_results
-
if
@search_results
.
empty?
=
render
partial:
"search/results/empty"
,
locals:
{
message:
"We couldn't find any matching results"
}
%ul
.bordered-list.top-list
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@objects
=
paginate
@objects
,
theme:
'gitlab'
app/views/search/_project_filter.html.haml
0 → 100644
View file @
db881906
%ul
.nav.nav-pills.nav-stacked.search-filter
%li
{
class:
(
"active"
if
@scope
==
'blobs'
)}
=
link_to
search_filter_path
(
scope:
'blobs'
)
do
%i
.icon-code
Code
.pull-right
=
@search_results
.
blobs_count
%li
{
class:
(
"active"
if
@scope
==
'issues'
)}
=
link_to
search_filter_path
(
scope:
'issues'
)
do
%i
.icon-exclamation-sign
Issues
.pull-right
=
@search_results
.
issues_count
%li
{
class:
(
"active"
if
@scope
==
'merge_requests'
)}
=
link_to
search_filter_path
(
scope:
'merge_requests'
)
do
%i
.icon-code-fork
Merge requests
.pull-right
=
@search_results
.
merge_requests_count
%li
{
class:
(
"active"
if
@scope
==
'notes'
)}
=
link_to
search_filter_path
(
scope:
'notes'
)
do
%i
.icon-comments
Comments
.pull-right
=
@search_results
.
notes_count
app/views/search/_project_results.html.haml
deleted
100644 → 0
View file @
c9bf3581
.row
.col-sm-3
%ul
.nav.nav-pills.nav-stacked.search-filter
%li
{
class:
(
"active"
if
@scope
==
'blobs'
)}
=
link_to
search_filter_path
(
scope:
'blobs'
)
do
%i
.icon-code
Code
.pull-right
=
@search_results
.
blobs_count
%li
{
class:
(
"active"
if
@scope
==
'issues'
)}
=
link_to
search_filter_path
(
scope:
'issues'
)
do
%i
.icon-exclamation-sign
Issues
.pull-right
=
@search_results
.
issues_count
%li
{
class:
(
"active"
if
@scope
==
'merge_requests'
)}
=
link_to
search_filter_path
(
scope:
'merge_requests'
)
do
%i
.icon-code-fork
Merge requests
.pull-right
=
@search_results
.
merge_requests_count
%li
{
class:
(
"active"
if
@scope
==
'notes'
)}
=
link_to
search_filter_path
(
scope:
'notes'
)
do
%i
.icon-comments
Comments
.pull-right
=
@search_results
.
notes_count
.col-sm-9
.search_results
-
if
@search_results
.
empty?
=
render
partial:
"search/results/empty"
,
locals:
{
message:
"We couldn't find any matching results"
}
%ul
.bordered-list.top-list
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@objects
=
paginate
@objects
,
theme:
'gitlab'
app/views/search/_results.html.haml
View file @
db881906
...
...
@@ -7,10 +7,19 @@
%hr
-
if
@project
=
render
"project_results"
-
else
=
render
"global_results"
.row
.col-sm-3
-
if
@project
=
render
"project_filter"
-
else
=
render
"global_filter"
.col-sm-9
.search-results
-
if
@search_results
.
empty?
=
render
partial:
"search/results/empty"
,
locals:
{
message:
"We couldn't find any matching results"
}
-
else
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@objects
=
paginate
@objects
,
theme:
'gitlab'
:javascript
$
(
"
.search
_
results .term
"
).
highlight
(
"
#{
escape_javascript
(
params
[
:search
])
}
"
);
$
(
"
.search
-
results .term
"
).
highlight
(
"
#{
escape_javascript
(
params
[
:search
])
}
"
);
app/views/search/results/_issue.html.haml
View file @
db881906
%li
.search-result-row
%h4
=
link_to
[
issue
.
project
,
issue
]
do
%span
.term.str-truncated
=
issue
.
title
...
...
app/views/search/results/_merge_request.html.haml
View file @
db881906
%li
.search-result-row
%h4
=
link_to
[
merge_request
.
target_project
,
merge_request
]
do
%span
.term.str-truncated
=
merge_request
.
title
...
...
app/views/search/results/_note.html.haml
View file @
db881906
-
project
=
note
.
project
%li
%h5
.note-search-caption
.search-result-row
%h5
.note-search-caption
.str-truncated
%i
.icon-comment
=
link_to_member
(
project
,
note
.
author
,
avatar:
false
)
commented on
...
...
app/views/search/results/_project.html.haml
View file @
db881906
%li
.search-result-row
%h4
=
link_to
project
do
%span
.term
=
project
.
name_with_namespace
...
...
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