debian-mirror-gitlab/app/views/projects/triggers/_trigger.html.haml

43 lines
2.1 KiB
Text
Raw Normal View History

2015-09-25 12:07:36 +05:30
%tr
%td
2017-08-17 22:00:37 +05:30
- if can?(current_user, :admin_trigger, trigger)
%span= trigger.token
= clipboard_button(text: trigger.token, title: "Copy trigger token to clipboard")
- else
%span= trigger.short_token
.label-container
- if trigger.legacy?
2018-11-08 19:23:39 +05:30
%span.badge.badge-primary.has-tooltip{ title: "Trigger makes use of deprecated functionality" } legacy
2017-08-17 22:00:37 +05:30
- if !trigger.can_access_project?
2018-11-08 19:23:39 +05:30
%span.badge.badge-danger.has-tooltip{ title: "Trigger user has insufficient permissions to project" } invalid
2017-08-17 22:00:37 +05:30
%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-09-25 12:07:36 +05:30
%td
2017-08-17 22:00:37 +05:30
- if trigger.last_used
2018-10-15 14:42:47 +05:30
= time_ago_with_tooltip trigger.last_used
2015-09-25 12:07:36 +05:30
- else
Never
2017-08-17 22:00:37 +05:30
%td.text-right.trigger-actions
- take_ownership_confirmation = "By taking ownership you will bind this trigger to your user account. With this the trigger will have access to all your projects as if it was you. Are you sure?"
- revoke_trigger_confirmation = "By revoking a trigger you will break any processes making use of it. Are you sure?"
- if trigger.owner != current_user && can?(current_user, :manage_trigger, trigger)
2017-09-10 17:25:29 +05:30
= link_to 'Take ownership', take_ownership_project_trigger_path(@project, trigger), data: { confirm: take_ownership_confirmation }, method: :post, class: "btn btn-default btn-sm btn-trigger-take-ownership"
2017-08-17 22:00:37 +05:30
- if can?(current_user, :admin_trigger, trigger)
2017-09-10 17:25:29 +05:30
= link_to edit_project_trigger_path(@project, trigger), method: :get, title: "Edit", class: "btn btn-default btn-sm" do
2017-08-17 22:00:37 +05:30
%i.fa.fa-pencil
- if can?(current_user, :manage_trigger, trigger)
2017-09-10 17:25:29 +05:30
= 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-08-17 22:00:37 +05:30
%i.fa.fa-trash