Set project path & name in one field without transforamtion
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
f023db2b47
commit
59bb635e0e
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue