diff options
author | Igor Drozdov <idrozdov@gitlab.com> | 2019-04-11 18:26:16 +0300 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2019-05-29 14:03:50 +0300 |
commit | 3d4821a8e76d49b388b218824714d3bcb8c54dbf (patch) | |
tree | eca97cf51cb76b05fb335ac8f1b172f44965751e /app/views/shared | |
parent | aa8e75916ad8cf3f8481bc740519676205dd0082 (diff) |
Hide password on import by url form
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/_import_form.html.haml | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/app/views/shared/_import_form.html.haml b/app/views/shared/_import_form.html.haml index 3ee713cf499..75fec53b29c 100644 --- a/app/views/shared/_import_form.html.haml +++ b/app/views/shared/_import_form.html.haml @@ -1,11 +1,32 @@ - ci_cd_only = local_assigns.fetch(:ci_cd_only, false) +- import_url = Gitlab::UrlSanitizer.new(f.object.import_url) .form-group.import-url-data - = f.label :import_url, class: 'label-bold' do - %span - = _('Git repository URL') + .form-group + = f.label :import_url, class: 'label-bold' do + %span + = _('Git repository URL') + = f.text_field :import_url, value: import_url.sanitized_url, + autocomplete: 'off', class: 'form-control', placeholder: 'https://gitlab.company.com/group/project.git', required: true - = f.text_field :import_url, autocomplete: 'off', class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git', required: true + .form-group#import_url_auth_method + = label :import_url_auth_method, class: 'label-bold' do + %span + = _('Authentication method') + = select_tag :import_url_auth_method, options_for_select([[_('None'), 'none'], [_('Username and Password'), 'username-and-password']]), class: 'form-control' + + .div#import_url_auth_group{ style: 'display: none' } + .form-group + = f.label :import_url_user, class: 'label-bold' do + %span + = _('Username (optional)') + = f.text_field :import_url_user, value: import_url.user, class: 'form-control', required: false, autocomplete: 'new-password' + + .form-group + = f.label :import_url_password, class: 'label-bold' do + %span + = _('Git repository password') + = f.password_field :import_url_password, class: 'form-control', required: false, autocomplete: 'new-password', placeholder: 'Basic Auth Password' .info-well.prepend-top-20 .well-segment |