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 14:30:21 +00:00
|
|
|
- if show_expire_at?(token)
|
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
|
|
|
|
%span.token-never-expires-label Never
|
|
|
|
%td= token.scopes.present? ? token.scopes.join(", ") : "<no scopes selected>"
|
2018-04-02 15:57:44 +00:00
|
|
|
%td= link_to s_('DeployTokens|Revoke'), "#", class: "btn btn-danger pull-right", data: { toggle: "modal", target: "#revoke-modal-#{token.id}"}
|
2018-03-19 16:11:12 +00:00
|
|
|
= render 'projects/deploy_tokens/revoke_modal', token: token, project: project
|
|
|
|
- else
|
|
|
|
.settings-message.text-center
|
2018-04-02 15:57:44 +00:00
|
|
|
= s_('DeployTokens|This project has no active Deploy Tokens.')
|