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
iv
gitlab-ce
Commits
6e1ee1fe
Commit
6e1ee1fe
authored
May 09, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made some ui enhancement for search page
parent
f1126f49
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
24 deletions
+43
-24
app/controllers/search_controller.rb
app/controllers/search_controller.rb
+2
-1
app/views/search/_filter.html.haml
app/views/search/_filter.html.haml
+34
-15
app/views/search/show.html.haml
app/views/search/show.html.haml
+6
-8
features/steps/project/project_search_code.rb
features/steps/project/project_search_code.rb
+1
-0
No files found.
app/controllers/search_controller.rb
View file @
6e1ee1fe
...
...
@@ -6,7 +6,8 @@ class SearchController < ApplicationController
project_ids
=
current_user
.
authorized_projects
.
map
(
&
:id
)
if
group_id
.
present?
group_project_ids
=
Group
.
find
(
group_id
).
projects
.
map
(
&
:id
)
@group
=
Group
.
find
(
group_id
)
group_project_ids
=
@group
.
projects
.
map
(
&
:id
)
project_ids
.
select!
{
|
id
|
group_project_ids
.
include?
(
id
)}
elsif
project_id
.
present?
project_ids
.
select!
{
|
id
|
id
==
project_id
.
to_i
}
...
...
app/views/search/_filter.html.haml
View file @
6e1ee1fe
%fieldset
%legend
Groups:
.clearfix
=
select_tag
'group_id'
,
options_from_collection_for_select
(
current_user
.
authorized_groups
,
:id
,
:name
,
params
[
:group_id
]),
prompt:
'All'
,
include_blank:
true
,
class:
'trigger-submit chosen'
%fieldset
%legend
Teams:
.clearfix
=
select_tag
'team_id'
,
options_from_collection_for_select
(
current_user
.
authorized_teams
,
:id
,
:name
,
params
[
:team_id
]),
prompt:
'All'
,
include_blank:
true
,
class:
'trigger-submit chosen'
%fieldset
%legend
Projects:
.clearfix
=
select_tag
'project_id'
,
options_from_collection_for_select
(
current_user
.
authorized_projects
,
:id
,
:name_with_namespace
,
params
[
:project_id
]),
prompt:
'All'
,
include_blank:
true
,
class:
'trigger-submit chosen'
.dropdown.inline
%a
.dropdown-toggle.btn.btn-small
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
%i
.icon-tags
%span
.light
Group:
-
if
@group
.
present?
%strong
=
@group
.
name
-
else
Any
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
search_path
(
group_id:
nil
)
do
Any
-
current_user
.
authorized_groups
.
sort_by
(
&
:name
).
each
do
|
group
|
%li
=
link_to
search_path
(
group_id:
group
.
id
,
search:
params
[
:search
])
do
=
group
.
name
.dropdown.inline.prepend-left-10
%a
.dropdown-toggle.btn.btn-small
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
%i
.icon-tags
%span
.light
Project:
-
if
@project
.
present?
%strong
=
@project
.
name_with_namespace
-
else
Any
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
search_path
(
project_id:
nil
)
do
Any
-
current_user
.
authorized_projects
.
sort_by
(
&
:name_with_namespace
).
each
do
|
project
|
%li
=
link_to
search_path
(
project_id:
project
.
id
,
search:
params
[
:search
])
do
=
project
.
name_with_namespace
app/views/search/show.html.haml
View file @
6e1ee1fe
...
...
@@ -6,11 +6,9 @@
=
search_field_tag
:search
,
params
[
:search
],
placeholder:
"issue 143"
,
class:
"input-xxlarge search-text-input"
,
id:
"dashboard_search"
=
hidden_field_tag
:search_code
,
params
[
:search_code
]
=
submit_tag
'Search'
,
class:
"btn btn-primary wide"
.clearfix
.row
.span3
.prepend-top-10
=
render
'filter'
,
f:
f
.span9
.results
.results.prepend-top-10
-
if
params
[
:search
].
present?
=
render
'search/result'
features/steps/project/project_search_code.rb
View file @
6e1ee1fe
...
...
@@ -6,6 +6,7 @@ class ProjectSearchCode < Spinach::FeatureSteps
When
'I search for term "Welcome to Gitlab"'
do
fill_in
"search"
,
with:
"Welcome to Gitlab"
click_button
"Go"
click_link
'Repository Code'
end
Then
'I should see files from repository containing "Welcome to Gitlab"'
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