2016-04-15 07:36:44 +00:00
|
|
|
- page_title "Personal Access Tokens"
|
|
|
|
- header_title page_title, profile_personal_access_tokens_path
|
|
|
|
|
|
|
|
.row.prepend-top-default
|
|
|
|
.col-lg-3.profile-settings-sidebar
|
|
|
|
%h4.prepend-top-0
|
|
|
|
= page_title
|
|
|
|
%p
|
|
|
|
You can generate a personal access token for each application you use that needs access to GitLab.
|
|
|
|
.col-lg-9
|
|
|
|
%h5.prepend-top-0
|
|
|
|
Add a Personal Access Token
|
|
|
|
%p.profile-settings-content
|
|
|
|
Pick a name for the application, and we'll give you a unique token.
|
|
|
|
= form_for [:profile, @personal_access_token], method: :post, html: { class: 'js-requires-input' } do |f|
|
|
|
|
|
|
|
|
.form-group
|
|
|
|
= f.label :name, class: 'label-light'
|
|
|
|
= f.text_field :name, class: "form-control", required: true
|
|
|
|
|
2016-04-18 10:18:54 +00:00
|
|
|
.form-group
|
|
|
|
= f.label :expires_at, class: 'label-light'
|
|
|
|
= f.text_field :expires_at, class: "form-control datepicker", required: false
|
|
|
|
|
2016-04-15 07:36:44 +00:00
|
|
|
.prepend-top-default
|
|
|
|
= f.submit 'Add Personal Access Token', class: "btn btn-create"
|
|
|
|
|
|
|
|
%hr
|
|
|
|
|
|
|
|
%h5
|
|
|
|
Active Personal Access Tokens
|
|
|
|
|
|
|
|
- if @user.personal_access_tokens.exists?
|
|
|
|
.table-responsive
|
|
|
|
%table.table.table-striped
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Name
|
|
|
|
%th Token
|
|
|
|
%th Created At
|
2016-04-18 10:18:54 +00:00
|
|
|
%th Expires At
|
2016-04-15 15:24:20 +00:00
|
|
|
%th Actions
|
2016-04-15 07:36:44 +00:00
|
|
|
%tbody
|
2016-04-18 10:18:54 +00:00
|
|
|
- @user.personal_access_tokens.order("revoked, expires_at").each do |token|
|
2016-04-15 07:36:44 +00:00
|
|
|
%tr
|
|
|
|
%td= token.name
|
|
|
|
%td= token.token
|
|
|
|
%td= token.created_at
|
2016-04-18 10:18:54 +00:00
|
|
|
- if token.expires_at.present?
|
|
|
|
%td= token.expires_at.to_date
|
|
|
|
- else
|
|
|
|
%td
|
|
|
|
%span.personal-access-tokens-never-expires-label Never
|
2016-04-15 15:24:20 +00:00
|
|
|
- if token.revoked?
|
|
|
|
%td
|
|
|
|
%span.personal-access-tokens-revoked-label Revoked
|
|
|
|
- else
|
|
|
|
%td= link_to "Revoke", revoke_profile_personal_access_token_path(token), method: :put, class: "btn btn-danger", data: {confirm: t('profile.personal_access_tokens.revoke.confirmation')}
|
|
|
|
|
2016-04-15 07:36:44 +00:00
|
|
|
- else
|
2016-04-18 10:18:54 +00:00
|
|
|
%span You don't have any tokens yet.
|
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(".datepicker").datepicker({
|
|
|
|
dateFormat: "yy-mm-dd",
|
|
|
|
onSelect: function(dateText, inst) { $("#personal_access_token_expires_at").val(dateText) }
|
|
|
|
}).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#personal_access_token_expires_at').val()));
|