BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
59bb635e
Unverified
Commit
59bb635e
authored
Dec 22, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set project path & name in one field without transforamtion
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
f023db2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
24 deletions
+9
-24
create_service.rb
app/services/projects/create_service.rb
+4
-6
new.html.haml
app/views/projects/new.html.haml
+5
-18
No files found.
app/services/projects/create_service.rb
View file @
59bb635e
...
...
@@ -12,12 +12,10 @@ module Projects
@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 @
59bb635e
...
...
@@ -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
...
...
@@ -23,22 +26,6 @@
.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
.col-sm-10
=
link_to
"#"
,
class:
'js-toggle-button'
do
%i
.fa.fa-upload
%span
Import existing repository?
.js-toggle-content.hide
...
...
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