diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-04 12:55:23 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-11 18:02:09 +0100 |
commit | e80e3f5372d6bcad1fbe04a85b3086bb66794828 (patch) | |
tree | 16b1539cfd158ecac7fe05d595cbba30b8bc1a04 /app/helpers/ci | |
parent | 8b4cdc50fca816b4f56f8579e17c4dba836ec797 (diff) | |
download | gitlab-ce-e80e3f5372d6bcad1fbe04a85b3086bb66794828.tar.gz |
Migrate CI::Project to Project
Diffstat (limited to 'app/helpers/ci')
-rw-r--r-- | app/helpers/ci/gitlab_helper.rb | 17 | ||||
-rw-r--r-- | app/helpers/ci/projects_helper.rb | 36 |
2 files changed, 0 insertions, 53 deletions
diff --git a/app/helpers/ci/gitlab_helper.rb b/app/helpers/ci/gitlab_helper.rb deleted file mode 100644 index e34c8be1dfc..00000000000 --- a/app/helpers/ci/gitlab_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Ci - module GitlabHelper - def no_turbolink - { :"data-no-turbolink" => "data-no-turbolink" } - end - - def yaml_web_editor_link(project) - commits = project.commits - - if commits.any? && commits.last.ci_yaml_file - "#{project.gitlab_url}/edit/master/.gitlab-ci.yml" - else - "#{project.gitlab_url}/new/master" - end - end - end -end diff --git a/app/helpers/ci/projects_helper.rb b/app/helpers/ci/projects_helper.rb deleted file mode 100644 index fd991a4165a..00000000000 --- a/app/helpers/ci/projects_helper.rb +++ /dev/null @@ -1,36 +0,0 @@ -module Ci - module ProjectsHelper - def ref_tab_class ref = nil - 'active' if ref == @ref - end - - def success_ratio(success_builds, failed_builds) - failed_builds = failed_builds.count(:all) - success_builds = success_builds.count(:all) - - return 100 if failed_builds.zero? - - ratio = (success_builds.to_f / (success_builds + failed_builds)) * 100 - ratio.to_i - end - - def markdown_badge_code(project, ref) - url = status_ci_project_url(project, ref: ref, format: 'png') - "[![build status](#{url})](#{ci_project_url(project, ref: ref)})" - end - - def html_badge_code(project, ref) - url = status_ci_project_url(project, ref: ref, format: 'png') - "<a href='#{ci_project_url(project, ref: ref)}'><img src='#{url}' /></a>" - end - - def project_uses_specific_runner?(project) - project.runners.any? - end - - def no_runners_for_project?(project) - project.runners.blank? && - Ci::Runner.shared.blank? - end - end -end |