Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
ebcbe0c8
Commit
ebcbe0c8
authored
Nov 20, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add status badge for MR
parent
ed92cfde
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
0 deletions
+20
-0
app/assets/stylesheets/sections/merge_requests.scss
app/assets/stylesheets/sections/merge_requests.scss
+5
-0
app/helpers/merge_requests_helper.rb
app/helpers/merge_requests_helper.rb
+4
-0
app/models/gitlab_ci_service.rb
app/models/gitlab_ci_service.rb
+4
-0
app/models/project.rb
app/models/project.rb
+4
-0
app/views/merge_requests/show/_mr_box.html.haml
app/views/merge_requests/show/_mr_box.html.haml
+3
-0
No files found.
app/assets/stylesheets/sections/merge_requests.scss
View file @
ebcbe0c8
...
...
@@ -138,3 +138,8 @@ li.merge_request {
}
}
.status-badge
{
height
:
32px
;
width
:
100%
;
@include
border-radius
(
5px
);
}
app/helpers/merge_requests_helper.rb
View file @
ebcbe0c8
...
...
@@ -38,4 +38,8 @@ module MergeRequestsHelper
classes
<<
" merged"
if
mr
.
merged?
classes
end
def
ci_status_path
@project
.
gitlab_ci_service
.
commit_badge_path
(
@merge_request
.
last_commit
.
sha
)
end
end
app/models/gitlab_ci_service.rb
View file @
ebcbe0c8
...
...
@@ -32,4 +32,8 @@ class GitlabCiService < Service
hook
.
url
=
[
project_url
,
"/build"
,
"?token=
#{
token
}
"
].
join
(
""
)
hook
.
save
end
def
commit_badge_path
sha
project_url
+
"/status?sha=
#{
sha
}
"
end
end
app/models/project.rb
View file @
ebcbe0c8
...
...
@@ -188,4 +188,8 @@ class Project < ActiveRecord::Base
def
services
[
gitlab_ci_service
].
compact
end
def
gitlab_ci?
gitlab_ci_service
&&
gitlab_ci_service
.
active
end
end
app/views/merge_requests/show/_mr_box.html.haml
View file @
ebcbe0c8
...
...
@@ -6,6 +6,9 @@
-
else
.alert-message.success.status_info
Open
=
gfm
escape_once
(
@merge_request
.
title
)
-
if
@project
.
gitlab_ci?
.right
=
image_tag
ci_status_path
,
class:
'status-badge'
.middle_box_content
%div
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment