summaryrefslogtreecommitdiff
path: root/app/views/groups/_import_group_from_file_panel.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/groups/_import_group_from_file_panel.html.haml')
-rw-r--r--app/views/groups/_import_group_from_file_panel.html.haml50
1 files changed, 50 insertions, 0 deletions
diff --git a/app/views/groups/_import_group_from_file_panel.html.haml b/app/views/groups/_import_group_from_file_panel.html.haml
new file mode 100644
index 00000000000..171f3e0371a
--- /dev/null
+++ b/app/views/groups/_import_group_from_file_panel.html.haml
@@ -0,0 +1,50 @@
+- parent = @group.parent
+- group_path = root_url
+- group_path << parent.full_path + '/' if parent
+
+= form_with url: import_gitlab_group_path, class: 'group-form gl-show-field-errors', multipart: true do |f|
+ = form_errors(@group)
+
+ .gl-border-l-solid.gl-border-r-solid.gl-border-gray-100.gl-border-1.gl-p-5
+ %h4
+ = _('Import group from file')
+ %p
+ = s_('GroupsNew|Provide credentials for another instance of GitLab to import your groups directly.')
+ .form-group.gl-display-flex.gl-flex-direction-column
+ = f.label :name, _('New group name'), for: 'import_group_name'
+ = f.text_field :name, placeholder: s_('GroupsNew|My Awesome Group'), class: 'js-autofill-group-name gl-form-input col-xs-12 col-sm-8',
+ required: true,
+ title: _('Please fill in a descriptive name for your group.'),
+ autofocus: true,
+ id: 'import_group_name'
+
+ .form-group.gl-display-flex.gl-flex-direction-column
+ = f.label :import_group_path, _('New group URL'), for: 'import_group_path'
+ .input-group.gl-field-error-anchor.col-xs-12.col-sm-8.gl-p-0
+ .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, value: parent&.id
+ = f.text_field :path, placeholder: 'my-awesome-group', class: 'form-control js-validate-group-path js-autofill-group-path',
+ id: 'import_group_path',
+ 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 path availability...')
+ .form-group
+ = f.label :file, s_('GroupsNew|Upload file')
+ .gl-font-weight-normal
+ - import_export_link_start = '<a href="%{url}" target="_blank">'.html_safe % { url: help_page_path('user/group/settings/import_export') }
+ = s_('GroupsNew|To import a group, navigate to the group settings for the GitLab source instance, %{link_start}generate an export file%{link_end}, and upload it here.').html_safe % { link_start: import_export_link_start, link_end: '</a>'.html_safe }
+ .gl-mt-3
+ = render 'shared/file_picker_button', f: f, field: :file, help_text: nil, classes: 'gl-button btn-success-secondary gl-mr-2'
+ .gl-border-gray-100.gl-border-solid.gl-border-1.gl-bg-gray-10.gl-p-5
+ = f.submit _('Import'), class: 'btn gl-button btn-success'