2021-12-06 04:10:26 -05:00
|
|
|
- max_date = ::Gitlab::CurrentSettings.max_ssh_key_lifetime_from_now.to_date if ssh_key_expiration_policy_enabled?
|
2011-10-08 17:36:38 -04:00
|
|
|
%div
|
2016-02-29 12:19:00 -05:00
|
|
|
= form_for [:profile, @key], html: { class: 'js-requires-input' } do |f|
|
2016-04-04 21:25:38 -04:00
|
|
|
= form_errors(@key)
|
2011-10-08 17:36:38 -04:00
|
|
|
|
2013-12-30 18:27:02 -05:00
|
|
|
.form-group
|
2019-05-30 13:56:56 -04:00
|
|
|
= f.label :key, s_('Profiles|Key'), class: 'label-bold'
|
2022-01-14 16:14:11 -05:00
|
|
|
= f.text_area :key, class: "form-control gl-form-input js-add-ssh-key-validation-input qa-key-public-key-field", rows: 8, required: true, data: { supported_algorithms: Gitlab::SSHPublicKey.supported_algorithms }
|
2022-01-12 10:13:54 -05:00
|
|
|
%p.form-text.text-muted= s_('Profiles|Begins with %{ssh_key_algorithms}.') % { ssh_key_algorithms: ssh_key_allowed_algorithms }
|
2020-03-13 05:09:23 -04:00
|
|
|
.form-row
|
|
|
|
.col.form-group
|
|
|
|
= f.label :title, _('Title'), class: 'label-bold'
|
2021-04-20 17:09:07 -04:00
|
|
|
= f.text_field :title, class: "form-control gl-form-input input-lg qa-key-title-field", required: true, placeholder: s_('Profiles|e.g. My MacBook key')
|
2021-04-21 17:09:40 -04:00
|
|
|
%p.form-text.text-muted= s_('Profiles|Give your individual key a title. This will be publicly visible.')
|
2020-03-13 05:09:23 -04:00
|
|
|
|
|
|
|
.col.form-group
|
2021-12-06 04:10:26 -05:00
|
|
|
= f.label :expires_at, s_('Profiles|Expiration date'), class: 'label-bold'
|
|
|
|
= f.date_field :expires_at, class: "form-control input-lg", min: Date.tomorrow, max: max_date, data: { qa_selector: 'key_expiry_date_field' }
|
2021-04-12 08:09:15 -04:00
|
|
|
%p.form-text.text-muted{ data: { qa_selector: 'key_expiry_date_field_description' } }= ssh_key_expires_field_description
|
2012-08-21 20:56:53 -04:00
|
|
|
|
2018-07-06 10:36:02 -04:00
|
|
|
.js-add-ssh-key-validation-warning.hide
|
|
|
|
.bs-callout.bs-callout-warning{ role: 'alert', aria_live: 'assertive' }
|
|
|
|
%strong= _('Oops, are you sure?')
|
2021-04-12 08:09:15 -04:00
|
|
|
%p= s_("Profiles|Publicly visible private SSH keys can compromise your system.")
|
2018-07-06 10:36:02 -04:00
|
|
|
|
2021-03-17 14:09:01 -04:00
|
|
|
%button.btn.gl-button.btn-confirm.js-add-ssh-key-validation-confirm-submit= _("Yes, add it")
|
2018-07-06 10:36:02 -04:00
|
|
|
|
2020-06-26 02:09:03 -04:00
|
|
|
.gl-mt-3
|
2021-03-17 14:09:01 -04:00
|
|
|
= f.submit s_('Profiles|Add key'), class: "gl-button btn btn-confirm js-add-ssh-key-validation-original-submit qa-add-key-button"
|