_group_form.html.haml 1.8 KB
Newer Older
1 2
- content_for :page_specific_javascripts do
  = page_specific_javascript_bundle_tag('group')
3
- parent = GroupFinder.new(current_user).execute(id: params[:parent_id] || @group.parent_id)
4 5
- group_path = root_url
- group_path << parent.full_path + '/' if parent
6

Ciro Santilli's avatar
Ciro Santilli committed
7
.form-group
8 9
  = f.label :path, class: 'control-label' do
    Group path
Ciro Santilli's avatar
Ciro Santilli committed
10
  .col-sm-10
11
    .input-group.gl-field-error-anchor
12
      .group-root-path.input-group-addon.has-tooltip{ title: group_path, :'data-placement' => 'bottom' }
13 14 15
        %span>= root_url
        - if parent
          %strong= parent.full_path + '/'
16
      = f.text_field :path, placeholder: 'open-source', class: 'form-control',
17
        autofocus: local_assigns[:autofocus] || false, required: true,
18
        pattern: Gitlab::Regex::NAMESPACE_REGEX_STR_JS,
19
        title: 'Please choose a group path with no special characters.',
20
        "data-bind-in" => "#{'create_chat_team' if Gitlab.config.mattermost.enabled}"
21 22
      - if parent
        = f.hidden_field :parent_id, value: parent.id
23

24
    - if @group.persisted?
25
      .alert.alert-warning.prepend-top-10
26 27 28 29 30
        %ul
          %li Changing group path can have unintended side effects.
          %li Renaming group path will rename directory for all related projects
          %li It will change web url for access group and group projects.
          %li It will change the git path to repositories under this group.
Ciro Santilli's avatar
Ciro Santilli committed
31

32 33 34 35 36 37 38 39
.form-group.group-name-holder
  = f.label :name, class: 'control-label' do
    Group name
  .col-sm-10
    = f.text_field :name, class: 'form-control',
      required: true,
      title: 'You can choose a descriptive name different from the path.'

Ciro Santilli's avatar
Ciro Santilli committed
40
.form-group.group-description-holder
41
  = f.label :description, class: 'control-label'
Ciro Santilli's avatar
Ciro Santilli committed
42 43 44
  .col-sm-10
    = f.text_area :description, maxlength: 250,
        class: 'form-control js-gfm-input', rows: 4