summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-14 13:31:29 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-14 13:31:29 +0300
commit72d5a566b46db918b17a1040b6e6d0a3dd986386 (patch)
tree8797bb173fb876f6d1ea078b94a8510160c3ebfe
parent42cf48f59d648d732636f4d7e74d460437dc71b7 (diff)
downloadgitlab-ce-72d5a566b46db918b17a1040b6e6d0a3dd986386.tar.gz
Show gitlab-ci status on project dashboard
-rw-r--r--app/models/gitlab_ci_service.rb8
-rw-r--r--app/views/projects/show.html.haml5
2 files changed, 13 insertions, 0 deletions
diff --git a/app/models/gitlab_ci_service.rb b/app/models/gitlab_ci_service.rb
index 4eb39c7ef4d..9b1c707a6c9 100644
--- a/app/models/gitlab_ci_service.rb
+++ b/app/models/gitlab_ci_service.rb
@@ -46,4 +46,12 @@ class GitlabCiService < Service
def build_page sha
project_url + "/builds/#{sha}"
end
+
+ def builds_path
+ project_url + "?ref=" + project.default_branch
+ end
+
+ def status_img_path
+ project_url + "/status.png?ref=" + project.default_branch
+ end
end
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index 6ee2e3827b2..8a095130159 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -44,3 +44,8 @@
%p
Forked from:
= link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
+
+ - if @project.gitlab_ci?
+ %hr
+ = link_to @project.gitlab_ci_service.builds_path do
+ = image_tag @project.gitlab_ci_service.status_img_path, alt: "build status"