2015-08-26 01:42:46 +00:00
|
|
|
%tr
|
|
|
|
%td
|
2018-12-19 13:15:58 +00:00
|
|
|
- if trigger.has_token_exposed?
|
2017-03-07 13:02:56 +00:00
|
|
|
%span= trigger.token
|
2020-09-28 18:09:40 +00:00
|
|
|
= clipboard_button(text: trigger.token, title: _("Copy trigger token"), testid: 'clipboard-btn')
|
2017-03-07 13:02:56 +00:00
|
|
|
- else
|
|
|
|
%span= trigger.short_token
|
|
|
|
|
|
|
|
.label-container
|
2020-01-14 12:07:41 +00:00
|
|
|
- unless trigger.can_access_project?
|
2018-04-13 19:37:07 +00:00
|
|
|
%span.badge.badge-danger.has-tooltip{ title: "Trigger user has insufficient permissions to project" } invalid
|
2017-03-07 13:02:56 +00:00
|
|
|
|
|
|
|
%td
|
|
|
|
- if trigger.description? && trigger.description.length > 15
|
|
|
|
%span.has-tooltip{ title: trigger.description }= truncate(trigger.description, length: 15)
|
|
|
|
- else
|
|
|
|
= trigger.description
|
|
|
|
|
|
|
|
%td
|
|
|
|
- if trigger.owner
|
|
|
|
.trigger-owner.sr-only= trigger.owner.name
|
|
|
|
= user_avatar(user: trigger.owner, size: 20)
|
2015-08-26 01:42:46 +00:00
|
|
|
|
|
|
|
%td
|
2017-03-07 13:02:56 +00:00
|
|
|
- if trigger.last_used
|
2018-04-25 15:58:56 +00:00
|
|
|
= time_ago_with_tooltip trigger.last_used
|
2015-08-26 01:42:46 +00:00
|
|
|
- else
|
|
|
|
Never
|
|
|
|
|
2017-03-07 13:02:56 +00:00
|
|
|
%td.text-right.trigger-actions
|
|
|
|
- revoke_trigger_confirmation = "By revoking a trigger you will break any processes making use of it. Are you sure?"
|
|
|
|
- if can?(current_user, :admin_trigger, trigger)
|
2021-04-27 15:09:52 +00:00
|
|
|
= link_to edit_project_trigger_path(@project, trigger), method: :get, title: "Edit", class: "gl-button btn btn-default btn-icon" do
|
2020-07-08 09:09:17 +00:00
|
|
|
= sprite_icon('pencil')
|
2017-03-07 13:02:56 +00:00
|
|
|
- if can?(current_user, :manage_trigger, trigger)
|
2021-04-27 15:09:52 +00:00
|
|
|
= link_to project_trigger_path(@project, trigger), data: { confirm: revoke_trigger_confirmation, testid: 'trigger_revoke_button' }, method: :delete, title: "Revoke", class: "gl-button btn btn-default btn-icon btn-trigger-revoke gl-ml-3" do
|
2020-08-27 15:10:21 +00:00
|
|
|
= sprite_icon('remove')
|