diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-08-01 17:00:55 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-08-01 17:00:55 +0100 |
commit | ba7c65a648d568b1788a4f97b893615c58febca9 (patch) | |
tree | 20bbacdb1d1d49345cfe2e72d471b8405422e951 /app | |
parent | 54e3361fa822b795e3b8ff47764f38b321f0493d (diff) | |
download | gitlab-ce-ba7c65a648d568b1788a4f97b893615c58febca9.tar.gz |
Adds export form and enables export button by default
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/pages/projects.scss | 4 | ||||
-rw-r--r-- | app/views/import/gitlab_projects/new.html.haml | 58 | ||||
-rw-r--r-- | app/views/projects/new.html.haml | 22 |
3 files changed, 46 insertions, 38 deletions
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index dacafb0ed37..96720c0f83b 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -534,7 +534,7 @@ a.deploy-project-label { transform: translateX(-50%); @media (min-width: $screen-lg-min) { - left: -35px; + left: -30px; top: 50%; padding: 10px 0; width: 20px; @@ -554,7 +554,7 @@ a.deploy-project-label { @media (min-width: $screen-lg-min) { bottom: 0; - left: -25px; + left: -20px; right: auto; height: 100%; width: 1px; diff --git a/app/views/import/gitlab_projects/new.html.haml b/app/views/import/gitlab_projects/new.html.haml index 767dffb5589..e20e31e0b32 100644 --- a/app/views/import/gitlab_projects/new.html.haml +++ b/app/views/import/gitlab_projects/new.html.haml @@ -5,21 +5,47 @@ Import an exported GitLab project %hr -= form_tag import_gitlab_project_path, class: 'form-horizontal', multipart: true do - %p - Project will be imported as - %strong - #{@namespace.name}/#{@path} += form_for import_gitlab_project_path, class: 'form-horizontal', multipart: true do |f| + .row + .form-group.col-xs-12.col-sm-6 + = f.label :namespace_id, class: 'label-light' do + %span + Project path + .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} - %p - To move or copy an entire GitLab project from another GitLab installation to this one, navigate to the original project's settings page, generate an export file, and upload it here. - .form-group - = hidden_field_tag :namespace_id, @namespace.id - = hidden_field_tag :path, @path - = label_tag :file, class: 'control-label' do - %span GitLab project export - .col-sm-10 - = file_field_tag :file, class: '' + - else + .input-group-addon.static-namespace + #{root_url}#{current_user.username}/ + = f.hidden_field :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 - .form-actions - = submit_tag 'Import project', class: 'btn btn-create' + + .row + .form-group.col-md-12 + To move or copy an entire GitLab project from another GitLab installation to this one, navigate to the original project's settings page, generate an export file, and upload it here. + .row + .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 + .form-group + = file_field_tag :file, class: '' + .row + .form-actions + = f.submit 'Import project', class: 'btn btn-create' + = link_to 'Cancel', new_project_path, class: 'btn btn-cancel' + +:javascript + // get the path url and append it in the inputS + $('.js-path-name').val(gl.utils.getParameterValues('path')); diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 081cd3dc4dd..93b59dbccaf 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -67,9 +67,8 @@ %button.btn.js-toggle-button.import_git{ type: "button" } = icon('git', text: 'Repo by URL') .import_gitlab_project.has-tooltip{ data: { container: 'body' } } - - if gitlab_project_import_enabled? - = link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do - = icon('gitlab', text: 'GitLab export') + = link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do + = icon('gitlab', text: 'GitLab export') .row .col-lg-12 @@ -127,9 +126,6 @@ %p Please wait a moment, this page will automatically refresh when ready. :javascript - var importBtnTooltip = "Please enter a valid project name."; - var $importBtnWrapper = $('.import_gitlab_project'); - $('.how_to_import_link').bind('click', function (e) { e.preventDefault(); var import_modal = $(this).next(".modal").show(); @@ -144,25 +140,11 @@ $(".btn_import_gitlab_project").attr("href", _href + '?namespace_id=' + $("#project_namespace_id").val() + '&path=' + $("#project_path").val()); }); - $('.btn_import_gitlab_project').attr('disabled', $('#project_path').val().trim().length === 0); - $importBtnWrapper.attr('title', importBtnTooltip); - $('#new_project').submit(function(){ var $path = $('#project_path'); $path.val($path.val().trim()); }); - $('#project_path').keyup(function(){ - if($(this).val().trim().length !== 0) { - $('.btn_import_gitlab_project').attr('disabled', false); - $importBtnWrapper.attr('title',''); - $importBtnWrapper.removeClass('has-tooltip'); - } else { - $('.btn_import_gitlab_project').attr('disabled',true); - $importBtnWrapper.addClass('has-tooltip'); - } - }); - $('#project_import_url').disable(); $('.import_git').click(function( event ) { $projectImportUrl = $('#project_import_url'); |