Commit 72d5a566b46db918b17a1040b6e6d0a3dd986386
1 parent
42cf48f5
Exists in
master
and in
4 other branches
Show gitlab-ci status on project dashboard
Showing
2 changed files
with
13 additions
and
0 deletions
Show diff stats
app/models/gitlab_ci_service.rb
... | ... | @@ -46,4 +46,12 @@ class GitlabCiService < Service |
46 | 46 | def build_page sha |
47 | 47 | project_url + "/builds/#{sha}" |
48 | 48 | end |
49 | + | |
50 | + def builds_path | |
51 | + project_url + "?ref=" + project.default_branch | |
52 | + end | |
53 | + | |
54 | + def status_img_path | |
55 | + project_url + "/status.png?ref=" + project.default_branch | |
56 | + end | |
49 | 57 | end | ... | ... |
app/views/projects/show.html.haml
... | ... | @@ -44,3 +44,8 @@ |
44 | 44 | %p |
45 | 45 | Forked from: |
46 | 46 | = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project) |
47 | + | |
48 | + - if @project.gitlab_ci? | |
49 | + %hr | |
50 | + = link_to @project.gitlab_ci_service.builds_path do | |
51 | + = image_tag @project.gitlab_ci_service.status_img_path, alt: "build status" | ... | ... |