gitlab-org--gitlab-foss/app/views/ci/status/_icon.html.haml
Scott Hampton 40d1513635 Adding ability to pass in path to status icon
Project passed a very specific details path. Also reverted a change.
2019-02-26 14:10:24 -07:00

14 lines
838 B
Text

- status = local_assigns.fetch(:status)
- size = local_assigns.fetch(:size, 16)
- type = local_assigns.fetch(:type, 'pipeline')
- title = local_assigns.fetch(:title, "#{type.titleize}: #{status.label}")
- 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"
- if status.has_details?
= link_to path, class: css_classes, title: title, data: { html: true, placement: tooltip_placement } do
= sprite_icon(status.icon, size: size)
- else
%span{ class: css_classes, title: title, data: { html: true, placement: tooltip_placement } }
= sprite_icon(status.icon, size: size)