summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-09-28 13:57:08 +0200
committerAlexis Reigel <mail@koffeinfrei.org>2018-06-05 16:20:21 +0200
commit67fe0a17d87a7a5380b41e04ef23212d5da637ba (patch)
tree2be846ca693640f73058ebd0dd1b39b06e3f2666 /app/uploaders
parent40ffa8401b96dda5f67ea699dbcca0ff64263810 (diff)
downloadgitlab-ce-67fe0a17d87a7a5380b41e04ef23212d5da637ba.tar.gz
call Gitlab::Favicon.status in serializer
this ways we can keep the `lib/gitlab/ci/status/*` classes to return the bare favicon name as it was before. also the favicon uploader versions are now have the same names as the stock favicons (+ `favicon_` prefix), which makes working with the status names easier.
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/favicon_uploader.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/app/uploaders/favicon_uploader.rb b/app/uploaders/favicon_uploader.rb
index d3debc16fa9..7697f5fe885 100644
--- a/app/uploaders/favicon_uploader.rb
+++ b/app/uploaders/favicon_uploader.rb
@@ -2,19 +2,19 @@ class FaviconUploader < AttachmentUploader
include CarrierWave::MiniMagick
STATUS_ICON_NAMES = [
- :status_canceled,
- :status_created,
- :status_failed,
- :status_manual,
- :status_not_found,
- :status_pending,
- :status_running,
- :status_skipped,
- :status_success,
- :status_warning
+ :favicon_status_canceled,
+ :favicon_status_created,
+ :favicon_status_failed,
+ :favicon_status_manual,
+ :favicon_status_not_found,
+ :favicon_status_pending,
+ :favicon_status_running,
+ :favicon_status_skipped,
+ :favicon_status_success,
+ :favicon_status_warning
].freeze
- version :default do
+ version :favicon_main do
process resize_to_fill: [32, 32]
process convert: 'ico'
@@ -24,7 +24,7 @@ class FaviconUploader < AttachmentUploader
end
STATUS_ICON_NAMES.each do |status_name|
- version status_name, from_version: :default do
+ version status_name, from_version: :favicon_main do
process status_favicon: status_name
def full_filename(filename)
@@ -41,7 +41,7 @@ class FaviconUploader < AttachmentUploader
def status_favicon(status_name)
manipulate! do |img|
- overlay_path = Rails.root.join("app/assets/images/ci_favicons/overlays/favicon_#{status_name}.png")
+ overlay_path = Rails.root.join("app/assets/images/ci_favicons/overlays/#{status_name}.png")
overlay = MiniMagick::Image.open(overlay_path)
img.composite(overlay) do |c|
c.compose 'over'