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
dca50ac1
Commit
dca50ac1
authored
Mar 22, 2016
by
Phil Hughes
Committed by
Jacob Schatz
Apr 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Project dropdown in header uses new dropdown
parent
5713c7cf
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
13 deletions
+51
-13
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+3
-1
app/assets/javascripts/project_select.js.coffee
app/assets/javascripts/project_select.js.coffee
+32
-0
app/assets/stylesheets/framework/header.scss
app/assets/stylesheets/framework/header.scss
+5
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+2
-12
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+2
-0
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+7
-0
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
dca50ac1
...
@@ -122,7 +122,9 @@ class GitLabDropdown
...
@@ -122,7 +122,9 @@ class GitLabDropdown
FILTER_INPUT
=
'.dropdown-input .dropdown-input-field'
FILTER_INPUT
=
'.dropdown-input .dropdown-input-field'
constructor
:
(
@
el
,
@
options
)
->
constructor
:
(
@
el
,
@
options
)
->
@
dropdown
=
$
(
@
el
).
parent
()
self
=
@
selector
=
$
(
@
el
).
data
"target"
@
dropdown
=
if
selector
?
then
$
(
selector
)
else
$
(
@
el
).
parent
()
# Set Defaults
# Set Defaults
{
{
...
...
app/assets/javascripts/project_select.js.coffee
View file @
dca50ac1
class
@
ProjectSelect
class
@
ProjectSelect
constructor
:
->
constructor
:
->
$
(
'.js-projects-dropdown-toggle'
).
each
(
i
,
dropdown
)
->
$dropdown
=
$
(
dropdown
)
$dropdown
.
glDropdown
(
filterable
:
true
filterRemote
:
true
search
:
fields
:
[
'name_with_namespace'
]
data
:
(
term
,
callback
)
->
finalCallback
=
(
projects
)
->
callback
projects
if
@
includeGroups
projectsCallback
=
(
projects
)
->
groupsCallback
=
(
groups
)
->
data
=
groups
.
concat
(
projects
)
finalCallback
(
data
)
Api
.
groups
term
,
false
,
groupsCallback
else
projectsCallback
=
finalCallback
if
@
groupId
Api
.
groupProjects
@
groupId
,
term
,
projectsCallback
else
Api
.
projects
term
,
@
orderBy
,
projectsCallback
url
:
(
project
)
->
project
.
web_url
text
:
(
project
)
->
project
.
name_with_namespace
)
$
(
'.ajax-project-select'
).
each
(
i
,
select
)
->
$
(
'.ajax-project-select'
).
each
(
i
,
select
)
->
@
groupId
=
$
(
select
).
data
(
'group-id'
)
@
groupId
=
$
(
select
).
data
(
'group-id'
)
@
includeGroups
=
$
(
select
).
data
(
'include-groups'
)
@
includeGroups
=
$
(
select
).
data
(
'include-groups'
)
...
...
app/assets/stylesheets/framework/header.scss
View file @
dca50ac1
...
@@ -69,6 +69,7 @@ header {
...
@@ -69,6 +69,7 @@ header {
}
}
.header-content
{
.header-content
{
position
:
relative
;
height
:
$header-height
;
height
:
$header-height
;
padding-right
:
20px
;
padding-right
:
20px
;
...
@@ -76,6 +77,10 @@ header {
...
@@ -76,6 +77,10 @@ header {
padding-right
:
0
;
padding-right
:
0
;
}
}
.dropdown-menu
{
margin-top
:
-5px
;
}
.title
{
.title
{
margin
:
0
;
margin
:
0
;
font-size
:
19px
;
font-size
:
19px
;
...
...
app/helpers/projects_helper.rb
View file @
dca50ac1
...
@@ -65,18 +65,8 @@ module ProjectsHelper
...
@@ -65,18 +65,8 @@ module ProjectsHelper
link_to
(
simple_sanitize
(
owner
.
name
),
user_path
(
owner
))
link_to
(
simple_sanitize
(
owner
.
name
),
user_path
(
owner
))
end
end
project_link
=
link_to
project_path
(
project
),
{
class:
"project-item-select-holder"
}
do
project_link
=
link_to
simple_sanitize
(
project
.
name
),
project_path
(
project
),
{
class:
"project-item-select-holder"
}
link_output
=
simple_sanitize
(
project
.
name
)
project_link
+=
icon
"chevron-down"
,
class:
"dropdown-toggle-caret js-projects-dropdown-toggle"
,
data:
{
target:
".header-content"
,
toggle:
"dropdown"
}
if
current_user
if
current_user
link_output
+=
project_select_tag
:project_path
,
class:
"project-item-select js-projects-dropdown"
,
data:
{
include_groups:
false
,
order_by:
'last_activity_at'
}
end
link_output
end
project_link
+=
icon
"chevron-down"
,
class:
"dropdown-toggle-caret js-projects-dropdown-toggle"
if
current_user
full_title
=
namespace_link
+
' / '
+
project_link
full_title
=
namespace_link
+
' / '
+
project_link
full_title
+=
' · '
.
html_safe
+
link_to
(
simple_sanitize
(
name
),
url
)
if
name
full_title
+=
' · '
.
html_safe
+
link_to
(
simple_sanitize
(
name
),
url
)
if
name
...
...
app/views/layouts/header/_default.html.haml
View file @
dca50ac1
...
@@ -45,6 +45,8 @@
...
@@ -45,6 +45,8 @@
%h1
.title
=
title
%h1
.title
=
title
=
yield
:header_content
=
render
'shared/outdated_browser'
=
render
'shared/outdated_browser'
-
if
@project
&&
!
@project
.
empty_repo?
-
if
@project
&&
!
@project
.
empty_repo?
...
...
app/views/layouts/project.html.haml
View file @
dca50ac1
...
@@ -17,4 +17,11 @@
...
@@ -17,4 +17,11 @@
-
content_for
:scripts_body
do
-
content_for
:scripts_body
do
=
render
"layouts/init_auto_complete"
if
current_user
=
render
"layouts/init_auto_complete"
if
current_user
-
content_for
:header_content
do
.dropdown-menu.dropdown-select
=
dropdown_title
(
"Go to a project"
)
=
dropdown_filter
(
"Search your projects"
)
=
dropdown_content
=
dropdown_loading
=
render
template:
"layouts/application"
=
render
template:
"layouts/application"
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