gitlab-org--gitlab-foss/app/views/projects/triggers/_trigger.html.haml

43 lines
1.8 KiB
Text
Raw Normal View History

2015-08-25 21:42:46 -04:00
%tr
%td
- if trigger.has_token_exposed?
2017-03-07 08:02:56 -05:00
%span= trigger.token
= clipboard_button(text: trigger.token, title: _("Copy trigger token"))
2017-03-07 08:02:56 -05:00
- else
%span= trigger.short_token
.label-container
- if trigger.legacy?
- if trigger.supports_legacy_tokens?
%span.badge.badge-primary.has-tooltip{ title: "Trigger makes use of deprecated functionality" } legacy
- else
%span.badge.badge-danger.has-tooltip{ title: "Trigger is invalid due to being a legacy trigger. We recommend replacing it with a new trigger" } invalid
- elsif !trigger.can_access_project?
2018-04-13 15:37:07 -04:00
%span.badge.badge-danger.has-tooltip{ title: "Trigger user has insufficient permissions to project" } invalid
2017-03-07 08:02:56 -05: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-25 21:42:46 -04:00
%td
2017-03-07 08:02:56 -05:00
- if trigger.last_used
= time_ago_with_tooltip trigger.last_used
2015-08-25 21:42:46 -04:00
- else
Never
2017-03-07 08:02:56 -05: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)
2018-05-10 15:22:56 -04:00
= link_to edit_project_trigger_path(@project, trigger), method: :get, title: "Edit", class: "btn btn-default btn-sm" do
2017-03-07 08:02:56 -05:00
%i.fa.fa-pencil
- if can?(current_user, :manage_trigger, trigger)
2018-05-10 15:22:56 -04:00
= link_to project_trigger_path(@project, trigger), data: { confirm: revoke_trigger_confirmation }, method: :delete, title: "Revoke", class: "btn btn-default btn-warning btn-sm btn-trigger-revoke" do
2017-03-07 08:02:56 -05:00
%i.fa.fa-trash