diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index 3672b6238069ad9d1318a3eb91baa8390ed115d0..7b06ce9a337048c813220837aff28f19a0ae4946 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 e77ef84f51c3dd66b29c3af2dfef6c30efabfb11..f0f9d74c808102dbba75dba6701bf41451b7d98d 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 @@ -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