diff options
author | James Lopez <james@jameslopez.es> | 2016-06-15 18:31:00 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-06-15 18:31:00 +0300 |
commit | 4bde59341f6d4679b2eefa2c5e332c33c3c76050 (patch) | |
tree | d9c98b030da720f0d413f6ad5e3066cb67559fdd /app/views/projects/new.html.haml | |
parent | f6896f9381b9d833e0db4d0e5be95f2ffc64561a (diff) |
lots of refactoring again based on feedback. Changed the UI slightly and also fixed a small bug
Diffstat (limited to 'app/views/projects/new.html.haml')
-rw-r--r-- | app/views/projects/new.html.haml | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 79ef9284268..50cc7a45039 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -93,7 +93,7 @@ - if gitlab_project_import_enabled? = link_to new_import_gitlab_project_path, class: 'btn import_gitlab_project project-submit' do %i.fa.fa-gitlab - %span GitLab project + %span GitLab export .js-toggle-content.hide = render "shared/import_form", f: f @@ -124,21 +124,33 @@ e.preventDefault(); var import_modal = $(this).next(".modal").show(); }); + $('.modal-header .close').bind('click', function() { $(".modal").hide(); }); + $('.import_gitlab_project').bind('click', function() { var _href = $("a.import_gitlab_project").attr("href"); $(".import_gitlab_project").attr("href", _href + '?namespace_id=' + $("#project_namespace_id").val() + '&path=' + $("#project_path").val()); }); + $('.import_gitlab_project').attr('disabled',true) $('.import_gitlab_project').attr('title', 'Project path required.'); - $('#project_path').keyup(function(){ - if($(this).val().length !=0) { - $('.import_gitlab_project').attr('disabled', false); - $('.import_gitlab_project').attr('title',''); - } else { - $('.import_gitlab_project').attr('disabled',true); - $('.import_gitlab_project').attr('title', 'Project path required.'); - } - }) + + $('.import_gitlab_project').click(function( event ) { + if($('.import_gitlab_project').attr('disabled')) { + event.preventDefault(); + new Flash("Project path required.", "alert"); + } + }); + + $('#project_path').keyup(function(){ + if($(this).val().length !=0) { + $('.import_gitlab_project').attr('disabled', false); + $('.import_gitlab_project').attr('title',''); + $(".flash-container").html("") + } else { + $('.import_gitlab_project').attr('disabled',true); + $('.import_gitlab_project').attr('title', 'Project path required.'); + } + }) |