gitlab-org--gitlab-foss/app/helpers/ci_badge_helper.rb

14 lines
486 B
Ruby
Raw Normal View History

2015-12-04 06:55:23 -05:00
module CiBadgeHelper
def markdown_badge_code(project, ref)
url = status_ci_project_url(project, ref: ref, format: 'png')
2015-12-11 07:25:42 -05:00
link = namespace_project_commits_path(project.namespace, project, ref)
"[![build status](#{url})](#{link})"
2015-12-04 06:55:23 -05:00
end
def html_badge_code(project, ref)
url = status_ci_project_url(project, ref: ref, format: 'png')
2015-12-11 07:25:42 -05:00
link = namespace_project_commits_path(project.namespace, project, ref)
"<a href='#{link}'><img src='#{url}' /></a>"
2015-12-04 06:55:23 -05:00
end
end