summaryrefslogtreecommitdiff
path: root/app/views/shared/_personal_access_tokens_form.html.haml
blob: 71f3447ebc7d66b168e21c508ef26d7cc56b41a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- type = impersonation ? s_('Profiles|impersonation') : s_('Profiles|personal access')

%h5.prepend-top-0
  = _('Add a %{type} token') % { type: type }
%p.profile-settings-content
  = _("Pick a name for the application, and we'll give you a unique %{type} token.") % { type: type }

= form_for token, 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'
      = f.text_field :name, class: "form-control", required: true, data: { qa_selector: 'personal_access_token_name_field' }

  .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'

        = f.text_field :expires_at, class: "datepicker form-control", placeholder: 'YYYY-MM-DD', data: { qa_selector: 'expiry_date_field' }

  .form-group
    = f.label :scopes, _('Scopes'), class: 'label-bold'
    = render 'shared/tokens/scopes_form', prefix: 'personal_access_token', token: token, scopes: scopes

  .prepend-top-default
    = f.submit _('Create %{type} token') % { type: type }, class: "btn btn-success", data: { qa_selector: 'create_token_button' }