2018-04-02 15:57:44 +00:00
|
|
|
%h5= s_("DeployTokens|Active Deploy Tokens (%{active_tokens})") % { active_tokens: active_tokens.length }
|
2018-03-19 16:11:12 +00:00
|
|
|
|
|
|
|
- if active_tokens.present?
|
|
|
|
.table-responsive.deploy-tokens
|
|
|
|
%table.table
|
|
|
|
%thead
|
|
|
|
%tr
|
2018-04-02 15:57:44 +00:00
|
|
|
%th= s_('DeployTokens|Name')
|
2018-04-05 22:07:36 +00:00
|
|
|
%th= s_('DeployTokens|Username')
|
2018-04-02 15:57:44 +00:00
|
|
|
%th= s_('DeployTokens|Created')
|
|
|
|
%th= s_('DeployTokens|Expires')
|
|
|
|
%th= s_('DeployTokens|Scopes')
|
2018-03-19 16:11:12 +00:00
|
|
|
%th
|
|
|
|
%tbody
|
|
|
|
- active_tokens.each do |token|
|
|
|
|
%tr
|
|
|
|
%td= token.name
|
2018-04-05 22:07:36 +00:00
|
|
|
%td= token.username
|
2018-03-19 16:11:12 +00:00
|
|
|
%td= token.created_at.to_date.to_s(:medium)
|
|
|
|
%td
|
2018-04-06 19:48:17 +00:00
|
|
|
- if token.expires?
|
2018-03-19 16:11:12 +00:00
|
|
|
%span{ class: ('text-warning' if token.expires_soon?) }
|
|
|
|
In #{distance_of_time_in_words_to_now(token.expires_at)}
|
|
|
|
- else
|
2020-02-28 18:09:07 +00:00
|
|
|
%span.token-never-expires-label= _('Never')
|
2020-07-24 15:09:39 +00:00
|
|
|
%td= token.scopes.present? ? token.scopes.join(", ") : html_escape_once(_('<no scopes selected>')).html_safe
|
2018-04-09 17:42:45 +00:00
|
|
|
%td= link_to s_('DeployTokens|Revoke'), "#", class: "btn btn-danger float-right", data: { toggle: "modal", target: "#revoke-modal-#{token.id}"}
|
2020-02-28 18:09:07 +00:00
|
|
|
= render 'shared/deploy_tokens/revoke_modal', token: token, group_or_project: group_or_project
|
2018-03-19 16:11:12 +00:00
|
|
|
- else
|
|
|
|
.settings-message.text-center
|
2020-02-28 18:09:07 +00:00
|
|
|
= s_('DeployTokens|This %{entity_type} has no active Deploy Tokens.') % { entity_type: group_or_project.class.name.downcase }
|