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
Tatuya Kamada
gitlab-ce
Commits
b6ca47f6
Commit
b6ca47f6
authored
Aug 11, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method for coverage badge in badges controller
parent
3e481f15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
app/controllers/projects/badges_controller.rb
app/controllers/projects/badges_controller.rb
+15
-2
No files found.
app/controllers/projects/badges_controller.rb
View file @
b6ca47f6
...
...
@@ -4,11 +4,24 @@ class Projects::BadgesController < Projects::ApplicationController
before_action
:no_cache_headers
,
except:
[
:index
]
def
build
badge
=
Gitlab
::
Badge
::
Build
::
Status
.
new
(
project
,
params
[
:ref
])
build_status
=
Gitlab
::
Badge
::
Build
::
Status
.
new
(
project
,
params
[
:ref
])
render_badge
build_status
end
def
coverage
coverage_report
=
Gitlab
::
Badge
::
Coverage
::
Report
.
new
(
project
,
params
[
:ref
],
params
[
:job
])
render_badge
coverage_report
end
private
def
render_badge
(
badge
)
respond_to
do
|
format
|
format
.
html
{
render_404
}
format
.
svg
do
render
'badge'
,
locals:
{
badge:
badge
.
template
}
end
...
...
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