JSON output migrated to Paperclip style URLs
This commit is contained in:
parent
5153043f46
commit
6303343c17
3 changed files with 7 additions and 5 deletions
|
|
@ -1,7 +1,8 @@
|
|||
json.package @p.name
|
||||
|
||||
json.screenshots @p.screenshots do |s|
|
||||
json.small_image_url "https://#{request.host_with_port}#{s.image.variant(resize_to_limit: [160,120], timestamp: false)}"
|
||||
json.large_image_url "https://#{request.host_with_port}#{s.image.variant(resize_to_limit: [800,600], timestamp: false)}"
|
||||
json.thumb_image_url "#{request.protocol}#{request.host_with_port}#{s.simage_url(:thumb)}"
|
||||
json.small_image_url "#{request.protocol}#{request.host_with_port}#{s.simage_url(:small)}"
|
||||
json.large_image_url "#{request.protocol}#{request.host_with_port}#{s.simage_url(:large)}"
|
||||
json.version s.version
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ json.cache! ['json_screenshots'], expires_in: 1.hour do
|
|||
json.extract! s, :version
|
||||
json.extract! p, :maintainer, :name, :section, :maintainer_email, :homepage, :description
|
||||
json.url package_url(p.name, protocol: 'https')
|
||||
json.small_image_url "https://#{request.host_with_port}#{s.image.variant(resize_to_limit: [160,120])}"
|
||||
json.large_image_url "https://#{request.host_with_port}#{s.image.variant(resize_to_limit: [800,600])}"
|
||||
json.thumb_image_url "#{request.protocol}#{request.host_with_port}#{s.simage_url(:thumb)}"
|
||||
json.small_image_url "#{request.protocol}#{request.host_with_port}#{s.simage_url(:small)}"
|
||||
json.large_image_url "#{request.protocol}#{request.host_with_port}#{s.simage_url(:large)}"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
.grid-x.small-up-1.medium-up-3.large-up-4.grid-thumbnails
|
||||
- @current_users_screenshots.each do |screenshot|
|
||||
.column
|
||||
|
||||
/ TODO: old Paperclip style
|
||||
a.black.fancybox href=screenshot.image.variant(resize_to_limit: [800,600], timestamp: false)
|
||||
div.grid-thumbnail
|
||||
= image_tag(screenshot.image.variant(resize_to_limit: [160,120]), alt: screenshot.caption, class: 'thumbnail')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue