Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-18 14:34:10 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-08-18 14:34:10 +0300
commit62127dc95a28d6e7018a72c1a643dbf828a806d4 (patch)
tree29af38b74b3baf28829a50ddc6aa3186cee94e94 /app/helpers/ci_status_helper.rb
parent17d0406546885bedf2196c61a5991092b3fbe7c0 (diff)
parent2c1062f81e3c39cf8a45185c203995a43b91bf65 (diff)
Merge remote-tracking branch 'upstream/master' into artifacts-from-ref-and-build-name
* upstream/master: (359 commits) Add new image to show the 'Reset template' button Refactor description templates documentation Remove index from pipeline toggles Hide `Create new list button` on Issues and MRs pages Remove params from build; general refactor Style build container box; add check mark to active build Display jobs as scrolling list in sidebar Move stages and jobs to build sidebar Removed vue assets Move skipped tests to end of array Remove unused data attributes Update changelog Style build dropdowns Populate dropdowns with current build on pageload Selecting stage updates builds dropdown Add data attributes to builds Change active state of list items; style dropdown items Hide dropdown if all tests fit on one line; add counter to dropdown Add overflow tests to dropdown Order by build status ...
Diffstat (limited to 'app/helpers/ci_status_helper.rb')
-rw-r--r--app/helpers/ci_status_helper.rb26
1 files changed, 17 insertions, 9 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index 0f7fcc0416c..3635fc0c79b 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -43,6 +43,10 @@ module CiStatusHelper
'icon_status_pending'
when 'running'
'icon_status_running'
+ when 'play'
+ return icon('play fw')
+ when 'created'
+ 'icon_status_pending'
else
'icon_status_cancel'
end
@@ -53,13 +57,13 @@ module CiStatusHelper
def render_commit_status(commit, tooltip_placement: 'auto left')
project = commit.project
path = builds_namespace_project_commit_path(project.namespace, project, commit)
- render_status_with_link('commit', commit.status, path, tooltip_placement)
+ render_status_with_link('commit', commit.status, path, tooltip_placement: tooltip_placement)
end
def render_pipeline_status(pipeline, tooltip_placement: 'auto left')
project = pipeline.project
path = namespace_project_pipeline_path(project.namespace, project, pipeline)
- render_status_with_link('pipeline', pipeline.status, path, tooltip_placement)
+ render_status_with_link('pipeline', pipeline.status, path, tooltip_placement: tooltip_placement)
end
def no_runners_for_project?(project)
@@ -67,13 +71,17 @@ module CiStatusHelper
Ci::Runner.shared.blank?
end
- private
+ def render_status_with_link(type, status, path = nil, tooltip_placement: 'auto left', cssclass: '')
+ klass = "ci-status-link ci-status-icon-#{status.dasherize} #{cssclass}"
+ title = "#{type.titleize}: #{ci_label_for_status(status)}"
+ data = { toggle: 'tooltip', placement: tooltip_placement }
- def render_status_with_link(type, status, path, tooltip_placement, cssclass: '')
- link_to ci_icon_for_status(status),
- path,
- class: "ci-status-link ci-status-icon-#{status.dasherize} #{cssclass}",
- title: "#{type.titleize}: #{ci_label_for_status(status)}",
- data: { toggle: 'tooltip', placement: tooltip_placement }
+ if path
+ link_to ci_icon_for_status(status), path,
+ class: klass, title: title, data: data
+ else
+ content_tag :span, ci_icon_for_status(status),
+ class: klass, title: title, data: data
+ end
end
end