diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-20 11:26:20 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-20 11:26:20 +0300 |
commit | 74935080d6580c0ee9a7f7d93fd65542e1643694 (patch) | |
tree | f20042140f63cf65f951c2aa8f5028abcb0c9ca7 | |
parent | 1f82dda74c6e24b6ad0a6f91312a5da72a93537c (diff) | |
download | gitlab-ci-74935080d6580c0ee9a7f7d93fd65542e1643694.tar.gz |
Use retina-ready standard badges
-rw-r--r-- | app/controllers/projects_controller.rb | 2 | ||||
-rw-r--r-- | app/services/image_for_build_service.rb | 10 | ||||
-rw-r--r-- | public/build-canceled.svg | 1 | ||||
-rw-r--r-- | public/build-failed.svg | 1 | ||||
-rw-r--r-- | public/build-pending.svg | 1 | ||||
-rw-r--r-- | public/build-running.svg | 1 | ||||
-rw-r--r-- | public/build-success.svg | 1 | ||||
-rw-r--r-- | public/build-unknown.svg | 1 | ||||
-rw-r--r-- | public/canceled.png | bin | 4329 -> 0 bytes | |||
-rw-r--r-- | public/failed.png | bin | 1311 -> 0 bytes | |||
-rw-r--r-- | public/pending.png | bin | 4189 -> 0 bytes | |||
-rw-r--r-- | public/running.png | bin | 1210 -> 0 bytes | |||
-rw-r--r-- | public/success.png | bin | 1324 -> 0 bytes | |||
-rw-r--r-- | public/unknown.png | bin | 1415 -> 0 bytes |
14 files changed, 10 insertions, 8 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 4c4d34e..ad5b120 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -99,7 +99,7 @@ class ProjectsController < ApplicationController def badge image = ImageForBuildService.new.execute(@project, params) - send_file image.path, filename: image.name, disposition: 'inline' + send_file image.path, filename: image.name, disposition: 'inline', type:"image/svg+xml" end def toggle_shared_runners diff --git a/app/services/image_for_build_service.rb b/app/services/image_for_build_service.rb index 382e969..50e5531 100644 --- a/app/services/image_for_build_service.rb +++ b/app/services/image_for_build_service.rb @@ -8,7 +8,7 @@ class ImageForBuildService commit = project.last_commit_for_ref(params[:ref]) image_for_commit(commit) else - 'unknown.png' + 'build-unknown.svg' end image_path = Rails.root.join('public', image_name) @@ -22,12 +22,8 @@ class ImageForBuildService private def image_for_commit(commit) - return 'unknown.png' unless commit + return 'build-unknown.svg' unless commit - if commit.status == 'pending' - 'running.png' - else - commit.status + ".png" - end + 'build-' + commit.status + ".svg" end end diff --git a/public/build-canceled.svg b/public/build-canceled.svg new file mode 100644 index 0000000..922e28b --- /dev/null +++ b/public/build-canceled.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="97" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="97" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#9f9f9f" d="M37 0h60v20H37z"/><path fill="url(#b)" d="M0 0h97v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">build</text><text x="18.5" y="14">build</text><text x="66" y="15" fill="#010101" fill-opacity=".3">canceled</text><text x="66" y="14">canceled</text></g></svg>
\ No newline at end of file diff --git a/public/build-failed.svg b/public/build-failed.svg new file mode 100644 index 0000000..1aefd3f --- /dev/null +++ b/public/build-failed.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="78" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="78" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#e05d44" d="M37 0h41v20H37z"/><path fill="url(#b)" d="M0 0h78v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">build</text><text x="18.5" y="14">build</text><text x="56.5" y="15" fill="#010101" fill-opacity=".3">failed</text><text x="56.5" y="14">failed</text></g></svg>
\ No newline at end of file diff --git a/public/build-pending.svg b/public/build-pending.svg new file mode 100644 index 0000000..536931a --- /dev/null +++ b/public/build-pending.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="92" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="92" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#dfb317" d="M37 0h55v20H37z"/><path fill="url(#b)" d="M0 0h92v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">build</text><text x="18.5" y="14">build</text><text x="63.5" y="15" fill="#010101" fill-opacity=".3">pending</text><text x="63.5" y="14">pending</text></g></svg>
\ No newline at end of file diff --git a/public/build-running.svg b/public/build-running.svg new file mode 100644 index 0000000..0d71eef --- /dev/null +++ b/public/build-running.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="90" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="90" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#dfb317" d="M37 0h53v20H37z"/><path fill="url(#b)" d="M0 0h90v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">build</text><text x="18.5" y="14">build</text><text x="62.5" y="15" fill="#010101" fill-opacity=".3">running</text><text x="62.5" y="14">running</text></g></svg>
\ No newline at end of file diff --git a/public/build-success.svg b/public/build-success.svg new file mode 100644 index 0000000..43b67e4 --- /dev/null +++ b/public/build-success.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="91" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="91" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#4c1" d="M37 0h54v20H37z"/><path fill="url(#b)" d="M0 0h91v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">build</text><text x="18.5" y="14">build</text><text x="63" y="15" fill="#010101" fill-opacity=".3">success</text><text x="63" y="14">success</text></g></svg>
\ No newline at end of file diff --git a/public/build-unknown.svg b/public/build-unknown.svg new file mode 100644 index 0000000..c72a2f5 --- /dev/null +++ b/public/build-unknown.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="98" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="98" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#9f9f9f" d="M37 0h61v20H37z"/><path fill="url(#b)" d="M0 0h98v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">build</text><text x="18.5" y="14">build</text><text x="66.5" y="15" fill="#010101" fill-opacity=".3">unknown</text><text x="66.5" y="14">unknown</text></g></svg>
\ No newline at end of file diff --git a/public/canceled.png b/public/canceled.png Binary files differdeleted file mode 100644 index 2d6f467..0000000 --- a/public/canceled.png +++ /dev/null diff --git a/public/failed.png b/public/failed.png Binary files differdeleted file mode 100644 index e751ade..0000000 --- a/public/failed.png +++ /dev/null diff --git a/public/pending.png b/public/pending.png Binary files differdeleted file mode 100644 index 69e18f3..0000000 --- a/public/pending.png +++ /dev/null diff --git a/public/running.png b/public/running.png Binary files differdeleted file mode 100644 index 2398b4d..0000000 --- a/public/running.png +++ /dev/null diff --git a/public/success.png b/public/success.png Binary files differdeleted file mode 100644 index 83eef5c..0000000 --- a/public/success.png +++ /dev/null diff --git a/public/unknown.png b/public/unknown.png Binary files differdeleted file mode 100644 index 04a43e8..0000000 --- a/public/unknown.png +++ /dev/null |