summaryrefslogtreecommitdiff
path: root/app/views/ci/status/_icon.html.haml
blob: f38bdb2e5ed0153530577a663c5b6c7de11d3038 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- status            = local_assigns.fetch(:status)
- size              = local_assigns.fetch(:size, 16)
- type              = local_assigns.fetch(:type, 'pipeline')
- tooltip_placement = local_assigns.fetch(:tooltip_placement, "left")
- path              = local_assigns.fetch(:path, status.has_details? ? status.details_path : nil)
- css_classes       = "ci-status-link ci-status-icon ci-status-icon-#{status.group} has-tooltip"
- title             = s_("PipelineStatusTooltip|Pipeline: %{ci_status}") % {ci_status: status.label}
- if type == 'commit'
  - title = s_("PipelineStatusTooltip|Commit: %{ci_status}") % {ci_status: status.label}

- if path
  = link_to path, class: css_classes, title: title, data: { placement: tooltip_placement } do
    = sprite_icon(status.icon, size: size)
- else
  %span{ class: css_classes, title: title, data: { placement: tooltip_placement } }
    = sprite_icon(status.icon, size: size)