-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove AMS and replace with simple json rendering
- Loading branch information
Showing
41 changed files
with
258 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module ImageRendering | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
private | ||
|
||
def image(object) | ||
return nil if object.image.blank? | ||
return nil unless object.image.image.variable? | ||
|
||
rails_blob_url(object.image.image) | ||
end | ||
|
||
def image100(object) | ||
return nil if object.image.blank? | ||
return nil unless object.image.image.variable? | ||
|
||
rails_representation_url(object.image.image.variant(resize_to_cover: [100, 100])) | ||
end | ||
|
||
def image250(object) | ||
return nil if object.image.blank? | ||
return nil unless object.image.image.variable? | ||
|
||
rails_representation_url(object.image.image.variant(resize_to_cover: [250, 250])) | ||
end | ||
|
||
def image500(object) | ||
return nil if object.image.blank? | ||
return nil unless object.image.image.variable? | ||
|
||
rails_representation_url(object.image.image.variant(resize_to_cover: [500, 500])) | ||
end | ||
|
||
def image_type(object) | ||
return nil if object.image.blank? | ||
return nil unless object.image.image.variable? | ||
|
||
object.image.image_type.mimetype | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.