debian-mirror-gitlab/app/views/profiles/keys/_form.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
2.1 KiB
Text
Raw Normal View History

2022-01-26 12:08:38 +05:30
- max_date = ::Gitlab::CurrentSettings.max_ssh_key_lifetime_from_now.to_date if ssh_key_expiration_policy_enabled?
2014-09-02 18:07:02 +05:30
%div
2022-11-25 23:54:43 +05:30
= gitlab_ui_form_for [:profile, @key], html: { class: 'js-requires-input' } do |f|
2022-10-11 01:57:18 +05:30
= form_errors(@key)
2014-09-02 18:07:02 +05:30
.form-group
2019-09-04 21:01:54 +05:30
= f.label :key, s_('Profiles|Key'), class: 'label-bold'
2023-01-13 00:05:48 +05:30
= f.text_area :key, class: "form-control gl-form-input js-add-ssh-key-validation-input", rows: 8, required: true, data: { supported_algorithms: Gitlab::SSHPublicKey.supported_algorithms, qa_selector: 'key_public_key_field' }
2022-03-02 08:16:31 +05:30
%p.form-text.text-muted= s_('Profiles|Begins with %{ssh_key_algorithms}.') % { ssh_key_algorithms: ssh_key_allowed_algorithms }
2020-04-08 14:13:33 +05:30
.form-row
.col.form-group
2022-06-21 17:19:12 +05:30
= f.label :title, s_('Profiles|Title'), class: 'label-bold'
2023-01-13 00:05:48 +05:30
= f.text_field :title, class: "form-control gl-form-input input-lg", required: true, placeholder: s_('Profiles|Example: MacBook key'), data: { qa_selector: 'key_title_field' }
2022-06-21 17:19:12 +05:30
%p.form-text.text-muted= s_('Profiles|Key titles are publicly visible.')
2020-04-08 14:13:33 +05:30
2022-10-11 01:57:18 +05:30
.form-row
2020-04-08 14:13:33 +05:30
.col.form-group
2022-10-11 01:57:18 +05:30
.js-access-tokens-expires-at{ data: {min_date: Date.tomorrow, max_date: max_date, default_date_offset: 365, description: ssh_key_expires_field_description } }
= f.label :expires_at, s_('Profiles|Expiration date'), class: 'label-bold'
= f.text_field :expires_at, class: "gl-datepicker-input form-control gl-form-input", placeholder: 'YYYY-MM-DD', min: Date.tomorrow, max: max_date, data: { js_name: 'expiresAt' }
%p.form-text.text-muted= ssh_key_expires_field_description
2018-11-08 19:23:39 +05:30
.js-add-ssh-key-validation-warning.hide
.bs-callout.bs-callout-warning{ role: 'alert', aria_live: 'assertive' }
%strong= _('Oops, are you sure?')
2021-04-29 21:17:54 +05:30
%p= s_("Profiles|Publicly visible private SSH keys can compromise your system.")
2018-11-08 19:23:39 +05:30
2022-07-23 23:45:48 +05:30
= render Pajamas::ButtonComponent.new(variant: :confirm,
button_options: { class: 'js-add-ssh-key-validation-confirm-submit' }) do
= _("Yes, add it")
2020-07-28 23:09:34 +05:30
.gl-mt-3
2023-01-13 00:05:48 +05:30
= f.submit s_('Profiles|Add key'), class: "js-add-ssh-key-validation-original-submit", pajamas_button: true, data: { qa_selector: 'add_key_button' }