From 8af5112d24ad0da41c08276efb03bcb5fb7ee9a7 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 22 Nov 2013 15:22:22 +0800 Subject: [PATCH] Updated image json with albums --- .../panel/gallery/back_end/albums_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb index a67581eb..98cf250e 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb @@ -107,11 +107,17 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController image.tag_ids.each do |tag| tags << get_tags.include?(tag) end + + if image.file.theater.present? + @image_file = image.file.theater.url + else + @image_file = image.file.url + end output << { image_title: image.title, image_description: image.description, - image_file: { url: "http://#{request.host_with_port}#{image.file.url}", + image_file: { url: "http://#{request.host_with_port}#{@image_file}", thumb: "http://#{request.host_with_port}#{image.file.thumb.to_s}"}, image_tag_names: tags} end