1# frozen_string_literal: true
2
3module Gitlab
4  module Ci
5    module Status
6      module Build
7        class Play < Status::Extended
8          def label
9            'manual play action'
10          end
11
12          def has_action?
13            can?(user, :update_build, subject)
14          end
15
16          def action_icon
17            'play'
18          end
19
20          def action_title
21            'Play'
22          end
23
24          def action_button_title
25            _('Trigger this manual action')
26          end
27
28          def action_path
29            play_project_job_path(subject.project, subject)
30          end
31
32          def action_method
33            :post
34          end
35
36          def self.matches?(build, user)
37            build.playable? && !build.stops_environment?
38          end
39        end
40      end
41    end
42  end
43end
44