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
Tatuya Kamada
gitlab-ce
Commits
33af01f3
Commit
33af01f3
authored
Jul 26, 2016
by
Connor Shea
Committed by
Alfredo Sumaran
Aug 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move data attribute information to relevant elements.
parent
909d2d8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
app/views/layouts/_search.html.haml
app/views/layouts/_search.html.haml
+9
-11
No files found.
app/views/layouts/_search.html.haml
View file @
33af01f3
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
-
label
=
'This group'
-
label
=
'This group'
-
if
controller
.
controller_path
=~
/^projects/
&&
@project
.
persisted?
-
if
controller
.
controller_path
=~
/^projects/
&&
@project
.
persisted?
-
label
=
'This project'
-
label
=
'This project'
-
if
@group
&&
@group
.
persisted?
&&
@group
.
path
-
group_data_attrs
=
{
group_path:
"
#{
j
(
@group
.
path
)
}
"
,
name:
"
#{
j
(
@group
.
name
)
}
"
,
issues_path:
"
#{
issues_group_path
(
j
(
@group
.
path
))
}
"
,
mr_path:
"
#{
merge_requests_group_path
(
j
(
@group
.
path
))
}
"
}
-
if
@project
&&
@project
.
persisted?
-
project_data_attrs
=
{
project_path:
"
#{
j
(
@project
.
path
)
}
"
,
name:
"
#{
j
(
@project
.
name
)
}
"
,
issues_path:
"
#{
namespace_project_issues_path
(
@project
.
namespace
,
@project
)
}
"
,
mr_path:
"
#{
namespace_project_merge_requests_path
(
@project
.
namespace
,
@project
)
}
"
}
.search.search-form
{
class:
"#{'has-location-badge' if label.present?}"
}
.search.search-form
{
class:
"#{'has-location-badge' if label.present?}"
}
=
form_tag
search_path
,
method: :get
,
class:
'navbar-form'
do
|
f
|
=
form_tag
search_path
,
method: :get
,
class:
'navbar-form'
do
|
f
|
...
@@ -9,8 +13,8 @@
...
@@ -9,8 +13,8 @@
-
if
label
.
present?
-
if
label
.
present?
.location-badge
=
label
.location-badge
=
label
.search-input-wrap
.search-input-wrap
.dropdown
{
data:
{
url:
search_autocomplete_path
}
}
.dropdown
{
data:
{
url:
search_autocomplete_path
}
}
=
search_field_tag
"search"
,
nil
,
placeholder:
'Search'
,
class:
"search-input dropdown-menu-toggle
"
,
spellcheck:
false
,
tabindex:
"1"
,
autocomplete:
'off'
,
data:
{
toggle:
'dropdown'
}
=
search_field_tag
"search"
,
nil
,
placeholder:
'Search'
,
class:
"search-input dropdown-menu-toggle
js-search-dashboard-options"
,
spellcheck:
false
,
tabindex:
"1"
,
autocomplete:
'off'
,
data:
{
toggle:
'dropdown'
,
issues_path:
"
#{
issues_dashboard_url
}
"
,
mr_path:
"
#{
merge_requests_dashboard_url
}
"
}
.dropdown-menu.dropdown-select
.dropdown-menu.dropdown-select
=
dropdown_content
do
=
dropdown_content
do
%ul
%ul
...
@@ -21,8 +25,9 @@
...
@@ -21,8 +25,9 @@
%i
.search-icon
%i
.search-icon
%i
.clear-icon.js-clear-input
%i
.clear-icon.js-clear-input
=
hidden_field_tag
:group_id
,
@group
.
try
(
:id
)
=
hidden_field_tag
:group_id
,
@group
.
try
(
:id
),
class:
'js-search-group-options'
,
data:
group_data_attrs
=
hidden_field_tag
:project_id
,
@project
&&
@project
.
persisted?
?
@project
.
id
:
''
,
id:
'search_project_id'
=
hidden_field_tag
:project_id
,
@project
&&
@project
.
persisted?
?
@project
.
id
:
''
,
id:
'search_project_id'
,
class:
'js-search-project-options'
,
data:
project_data_attrs
-
if
@project
&&
@project
.
persisted?
-
if
@project
&&
@project
.
persisted?
-
if
current_controller?
(
:issues
)
-
if
current_controller?
(
:issues
)
...
@@ -36,13 +41,6 @@
...
@@ -36,13 +41,6 @@
-
else
-
else
=
hidden_field_tag
:search_code
,
true
=
hidden_field_tag
:search_code
,
true
.js-search-project-options
{
data:
{
project_path:
"#{j(@project.path)}"
,
name:
"#{j(@project.name)}"
,
issues_path:
"#{namespace_project_issues_path(@project.namespace, @project)}"
,
mr_path:
"#{namespace_project_merge_requests_path(@project.namespace, @project)}"
}
}
-
if
@group
&&
@group
.
persisted?
&&
@group
.
path
.js-search-group-options
{
data:
{
group_path:
"#{j(@group.path)}"
,
name:
"#{j(@group.name)}"
,
issues_path:
"#{issues_group_path(j(@group.path))}"
,
mr_path:
"#{merge_requests_group_path(j(@group.path))}"
}
}
.js-search-dashboard-options
{
data:
{
issues_path:
"#{issues_dashboard_url}"
,
mr_path:
"#{merge_requests_dashboard_url}"
}
}
-
if
@snippet
||
@snippets
-
if
@snippet
||
@snippets
=
hidden_field_tag
:snippets
,
true
=
hidden_field_tag
:snippets
,
true
=
hidden_field_tag
:repository_ref
,
@ref
=
hidden_field_tag
:repository_ref
,
@ref
...
...
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