debshots/app/views/json/screenshots.json.jbuilder

11 lines
574 B
Ruby

json.cache! ['json_screenshots'], expires_in: 1.hour do
json.screenshots @s do |s|
p = s.package
json.extract! s, :version
json.extract! p, :maintainer, :name, :section, :maintainer_email, :homepage, :description
json.url package_url(p.name, protocol: 'https')
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