summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-22 13:27:48 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-22 13:27:48 +0200
commit59bb635e0e94a0e6c61a0c53cdb70a4eb7bd3910 (patch)
treeeb9fa337073a19cda2a3995f95cfc9bee40cc54a
parentf023db2b474ab53056bdff3d01675fb6388265cd (diff)
downloadgitlab-ce-59bb635e0e94a0e6c61a0c53cdb70a4eb7bd3910.tar.gz
Set project path & name in one field without transforamtion
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/services/projects/create_service.rb10
-rw-r--r--app/views/projects/new.html.haml23
2 files changed, 9 insertions, 24 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb
index 3672b623806..7b06ce9a337 100644
--- a/app/services/projects/create_service.rb
+++ b/app/services/projects/create_service.rb
@@ -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]
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index e77ef84f51c..f0f9d74c808 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -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