diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-16 19:43:52 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-16 19:43:52 +0100 |
commit | 76708c2c184e8bd561966ad7e617df31ceac95d1 (patch) | |
tree | 6879bb4b3c76d9dbf6acb7ecaee2486969e5dda9 /app | |
parent | 8eb51dc037ef69454731d17cdd7b13e9285fd755 (diff) | |
parent | 76642d7a805e572ddd7608efa4f6f33de42fa1ce (diff) | |
download | gitlab-ce-76708c2c184e8bd561966ad7e617df31ceac95d1.tar.gz |
Merge branch 'master' into fix-merge-immediately-button
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/pages/status.scss | 17 | ||||
-rw-r--r-- | app/helpers/ci_status_helper.rb | 22 | ||||
-rw-r--r-- | app/views/projects/commit_statuses/_commit_status.html.haml | 8 |
3 files changed, 25 insertions, 22 deletions
diff --git a/app/assets/stylesheets/pages/status.scss b/app/assets/stylesheets/pages/status.scss index a7d3b2197f1..4b6ef035673 100644 --- a/app/assets/stylesheets/pages/status.scss +++ b/app/assets/stylesheets/pages/status.scss @@ -35,3 +35,20 @@ border-color: $gl-warning; } } + +.ci-status-icon-success { + @extend .cgreen; +} +.ci-status-icon-failed { + @extend .cred; +} +.ci-status-icon-running, +.ci-status-icon-pending { + // These are standard text color +} +.ci-status-icon-canceled, +.ci-status-icon-disabled, +.ci-status-icon-not-found, +.ci-status-icon-skipped { + @extend .cgray; +} diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 8554074d619..d8bee21c82e 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -12,19 +12,6 @@ module CiStatusHelper ci_label_for_status(ci_commit.status) end - def ci_status_color(ci_commit) - case ci_commit.status - when 'success' - 'green' - when 'failed' - 'red' - when 'running', 'pending' - 'yellow' - else - 'gray' - end - end - def ci_status_with_icon(status) content_tag :span, class: "ci-status ci-#{status}" do ci_icon_for_status(status) + ' '.html_safe + ci_label_for_status(status) @@ -56,12 +43,11 @@ module CiStatusHelper end def render_ci_status(ci_commit) - link_to ci_status_path(ci_commit), - class: "ci-status-link c#{ci_status_color(ci_commit)}", + link_to ci_status_icon(ci_commit), + ci_status_path(ci_commit), + class: "ci-status-link ci-status-icon-#{ci_commit.status.dasherize}", title: "Build #{ci_status_label(ci_commit)}", - data: { toggle: 'tooltip', placement: 'left' } do - ci_status_icon(ci_commit) - end + data: { toggle: 'tooltip', placement: 'left' } end def no_runners_for_project?(project) diff --git a/app/views/projects/commit_statuses/_commit_status.html.haml b/app/views/projects/commit_statuses/_commit_status.html.haml index 45a00e4d259..74a05df24d3 100644 --- a/app/views/projects/commit_statuses/_commit_status.html.haml +++ b/app/views/projects/commit_statuses/_commit_status.html.haml @@ -19,11 +19,11 @@ - if defined?(commit_sha) && commit_sha %td - = link_to commit_status.short_sha, namespace_project_commit_path(@project.namespace, @project, commit_status.sha), class: "monospace" - + = link_to commit_status.short_sha, namespace_project_commit_path(commit_status.project.namespace, commit_status.project, commit_status.sha), class: "monospace" + %td - if commit_status.ref - = link_to commit_status.ref, namespace_project_commits_path(@project.namespace, @project, commit_status.ref) + = link_to commit_status.ref, namespace_project_commits_path(commit_status.project.namespace, commit_status.project, commit_status.ref) - else .light none @@ -66,7 +66,7 @@ %td .pull-right - - if current_user && can?(current_user, :download_build_artifacts, @project) && commit_status.download_url + - if current_user && can?(current_user, :download_build_artifacts, commit_status.project) && commit_status.download_url = link_to commit_status.download_url, title: 'Download artifacts' do %i.fa.fa-download - if current_user && can?(current_user, :manage_builds, commit_status.project) |