debian-mirror-gitlab/app/models/diff_viewer/image.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
562 B
Ruby
Raw Normal View History

2018-11-20 20:47:30 +05:30
# frozen_string_literal: true
2017-09-10 17:25:29 +05:30
module DiffViewer
class Image < Base
include Rich
include ClientSide
self.partial_name = 'image'
2019-12-21 20:55:43 +05:30
self.extensions = UploaderHelper::SAFE_IMAGE_EXT
2017-09-10 17:25:29 +05:30
self.binary = true
2020-07-28 23:09:34 +05:30
self.switcher_icon = 'doc-image'
2019-02-15 15:39:39 +05:30
self.switcher_title = _('image diff')
2021-01-29 00:20:46 +05:30
def self.can_render?(diff_file, verify_binary: true)
# When both blobs are missing, we often still have a textual diff that can
# be displayed
return false if diff_file.old_blob.nil? && diff_file.new_blob.nil?
super
end
2017-09-10 17:25:29 +05:30
end
end