gitlab-org--gitlab-foss/app/views/projects/runners/_runner.html.haml

44 lines
2 KiB
Text
Raw Normal View History

%li.runner{ id: dom_id(runner) }
2015-08-25 21:42:46 -04:00
%h4
= runner_status_icon(runner)
- if @project_runners.include?(runner)
= link_to runner.short_sha, project_runner_path(@project, runner), class: 'commit-sha'
- if runner.locked?
2018-05-07 09:53:38 -04:00
= icon('lock', class: 'has-tooltip', title: _('Locked to current projects'))
%small.edit-runner
= link_to edit_project_runner_path(@project, runner) do
%i.fa.fa-edit.btn
- else
%span.commit-sha
2015-08-25 21:42:46 -04:00
= runner.short_sha
.float-right
- if @project_runners.include?(runner)
- if runner.active?
2018-05-07 09:53:38 -04:00
= link_to _('Pause'), pause_project_runner_path(@project, runner), method: :post, class: 'btn btn-sm btn-danger', data: { confirm: _("Are you sure?") }
- else
2018-05-07 09:53:38 -04:00
= link_to _('Resume'), resume_project_runner_path(@project, runner), method: :post, class: 'btn btn-success btn-sm'
2015-08-25 21:42:46 -04:00
- if runner.belongs_to_one_project?
2018-05-07 09:53:38 -04:00
= link_to _('Remove Runner'), project_runner_path(@project, runner), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn btn-danger btn-sm'
2015-08-25 21:42:46 -04:00
- else
- runner_project = @project.runner_projects.find_by(runner_id: runner)
2018-05-07 09:53:38 -04:00
= link_to _('Disable for this project'), project_runner_project_path(@project, runner_project), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn btn-danger btn-sm'
- elsif !(runner.is_shared? || runner.group_type?) # We can simplify this to `runner.project_type?` when migrating #runner_type is complete
= form_for [@project.namespace.becomes(Namespace), @project, @project.runner_projects.new] do |f|
2015-08-25 21:42:46 -04:00
= f.hidden_field :runner_id, value: runner.id
2018-05-07 09:53:38 -04:00
= f.submit _('Enable for this project'), class: 'btn btn-sm'
.float-right
2015-08-25 21:42:46 -04:00
%small.light
\##{runner.id}
- if runner.description.present?
%p.runner-description
= runner.description
- if runner.tag_list.present?
%p
- runner.tag_list.sort.each do |tag|
%span.badge.badge-primary
2015-08-25 21:42:46 -04:00
= tag