ci_badge_helper.rb 486 Bytes
Newer Older
1 2 3
module CiBadgeHelper
  def markdown_badge_code(project, ref)
    url = status_ci_project_url(project, ref: ref, format: 'png')
Kamil Trzcinski's avatar
Kamil Trzcinski committed
4 5
    link = namespace_project_commits_path(project.namespace, project, ref)
    "[![build status](#{url})](#{link})"
6 7 8 9
  end

  def html_badge_code(project, ref)
    url = status_ci_project_url(project, ref: ref, format: 'png')
Kamil Trzcinski's avatar
Kamil Trzcinski committed
10 11
    link = namespace_project_commits_path(project.namespace, project, ref)
    "<a href='#{link}'><img src='#{url}' /></a>"
12 13
  end
end