diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /app/views/shared/access_tokens/_table.html.haml | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/views/shared/access_tokens/_table.html.haml')
-rw-r--r-- | app/views/shared/access_tokens/_table.html.haml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/views/shared/access_tokens/_table.html.haml b/app/views/shared/access_tokens/_table.html.haml new file mode 100644 index 00000000000..5518c31cb06 --- /dev/null +++ b/app/views/shared/access_tokens/_table.html.haml @@ -0,0 +1,37 @@ +- no_active_tokens_message = local_assigns.fetch(:no_active_tokens_message, _('This user has no active %{type}.') % { type: type_plural }) +- impersonation = local_assigns.fetch(:impersonation, false) + +%hr + +%h5 + = _('Active %{type} (%{token_length})') % { type: type_plural, token_length: active_tokens.length } +- if impersonation + %p.profile-settings-content + = _("To see all the user's personal access tokens you must impersonate them first.") + +- if active_tokens.present? + .table-responsive + %table.table.active-tokens + %thead + %tr + %th= _('Name') + %th= s_('AccessTokens|Created') + %th= _('Expires') + %th= _('Scopes') + %th + %tbody + - active_tokens.each do |token| + %tr + %td= token.name + %td= token.created_at.to_date.to_s(:medium) + %td + - if token.expires? + %span{ class: ('text-warning' if token.expires_soon?) } + = _('In %{time_to_now}') % { time_to_now: distance_of_time_in_words_to_now(token.expires_at) } + - else + %span.token-never-expires-label= _('Never') + %td= token.scopes.present? ? token.scopes.join(', ') : _('<no scopes selected>') + %td= link_to _('Revoke'), revoke_route_helper.call(token), method: :put, class: 'btn btn-danger float-right qa-revoke-button', data: { confirm: _('Are you sure you want to revoke this %{type}? This action cannot be undone.') % { type: type } } +- else + .settings-message.text-center + = no_active_tokens_message |