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

38 lines
1.7 KiB
Text
Raw Normal View History

2015-09-25 12:07:36 +05:30
%tr
%td
2019-02-02 18:00:53 +05:30
- if trigger.has_token_exposed?
2017-08-17 22:00:37 +05:30
%span= trigger.token
2021-01-03 14:25:43 +05:30
= clipboard_button(text: trigger.token, title: _("Copy trigger token"), testid: 'clipboard-btn')
2017-08-17 22:00:37 +05:30
- else
%span= trigger.short_token
2022-08-27 11:52:29 +05:30
.gl-display-inline-block.gl-ml-3
2020-03-13 15:44:24 +05:30
- unless trigger.can_access_project?
2022-04-04 11:22:00 +05:30
= gl_badge_tag s_('Trigger|invalid'), { variant: :danger }, { title: s_('Trigger|Trigger user has insufficient permissions to project'), data: { toggle: 'tooltip', container: 'body' } }
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
2022-08-27 11:52:29 +05:30
%td.text-right.gl-white-space-nowrap
2017-08-17 22:00:37 +05:30
- 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-06-08 01:23:25 +05:30
= link_to edit_project_trigger_path(@project, trigger), method: :get, title: "Edit", class: "gl-button btn btn-default btn-icon" do
2020-07-28 23:09:34 +05:30
= sprite_icon('pencil')
2017-08-17 22:00:37 +05:30
- if can?(current_user, :manage_trigger, trigger)
2022-05-07 20:08:51 +05:30
= link_to project_trigger_path(@project, trigger), aria: { label: _('Revoke') }, data: { confirm: revoke_trigger_confirmation, testid: 'trigger_revoke_button', confirm_btn_variant: "danger" }, method: :delete, title: "Revoke", class: "gl-button btn btn-default btn-icon btn-trigger-revoke gl-ml-3" do
2020-11-24 15:15:51 +05:30
= sprite_icon('remove')