summaryrefslogtreecommitdiff
path: root/app/views/shared/_group_form.html.haml
blob: ca603eed703e506876f98dce4ab80cc824df23b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
- parent = @group.parent
- group_path = root_url
- group_path << parent.full_path + '/' if parent

.row
  .form-group.group-name-holder.col-sm-12
    = f.label :name, class: 'label-bold' do
      = _("Group name")
    = f.text_field :name, placeholder: _('My Awesome Group'), class: 'js-autofill-group-name form-control input-lg',
      required: true,
      title: _('Please fill in a descriptive name for your group.'),
      autofocus: true

.row
  .form-group.col-xs-12.col-sm-8
    = f.label :path, class: 'label-bold' do
      = _("Group URL")
    .input-group.gl-field-error-anchor
      .group-root-path.input-group-prepend.has-tooltip{ title: group_path, :'data-placement' => 'bottom' }
        .input-group-text
          %span>= root_url
          - if parent
            %strong= parent.full_path + '/'
      = f.hidden_field :parent_id
      = f.text_field :path, placeholder: _('my-awesome-group'), class: 'form-control js-validate-group-path js-autofill-group-path',
        autofocus: local_assigns[:autofocus] || false, required: true,
        pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS,
        title: _('Please choose a group URL with no special characters.'),
        "data-bind-in" => "#{'create_chat_team' if Gitlab.config.mattermost.enabled}"
    %p.validation-error.gl-field-error.field-validation.hide
      = _('Group path is already taken. Suggestions: ')
      %span.gl-path-suggestions
    %p.validation-success.gl-field-success.field-validation.hide= _('Group path is available.')
    %p.validation-pending.gl-field-error-ignore.field-validation.hide= _('Checking group URL availability...')

    - if @group.persisted?
      .gl-alert.gl-alert-warning.gl-mt-3.gl-mb-3
        = sprite_icon('warning', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title')
        .gl-alert-body
          = _('Changing group URL can have unintended side effects.')
          = succeed '.' do
            = link_to _('Learn more'), help_page_path('user/group/index', anchor: 'changing-a-groups-path'), target: '_blank', class: 'gl-link'

- if @group.persisted?
  .row
    .form-group.group-name-holder.col-sm-8
      = f.label :id, class: 'label-bold' do
        = _("Group ID")
      = f.text_field :id, class: 'form-control', readonly: true

.row
  .form-group.group-description-holder.col-sm-8
    = f.label :description, class: 'label-bold' do
      = _("Group description")
      %span (optional)
    = f.text_area :description, maxlength: 250,
        class: 'form-control js-gfm-input', rows: 4