diff --git a/app/models/site_feed_annc.rb b/app/models/site_feed_annc.rb index f763f69..882827c 100644 --- a/app/models/site_feed_annc.rb +++ b/app/models/site_feed_annc.rb @@ -190,6 +190,14 @@ class SiteFeedAnnc self.collection.aggregate(pipeline).collect do |data| tmp = data['data'] tmp['category'] = tmp['category'][locale] + if @image_version != 'thumb' && !@image_version.nil? + if @image_version == 'mobile' + tmp["img_src"] = tmp["image"]["mobile"] + else + tmp["img_src"] = tmp["image"]["original"] + end + tmp["img_src"] = tmp["img_src"] || "/assets/announcement-default.jpg" + end if tmp["link_to_show"].nil? if !is_widget tmp["link_to_show"] = UseSourceUrl && tmp["show_url"] ? "#{tmp["source_url"]}/#{locale}#{tmp["show_url"]}" : OrbitHelper.url_to_show(tmp["params"]) rescue '' @@ -213,6 +221,14 @@ class SiteFeedAnnc tmp = v next if tmp["is_hidden"] || (!tmp["postdate"].nil? && tmp["postdate"]