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
Kazuhiko Shiozaki
gitlab-ce
Commits
6aa50165
Commit
6aa50165
authored
Mar 01, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'logged-out-search' into 'master'
Logged out search Fixes #13676 See merge request !3045
parents
b8f8a55b
4c8721b2
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
72 additions
and
43 deletions
+72
-43
CHANGELOG
CHANGELOG
+1
-0
app/assets/stylesheets/framework/common.scss
app/assets/stylesheets/framework/common.scss
+1
-1
app/assets/stylesheets/pages/search.scss
app/assets/stylesheets/pages/search.scss
+7
-3
app/controllers/search_controller.rb
app/controllers/search_controller.rb
+2
-0
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+1
-5
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+27
-22
app/views/layouts/header/_public.html.haml
app/views/layouts/header/_public.html.haml
+0
-10
app/views/search/_form.html.haml
app/views/search/_form.html.haml
+1
-1
app/views/search/_results.html.haml
app/views/search/_results.html.haml
+1
-1
features/search.feature
features/search.feature
+22
-0
features/steps/search.rb
features/steps/search.rb
+9
-0
No files found.
CHANGELOG
View file @
6aa50165
...
...
@@ -8,6 +8,7 @@ v 8.6.0 (unreleased)
- Strip leading and trailing spaces in URL validator (evuez)
- Return empty array instead of 404 when commit has no statuses in commit status API
- Update documentation to reflect Guest role not being enforced on internal projects
- Allow search for logged out users
v 8.5.2
- Fix sidebar overlapping content when screen width was below 1200px
...
...
app/assets/stylesheets/framework/common.scss
View file @
6aa50165
...
...
@@ -305,7 +305,7 @@ table {
}
.btn-sign-in
{
margin-top
:
8
px
;
margin-top
:
10
px
;
text-shadow
:
none
;
}
...
...
app/assets/stylesheets/pages/search.scss
View file @
6aa50165
.search-results
{
.search-result-row
{
border-bottom
:
1px
solid
#DDD
;
padding-bottom
:
15px
;
margin-bottom
:
15px
;
border-bottom
:
1px
solid
$border-color
;
padding-bottom
:
$gl-padding
;
margin-bottom
:
$gl-padding
;
&
:last-child
{
border-bottom
:
none
;
}
}
}
...
...
app/controllers/search_controller.rb
View file @
6aa50165
class
SearchController
<
ApplicationController
skip_before_action
:authenticate_user!
,
:reject_blocked
include
SearchHelper
layout
'search'
...
...
app/views/layouts/application.html.haml
View file @
6aa50165
...
...
@@ -5,11 +5,7 @@
-# Ideally this would be inside the head, but turbolinks only evaluates page-specific JS in the body.
=
yield
:scripts_body_top
-
if
current_user
=
render
"layouts/header/default"
,
title:
header_title
-
else
=
render
"layouts/header/public"
,
title:
header_title
=
render
"layouts/header/default"
,
title:
header_title
=
render
'layouts/page'
,
sidebar:
sidebar
=
yield
:scripts_body
app/views/layouts/header/_default.html.haml
View file @
6aa50165
...
...
@@ -13,30 +13,35 @@
%li
.visible-sm.visible-xs
=
link_to
search_path
,
title:
'Search'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'search'
)
-
if
session
[
:impersonator_id
]
%li
.impersonation
=
link_to
stop_impersonation_admin_users_path
,
method: :delete
,
title:
'Stop Impersonation'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'user-secret fw'
)
-
if
current_user
.
is_admin?
-
if
current_user
-
if
session
[
:impersonator_id
]
%li
.impersonation
=
link_to
stop_impersonation_admin_users_path
,
method: :delete
,
title:
'Stop Impersonation'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'user-secret fw'
)
-
if
current_user
.
is_admin?
%li
=
link_to
admin_root_path
,
title:
'Admin Area'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'wrench fw'
)
%li
=
link_to
admin_root_path
,
title:
'Admin Area'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'wrench fw'
)
%li
=
link_to
dashboard_todos_path
,
title:
'Todos'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
%span
.badge.todos-pending-count
=
todos_pending_count
-
if
current_user
.
can_create_project?
=
link_to
dashboard_todos_path
,
title:
'Todos'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
%span
.badge.todos-pending-count
=
todos_pending_count
-
if
current_user
.
can_create_project?
%li
=
link_to
new_project_path
,
title:
'New project'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'plus fw'
)
-
if
Gitlab
::
Sherlock
.
enabled?
%li
=
link_to
sherlock_transactions_path
,
title:
'Sherlock Transactions'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'tachometer fw'
)
%li
=
link_to
new_project_path
,
title:
'New project'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'plus fw'
)
-
if
Gitlab
::
Sherlock
.
enabled?
%li
=
link_to
sherlock_transactions_path
,
title:
'Sherlock Transactions'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'tachometer fw'
)
%li
=
link_to
destroy_user_session_path
,
class:
'logout'
,
method: :delete
,
title:
'Sign out'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'sign-out'
)
=
link_to
destroy_user_session_path
,
class:
'logout'
,
method: :delete
,
title:
'Sign out'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'sign-out'
)
-
else
.pull-right
=
link_to
"Sign in"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'btn btn-sign-in btn-success'
%h1
.title
=
title
...
...
app/views/layouts/header/_public.html.haml
deleted
100644 → 0
View file @
b8f8a55b
%header
.navbar.navbar-fixed-top.navbar-gitlab
{
class:
nav_header_class
}
%div
{
class:
fluid_layout
?
"container-fluid"
:
"container-fluid"
}
.header-content
-
unless
current_controller?
(
'sessions'
)
.pull-right
=
link_to
"Sign in"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'btn btn-sign-in btn-success'
%h1
.title
=
title
=
render
'shared/outdated_browser'
app/views/search/_form.html.haml
View file @
6aa50165
...
...
@@ -11,4 +11,4 @@
=
button_tag
'Search'
,
class:
"btn btn-primary"
-
unless
params
[
:snippets
].
eql?
'true'
%br
=
render
'filter'
=
render
'filter'
if
current_user
app/views/search/_results.html.haml
View file @
6aa50165
...
...
@@ -18,7 +18,7 @@
=
render
'shared/projects/list'
,
projects:
@objects
-
else
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@objects
=
paginate
@objects
,
theme:
'gitlab'
=
paginate
@objects
,
theme:
'gitlab'
:javascript
$
(
"
.search-results .term
"
).
highlight
(
"
#{
escape_javascript
(
params
[
:search
])
}
"
);
features/search.feature
View file @
6aa50165
...
...
@@ -65,3 +65,25 @@ Feature: Search
And
I search for
"Wiki content"
And
I click
"Wiki"
link
Then
I should see
"test_wiki"
link in the search results
Scenario
:
I
logout and should see project I am looking for
Given
project
"Shop"
is public
And
I logout
And
I search for
"Sho"
Then
I should see
"Shop"
project link
Scenario
:
I
logout and should see issues I am looking for
Given
project
"Shop"
is public
And
I logout
And
project has issues
When
I search for
"Foo"
And
I click
"Issues"
link
Then
I should see
"Foo"
link in the search results
And
I should not see
"Bar"
link in the search results
Scenario
:
I
logout and should see project code I am looking for
Given
project
"Shop"
is public
And
I logout
When
I visit project
"Shop"
page
And
I search for
"rspec"
on project page
Then
I should see code results for project
"Shop"
features/steps/search.rb
View file @
6aa50165
...
...
@@ -18,6 +18,11 @@ class Spinach::Features::Search < Spinach::FeatureSteps
click_button
"Search"
end
step
'I search for "rspec" on project page'
do
fill_in
"search"
,
with:
"rspec"
click_button
"Go"
end
step
'I search for "Wiki content"'
do
fill_in
"dashboard_search"
,
with:
"content"
click_button
"Search"
...
...
@@ -103,4 +108,8 @@ class Spinach::Features::Search < Spinach::FeatureSteps
@wiki
=
::
ProjectWiki
.
new
(
project
,
current_user
)
@wiki
.
create_page
(
"test_wiki"
,
"Some Wiki content"
,
:markdown
,
"first commit"
)
end
step
'project "Shop" is public'
do
project
.
update_attributes
(
visibility_level:
Project
::
PUBLIC
)
end
end
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