debian-mirror-gitlab/app/views/projects/runners/_runner.html.haml

45 lines
2.1 KiB
Text
Raw Normal View History

2017-08-17 22:00:37 +05:30
%li.runner{ id: dom_id(runner) }
2015-09-25 12:07:36 +05:30
%h4
= runner_status_icon(runner)
2017-09-10 17:25:29 +05:30
- if @project_runners.include?(runner)
2020-04-08 14:13:33 +05:30
= link_to _("%{token}...") % { token: runner.short_sha }, project_runner_path(@project, runner), class: 'commit-sha has-tooltip', title: _("Partial token for reference only")
2017-09-10 17:25:29 +05:30
- if runner.locked?
2020-10-24 23:57:45 +05:30
%span.has-tooltip{ title: _('Locked to current projects') }
= sprite_icon('lock')
2017-09-10 17:25:29 +05:30
2018-03-17 18:26:18 +05:30
%small.edit-runner
2021-03-11 19:13:27 +05:30
= link_to edit_project_runner_path(@project, runner), class: 'btn gl-button btn-edit' do
= sprite_icon('pencil', css_class: 'gl-my-2')
2017-09-10 17:25:29 +05:30
- else
%span.commit-sha
2015-09-25 12:07:36 +05:30
= runner.short_sha
2018-11-08 19:23:39 +05:30
.float-right
2016-06-22 15:30:34 +05:30
- if @project_runners.include?(runner)
2018-03-17 18:26:18 +05:30
- if runner.active?
2021-03-11 19:13:27 +05:30
= link_to _('Pause'), pause_project_runner_path(@project, runner), method: :post, class: 'btn gl-button btn-sm btn-danger', data: { confirm: _("Are you sure?") }
2018-03-17 18:26:18 +05:30
- else
2021-03-11 19:13:27 +05:30
= link_to _('Resume'), resume_project_runner_path(@project, runner), method: :post, class: 'btn gl-button btn-success btn-sm'
2015-09-25 12:07:36 +05:30
- if runner.belongs_to_one_project?
2021-03-11 19:13:27 +05:30
= link_to _('Remove runner'), project_runner_path(@project, runner), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn gl-button btn-danger btn-sm'
2015-09-25 12:07:36 +05:30
- else
2018-12-05 23:21:45 +05:30
- runner_project = @project.runner_projects.find_by(runner_id: runner) # rubocop: disable CodeReuse/ActiveRecord
2021-03-11 19:13:27 +05:30
= link_to _('Disable for this project'), project_runner_project_path(@project, runner_project), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn gl-button btn-danger btn-sm'
2018-11-08 19:23:39 +05:30
- elsif runner.project_type?
2020-10-24 23:57:45 +05:30
= form_for [@project, @project.runner_projects.new] do |f|
2015-09-25 12:07:36 +05:30
= f.hidden_field :runner_id, value: runner.id
2021-03-11 19:13:27 +05:30
= f.submit _('Enable for this project'), class: 'btn gl-button btn-sm'
2018-11-08 19:23:39 +05:30
.float-right
2015-09-25 12:07:36 +05:30
%small.light
\##{runner.id}
- if runner.description.present?
%p.runner-description
= runner.description
2021-01-29 00:20:46 +05:30
- if runner.tags.present?
2015-09-25 12:07:36 +05:30
%p
2021-01-29 00:20:46 +05:30
- runner.tags.map(&:name).sort.each do |tag|
2021-04-17 20:07:23 +05:30
%span.badge.gl-badge.sm.badge-pill.badge-primary
2015-09-25 12:07:36 +05:30
= tag