2018-04-02 11:57:44 -04:00
|
|
|
%h5= s_("DeployTokens|Active Deploy Tokens (%{active_tokens})") % { active_tokens: active_tokens.length }
|
2018-03-19 12:11:12 -04:00
|
|
|
|
|
|
|
- if active_tokens.present?
|
|
|
|
.table-responsive.deploy-tokens
|
|
|
|
%table.table
|
|
|
|
%thead
|
|
|
|
%tr
|
2018-04-02 11:57:44 -04:00
|
|
|
%th= s_('DeployTokens|Name')
|
2018-04-05 18:07:36 -04:00
|
|
|
%th= s_('DeployTokens|Username')
|
2018-04-02 11:57:44 -04:00
|
|
|
%th= s_('DeployTokens|Created')
|
|
|
|
%th= s_('DeployTokens|Expires')
|
|
|
|
%th= s_('DeployTokens|Scopes')
|
2018-03-19 12:11:12 -04:00
|
|
|
%th
|
|
|
|
%tbody
|
|
|
|
- active_tokens.each do |token|
|
|
|
|
%tr
|
|
|
|
%td= token.name
|
2018-04-05 18:07:36 -04:00
|
|
|
%td= token.username
|
2018-03-19 12:11:12 -04:00
|
|
|
%td= token.created_at.to_date.to_s(:medium)
|
|
|
|
%td
|
2018-04-06 15:48:17 -04:00
|
|
|
- if token.expires?
|
2018-03-19 12:11:12 -04: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-09 13:42:45 -04:00
|
|
|
%td= link_to s_('DeployTokens|Revoke'), "#", class: "btn btn-danger float-right", data: { toggle: "modal", target: "#revoke-modal-#{token.id}"}
|
2018-03-19 12:11:12 -04:00
|
|
|
= render 'projects/deploy_tokens/revoke_modal', token: token, project: project
|
|
|
|
- else
|
|
|
|
.settings-message.text-center
|
2018-04-02 11:57:44 -04:00
|
|
|
= s_('DeployTokens|This project has no active Deploy Tokens.')
|