Set group path during creation
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
59bb635e0e
commit
ed2bcf952b
|
@ -23,7 +23,7 @@ class GroupsController < ApplicationController
|
|||
|
||||
def create
|
||||
@group = Group.new(group_params)
|
||||
@group.path = @group.name.dup.parameterize if @group.name
|
||||
@group.name = @group.path.dup unless @group.name
|
||||
|
||||
if @group.save
|
||||
@group.add_owner(current_user)
|
||||
|
|
|
@ -136,6 +136,8 @@
|
|||
.col-sm-9
|
||||
.form-group
|
||||
.input-group
|
||||
.input-group-addon
|
||||
#{URI.join(root_url, @project.namespace.path)}/
|
||||
= f.text_field :path, class: 'form-control'
|
||||
%span.input-group-addon .git
|
||||
%ul
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
= form_for @project, html: { class: 'new_project form-horizontal' } do |f|
|
||||
.form-group.project-name-holder
|
||||
= f.label :path, class: 'control-label' do
|
||||
%strong Project name
|
||||
%strong Project path
|
||||
.col-sm-10
|
||||
.input-group
|
||||
= f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 1, autofocus: true
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
- if @group.persisted?
|
||||
.form-group
|
||||
= f.label :name, class: 'control-label' do
|
||||
Group name
|
||||
.col-sm-10
|
||||
= f.text_field :name, placeholder: 'open-source', class: 'form-control'
|
||||
|
||||
.form-group
|
||||
= f.label :name, class: 'control-label' do
|
||||
Group name
|
||||
= f.label :path, class: 'control-label' do
|
||||
Group path
|
||||
.col-sm-10
|
||||
= f.text_field :name, placeholder: 'Example Group', class: 'form-control',
|
||||
autofocus: local_assigns[:autofocus] || false
|
||||
.input-group
|
||||
.input-group-addon
|
||||
= root_url
|
||||
= f.text_field :path, placeholder: 'open-source', class: 'form-control',
|
||||
autofocus: local_assigns[:autofocus] || false
|
||||
|
||||
.form-group.group-description-holder
|
||||
= f.label :description, 'Details', class: 'control-label'
|
||||
|
|
Loading…
Reference in New Issue