diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-08-07 20:24:40 +0300 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-08-07 20:36:06 +0300 |
commit | 036ee515d418b99181d5e610e40a7ab527a8a9ce (patch) | |
tree | 4c0122b6743409b86b6149aab186a2632cfe27e9 /app | |
parent | 1b8fb79287839d9784ae729f5aa9e246948b0f17 (diff) |
Port form back to use form_tag
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/import/gitlab_projects_controller.rb | 2 | ||||
-rw-r--r-- | app/views/import/gitlab_projects/new.html.haml | 24 |
2 files changed, 10 insertions, 16 deletions
diff --git a/app/controllers/import/gitlab_projects_controller.rb b/app/controllers/import/gitlab_projects_controller.rb index 6463d2dfd5b..510813846a4 100644 --- a/app/controllers/import/gitlab_projects_controller.rb +++ b/app/controllers/import/gitlab_projects_controller.rb @@ -12,7 +12,7 @@ class Import::GitlabProjectsController < Import::BaseController return redirect_back_or_default(options: { alert: "You need to upload a GitLab project export archive." }) end - @project = ::Projects::GitlabProjectsImporterService.new(current_user, project_params).execute + @project = ::Projects::GitlabProjectsImportService.new(current_user, project_params).execute if @project.saved? redirect_to( diff --git a/app/views/import/gitlab_projects/new.html.haml b/app/views/import/gitlab_projects/new.html.haml index 772625867df..d99da464ad1 100644 --- a/app/views/import/gitlab_projects/new.html.haml +++ b/app/views/import/gitlab_projects/new.html.haml @@ -8,29 +8,25 @@ Import an exported GitLab project %hr -= form_for import_gitlab_project_path, html: { class: 'new_project' }, multipart: true do |f| += form_tag import_gitlab_project_path, html: { class: 'new_project' }, multipart: true do .row .form-group.col-xs-12.col-sm-6 - = f.label :namespace_id, class: 'label-light' do - %span - Project path + .span + = label_tag :namespace_id, 'Project path', class: 'label-light' .form-group .input-group - if current_user.can_select_namespace? .input-group-addon = root_url - = f.select :namespace_id, namespaces_options(namespace_id_from(params) || :current_user, display_path: true, extra_group: namespace_id_from(params)), {}, { class: 'select2 js-select-namespace', tabindex: 1} + = select_tag :namespace_id, namespaces_options(namespace_id_from(params) || :current_user, display_path: true, extra_group: namespace_id_from(params)), class: 'select2 js-select-namespace', tabindex: 1 - else .input-group-addon.static-namespace #{root_url}#{current_user.username}/ - = f.hidden_field :namespace_id, value: current_user.namespace_id + = hidden_field_tag :namespace_id, value: current_user.namespace_id .form-group.col-xs-12.col-sm-6.project-path - = f.label :path, class: 'label-light' do - %span - Project name - = f.text_field :path, placeholder: "my-awesome-project", class: "js-path-name form-control", tabindex: 2, autofocus: true, required: true - + = label_tag :path, 'Project name', class: 'label-light' + = text_field_tag :path, nil, placeholder: "my-awesome-project", class: "js-path-name form-control", tabindex: 2, autofocus: true, required: true .row .form-group.col-md-12 @@ -39,12 +35,10 @@ .form-group.col-sm-12 = hidden_field_tag :namespace_id, @namespace.id = hidden_field_tag :path, @path - = f.label :file, class: 'label-light' do - %span - GitLab project export + = label_tag :file, 'GitLab project export', class: 'label-light' .form-group = file_field_tag :file, class: '' .row .form-actions - = f.submit 'Import project', class: 'btn btn-create' + = submit_tag 'Import project', class: 'btn btn-create' = link_to 'Cancel', new_project_path, class: 'btn btn-cancel' |