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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
d618a5fe
Commit
d618a5fe
authored
Nov 06, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor search views
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
593b05ea
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
64 deletions
+65
-64
app/views/search/_global_results.html.haml
app/views/search/_global_results.html.haml
+5
-0
app/views/search/_project_results.html.haml
app/views/search/_project_results.html.haml
+17
-0
app/views/search/_result.html.haml
app/views/search/_result.html.haml
+0
-62
app/views/search/_results.html.haml
app/views/search/_results.html.haml
+13
-0
app/views/search/results/_blob.html.haml
app/views/search/results/_blob.html.haml
+1
-1
app/views/search/results/_issue.html.haml
app/views/search/results/_issue.html.haml
+9
-0
app/views/search/results/_merge_request.html.haml
app/views/search/results/_merge_request.html.haml
+12
-0
app/views/search/results/_project.html.haml
app/views/search/results/_project.html.haml
+7
-0
app/views/search/show.html.haml
app/views/search/show.html.haml
+1
-1
No files found.
app/views/search/_global_results.html.haml
0 → 100644
View file @
d618a5fe
.search_results
%ul
.bordered-list
=
render
partial:
"search/results/project"
,
collection:
@projects
=
render
partial:
"search/results/merge_request"
,
collection:
@merge_requests
=
render
partial:
"search/results/issue"
,
collection:
@issues
app/views/search/_project_results.html.haml
0 → 100644
View file @
d618a5fe
%ul
.nav.nav-pills
%li
{
class:
(
"active"
if
params
[
:search_code
].
present?
)}
=
link_to
search_path
(
params
.
merge
(
search_code:
true
))
do
Repository Code
%li
{
class:
(
"active"
if
params
[
:search_code
].
blank?
)}
=
link_to
search_path
(
params
.
merge
(
search_code:
nil
))
do
Everything else
.search_results
-
if
params
[
:search_code
].
present?
.blob-results
=
render
partial:
"search/results/blob"
,
collection:
@blobs
=
paginate
@blobs
,
theme:
'gitlab'
-
else
%ul
.bordered-list
=
render
partial:
"search/results/merge_request"
,
collection:
@merge_requests
=
render
partial:
"search/results/issue"
,
collection:
@issues
app/views/search/_result.html.haml
deleted
100644 → 0
View file @
593b05ea
%fieldset
%legend
Search results
%span
.cgray
(
#{
@total_results
}
)
-
if
@project
%ul
.nav.nav-pills
%li
{
class:
(
"active"
if
params
[
:search_code
].
present?
)}
=
link_to
search_path
(
params
.
merge
(
search_code:
true
))
do
Repository Code
%li
{
class:
(
"active"
if
params
[
:search_code
].
blank?
)}
=
link_to
search_path
(
params
.
merge
(
search_code:
nil
))
do
Everything else
.search_results
%ul
.bordered-list
-
@projects
.
each
do
|
project
|
%li
project:
=
link_to
project
do
%strong
.term
=
project
.
name_with_namespace
-
@merge_requests
.
each
do
|
merge_request
|
%li
merge request:
=
link_to
[
merge_request
.
target_project
,
merge_request
]
do
%span
##{merge_request.iid}
%strong
.term
=
truncate
merge_request
.
title
,
length:
50
-
if
merge_request
.
for_fork?
%span
.light
(
#{
merge_request
.
source_project
.
name_with_namespace
}
:
#{
merge_request
.
source_branch
}
→
#{
merge_request
.
target_project
.
name_with_namespace
}
:
#{
merge_request
.
target_branch
}
)
-
else
%span
.light
(
#{
merge_request
.
source_branch
}
→
#{
merge_request
.
target_branch
}
)
-
if
merge_request
.
closed?
%span
.label
Closed
-
@issues
.
each
do
|
issue
|
%li
issue:
=
link_to
[
issue
.
project
,
issue
]
do
%span
##{issue.iid}
%strong
.term
=
truncate
issue
.
title
,
length:
50
%span
.light
(
#{
issue
.
project
.
name_with_namespace
}
)
-
if
issue
.
closed?
%span
.label
Closed
-
@wiki_pages
.
each
do
|
wiki_page
|
%li
wiki:
=
link_to
project_wiki_path
(
wiki_page
.
project
,
wiki_page
)
do
%strong
.term
=
truncate
wiki_page
.
title
,
length:
50
%span
.light
(
#{
wiki_page
.
project
.
name_with_namespace
}
)
-
@blobs
.
each
do
|
blob
|
=
render
'blob'
,
blob:
blob
=
paginate
@blobs
,
theme:
'gitlab'
:javascript
$
(
"
.search_results .term
"
).
highlight
(
"
#{
escape_javascript
(
params
[
:search
])
}
"
);
app/views/search/_results.html.haml
0 → 100644
View file @
d618a5fe
%fieldset
%legend
Search results
%span
.cgray
(
#{
@total_results
}
)
-
if
@project
=
render
"project_results"
-
else
=
render
"global_results"
:javascript
$
(
"
.search_results .term
"
).
highlight
(
"
#{
escape_javascript
(
params
[
:search
])
}
"
);
app/views/search/_blob.html.haml
→
app/views/search/
results/
_blob.html.haml
View file @
d618a5fe
%li
.blob-result
.file-holder
.file-title
=
link_to
project_blob_path
(
@project
,
tree_join
(
blob
.
ref
,
blob
.
filename
),
:anchor
=>
"L"
+
blob
.
startline
.
to_s
)
do
...
...
app/views/search/results/_issue.html.haml
0 → 100644
View file @
d618a5fe
%li
issue:
=
link_to
[
issue
.
project
,
issue
]
do
%span
##{issue.iid}
%strong
.term
=
truncate
issue
.
title
,
length:
50
%span
.light
(
#{
issue
.
project
.
name_with_namespace
}
)
-
if
issue
.
closed?
%span
.label
Closed
app/views/search/results/_merge_request.html.haml
0 → 100644
View file @
d618a5fe
%li
merge request:
=
link_to
[
merge_request
.
target_project
,
merge_request
]
do
%span
##{merge_request.iid}
%strong
.term
=
truncate
merge_request
.
title
,
length:
50
-
if
merge_request
.
for_fork?
%span
.light
(
#{
merge_request
.
source_project
.
name_with_namespace
}
:
#{
merge_request
.
source_branch
}
→
#{
merge_request
.
target_project
.
name_with_namespace
}
:
#{
merge_request
.
target_branch
}
)
-
else
%span
.light
(
#{
merge_request
.
source_branch
}
→
#{
merge_request
.
target_branch
}
)
-
if
merge_request
.
closed?
%span
.label
Closed
app/views/search/results/_project.html.haml
0 → 100644
View file @
d618a5fe
%li
project:
=
link_to
project
do
%strong
.term
=
project
.
name_with_namespace
-
if
project
.
description
.
present?
–
%span
.light.term
=
project
.
description
app/views/search/show.html.haml
View file @
d618a5fe
...
...
@@ -13,4 +13,4 @@
.results.prepend-top-10
-
if
params
[
:search
].
present?
=
render
'search/result'
=
render
'search/result
s
'
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