gitlab-org--gitlab-foss/lib/gitlab/ci/status/build/stop.rb

54 lines
1 KiB
Ruby
Raw Normal View History

2016-12-08 04:40:56 -05:00
module Gitlab
module Ci
module Status
module Build
class Stop < SimpleDelegator
include Status::Extended
2016-12-08 04:40:56 -05:00
def text
'manual'
2016-12-08 04:40:56 -05:00
end
def label
'manual stop action'
end
def icon
'icon_status_manual'
2016-12-08 04:40:56 -05:00
end
def group
'manual'
end
def has_action?
can?(user, :update_build, subject)
2016-12-08 04:40:56 -05:00
end
def action_icon
2016-12-08 12:18:30 -05:00
'stop'
end
def action_title
'Stop'
2016-12-08 04:40:56 -05:00
end
def action_path
play_namespace_project_build_path(subject.project.namespace,
subject.project,
subject)
2016-12-08 04:40:56 -05:00
end
def action_method
:post
end
def self.matches?(build, user)
2016-12-08 04:40:56 -05:00
build.playable? && build.stops_environment?
end
end
end
end
end
end