Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
fc68196bc263
Unverified
Commit
59bb635e
authored
Dec 22, 2014
by
Dmitriy Zaporozhets
Browse files
Set project path & name in one field without transforamtion
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d6b6ebf8b551
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/services/projects/create_service.rb
View file @
fc68196b
...
...
@@ -12,12 +12,10 @@ def execute
@project
.
visibility_level
=
default_features
.
visibility_level
end
# Parametrize path for project
#
# Ex.
# 'GitLab HQ'.parameterize => "gitlab-hq"
#
@project
.
path
=
@project
.
name
.
dup
.
parameterize
unless
@project
.
path
.
present?
# Set project name from path
unless
@project
.
name
.
present?
@project
.
name
=
@project
.
path
.
dup
end
# get namespace id
namespace_id
=
params
[
:namespace_id
]
...
...
app/views/projects/new.html.haml
View file @
fc68196b
...
...
@@ -5,10 +5,13 @@
=
form_for
@project
,
html:
{
class:
'new_project form-horizontal'
}
do
|
f
|
.form-group.project-name-holder
=
f
.
label
:
name
,
class:
'control-label'
do
=
f
.
label
:
path
,
class:
'control-label'
do
%strong
Project name
.col-sm-10
=
f
.
text_field
:name
,
placeholder:
"Example Project"
,
class:
"form-control"
,
tabindex:
1
,
autofocus:
true
.input-group
=
f
.
text_field
:path
,
placeholder:
"my-awesome-project"
,
class:
"form-control"
,
tabindex:
1
,
autofocus:
true
.input-group-addon
\.git
-
if
current_user
.
can_select_namespace?
.form-group
...
...
@@ -18,22 +21,6 @@
=
f
.
select
:namespace_id
,
namespaces_options
(
params
[
:namespace_id
]
||
:current_user
),
{},
{
class:
'select2'
,
tabindex:
2
}
%hr
.js-toggle-container
.form-group
.col-sm-2
.col-sm-10
=
link_to
"#"
,
class:
'js-toggle-button'
do
%i
.fa.fa-pencil-square-o
%span
Customize repository name?
.js-toggle-content.hide
.form-group
=
f
.
label
:path
,
class:
'control-label'
do
%span
Repository name
.col-sm-10
.input-group
=
f
.
text_field
:path
,
class:
'form-control'
%span
.input-group-addon
.git
.js-toggle-container
.form-group
.col-sm-2
...
...
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