From ec5b802e1b142eb89a87a25a5380e843f1c32581 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Mon, 25 Jun 2018 08:30:12 +0000 Subject: [PATCH] (Part 1) Resolve "Recognise when a user is trying to validate a private SSH key" --- app/views/profiles/keys/_form.html.haml | 6 ++++-- app/views/profiles/keys/index.html.haml | 9 +++++---- ...er-is-trying-to-validate-a-private-ssh-key-part-1.yml | 5 +++++ 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 changelogs/unreleased/46396-recognise-when-a-user-is-trying-to-validate-a-private-ssh-key-part-1.yml diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml index 6ea358d9f63..c14700794ce 100644 --- a/app/views/profiles/keys/_form.html.haml +++ b/app/views/profiles/keys/_form.html.haml @@ -4,10 +4,12 @@ .form-group = f.label :key, class: 'label-light' - = f.text_area :key, class: "form-control", rows: 8, required: true, placeholder: "Don't paste the private part of the SSH key. Paste the public part, which is usually contained in the file '~/.ssh/id_rsa.pub' and begins with 'ssh-rsa'." + %p= _("Paste your public SSH key, which is usually contained in the file '~/.ssh/id_rsa.pub' and begins with 'ssh-rsa'. Don't use your private SSH key.") + = f.text_area :key, class: "form-control", rows: 8, required: true, placeholder: 'Typically starts with "ssh-rsa …"' .form-group = f.label :title, class: 'label-light' - = f.text_field :title, class: "form-control", required: true + = f.text_field :title, class: "form-control", required: true, placeholder: 'e.g. My MacBook key' + %p.form-text.text-muted= _('Name your individual key via a title') .prepend-top-default = f.submit 'Add key', class: "btn btn-create" diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml index 1e206def7ee..55ca8d0ebd4 100644 --- a/app/views/profiles/keys/index.html.haml +++ b/app/views/profiles/keys/index.html.haml @@ -11,10 +11,11 @@ %h5.prepend-top-0 Add an SSH key %p.profile-settings-content - Before you can add an SSH key you need to - = link_to "generate one", help_page_path("ssh/README", anchor: 'generating-a-new-ssh-key-pair') - or use an - = link_to "existing key.", help_page_path("ssh/README", anchor: 'locating-an-existing-ssh-key-pair') + - generate_link_url = help_page_path("ssh/README", anchor: 'generating-a-new-ssh-key-pair') + - existing_link_url = help_page_path("ssh/README", anchor: 'locating-an-existing-ssh-key-pair') + - generate_link_start = ''.html_safe % { url: generate_link_url } + - existing_link_start = ''.html_safe % { url: existing_link_url } + = _('To add an SSH key you need to %{generate_link_start}generate one%{link_end} or use an %{existing_link_start}existing key%{link_end}.').html_safe % { generate_link_start: generate_link_start, existing_link_start: existing_link_start, link_end: ''.html_safe } = render 'form' %hr %h5 diff --git a/changelogs/unreleased/46396-recognise-when-a-user-is-trying-to-validate-a-private-ssh-key-part-1.yml b/changelogs/unreleased/46396-recognise-when-a-user-is-trying-to-validate-a-private-ssh-key-part-1.yml new file mode 100644 index 00000000000..d8c7d612c3d --- /dev/null +++ b/changelogs/unreleased/46396-recognise-when-a-user-is-trying-to-validate-a-private-ssh-key-part-1.yml @@ -0,0 +1,5 @@ +--- +title: Update new SSH key page to improve copy +merge_request: 19994 +author: +type: other