2020-05-24 23:13:21 +05:30
|
|
|
- title = local_assigns.fetch(:title, _('Add a %{type}') % { type: type })
|
|
|
|
- prefix = local_assigns.fetch(:prefix, :personal_access_token)
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
%h5.gl-mt-0
|
2020-05-24 23:13:21 +05:30
|
|
|
= title
|
|
|
|
%p.profile-settings-content
|
|
|
|
= _("Enter the name of your application, and we'll return a unique %{type}.") % { type: type }
|
|
|
|
|
|
|
|
= form_for token, as: prefix, url: path, method: :post, html: { class: 'js-requires-input' } do |f|
|
|
|
|
|
|
|
|
= form_errors(token)
|
|
|
|
|
|
|
|
.row
|
|
|
|
.form-group.col-md-6
|
|
|
|
= f.label :name, _('Name'), class: 'label-bold'
|
2021-01-29 00:20:46 +05:30
|
|
|
= f.text_field :name, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'access_token_name_field' }
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
.row
|
|
|
|
.form-group.col-md-6
|
|
|
|
= f.label :expires_at, _('Expires at'), class: 'label-bold'
|
|
|
|
.input-icon-wrapper
|
|
|
|
|
|
|
|
= render_if_exists 'personal_access_tokens/callout_max_personal_access_token_lifetime'
|
|
|
|
|
|
|
|
.js-access-tokens-expires-at
|
2021-01-29 00:20:46 +05:30
|
|
|
= f.text_field :expires_at, class: 'datepicker gl-datepicker-input form-control gl-form-input', placeholder: 'YYYY-MM-DD', autocomplete: 'off'
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
.form-group
|
|
|
|
= f.label :scopes, _('Scopes'), class: 'label-bold'
|
|
|
|
= render 'shared/tokens/scopes_form', prefix: prefix, token: token, scopes: scopes
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
- if prefix == :personal_access_token && Feature.enabled?(:personal_access_tokens_scoped_to_projects, current_user)
|
|
|
|
.js-access-tokens-projects
|
|
|
|
%input{ type: 'hidden', name: 'temporary-name', id: 'temporary-id' }
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
.gl-mt-3
|
2021-04-17 20:07:23 +05:30
|
|
|
= f.submit _('Create %{type}') % { type: type }, class: 'gl-button btn btn-confirm', data: { qa_selector: 'create_token_button' }
|