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
6252fe45
Commit
6252fe45
authored
Dec 02, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify new project namespace select and path input
parent
09e712c0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
+21
-13
app/assets/stylesheets/framework/forms.scss
app/assets/stylesheets/framework/forms.scss
+8
-0
app/helpers/namespaces_helper.rb
app/helpers/namespaces_helper.rb
+3
-3
app/views/projects/new.html.haml
app/views/projects/new.html.haml
+10
-10
No files found.
app/assets/stylesheets/framework/forms.scss
View file @
6252fe45
...
@@ -88,7 +88,15 @@ label {
...
@@ -88,7 +88,15 @@ label {
}
}
.input-group
{
.input-group
{
.select2-container
{
display
:
table-cell
;
width
:
200px
!
important
;
}
.input-group-addon
{
.input-group-addon
{
background-color
:
#f7f8fa
;
background-color
:
#f7f8fa
;
}
}
.input-group-addon
:not
(
:first-child
)
:not
(
:last-child
)
{
border-left
:
0
;
border-right
:
0
;
}
}
}
app/helpers/namespaces_helper.rb
View file @
6252fe45
module
NamespacesHelper
module
NamespacesHelper
def
namespaces_options
(
selected
=
:current_user
,
scope
=
:default
)
def
namespaces_options
(
selected
=
:current_user
,
display_path:
false
)
groups
=
current_user
.
owned_groups
+
current_user
.
masters_groups
groups
=
current_user
.
owned_groups
+
current_user
.
masters_groups
users
=
[
current_user
.
namespace
]
users
=
[
current_user
.
namespace
]
group_opts
=
[
"Groups"
,
groups
.
sort_by
(
&
:human_name
).
map
{
|
g
|
[
g
.
human_name
,
g
.
id
]}
]
group_opts
=
[
"Groups"
,
groups
.
sort_by
(
&
:human_name
).
map
{
|
g
|
[
display_path
?
g
.
path
:
g
.
human_name
,
g
.
id
]}
]
users_opts
=
[
"Users"
,
users
.
sort_by
(
&
:human_name
).
map
{
|
u
|
[
u
.
human_name
,
u
.
id
]}
]
users_opts
=
[
"Users"
,
users
.
sort_by
(
&
:human_name
).
map
{
|
u
|
[
display_path
?
u
.
path
:
u
.
human_name
,
u
.
id
]}
]
options
=
[]
options
=
[]
options
<<
group_opts
options
<<
group_opts
...
...
app/views/projects/new.html.haml
View file @
6252fe45
...
@@ -11,16 +11,16 @@
...
@@ -11,16 +11,16 @@
Project path
Project path
.col-sm-10
.col-sm-10
.input-group
.input-group
=
f
.
text_field
:path
,
placeholder:
"my-awesome-project"
,
class:
"form-control"
,
tabindex:
1
,
autofocus:
true
,
required:
true
.input-group-addon
\.git
-
if
current_user
.
can_select_namespace?
-
if
current_user
.
can_select_namespace?
.form-group
.input-group-addon
=
f
.
label
:namespace_id
,
class:
'control-label'
do
=
root_url
%span
Namespace
=
f
.
select
:namespace_id
,
namespaces_options
(
params
[
:namespace_id
]
||
:current_user
,
display_path:
true
),
{},
{
class:
'select2'
,
tabindex:
1
}
.col-sm-10
.input-group-addon
=
f
.
select
:namespace_id
,
namespaces_options
(
params
[
:namespace_id
]
||
:current_user
),
{},
{
class:
'select2'
,
tabindex:
2
}
\/
-
else
.input-group-addon
#{
root_url
}#{
current_user
.
username
}
/
=
f
.
text_field
:path
,
placeholder:
"my-awesome-project"
,
class:
"form-control"
,
tabindex:
2
,
autofocus:
true
,
required:
true
-
if
import_sources_enabled?
-
if
import_sources_enabled?
.project-import.js-toggle-container
.project-import.js-toggle-container
...
...
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