add img_description for front-end

This commit is contained in:
EricTYL 2020-01-13 17:24:21 +08:00
parent 78c62a0633
commit 0fa05d46c2
1 changed files with 2 additions and 0 deletions

View File

@ -340,6 +340,7 @@ class AnnouncementsController < ApplicationController
img_src = nil
subtitle_ann = announcement.subtitle if announcement.display_subtitle?
img_src = (announcement.image.thumb.url || "/assets/announcement-default.jpg") if announcement.display_img?
img_description = announcement.image_description if announcement.image_description.present?
{
"tags" => tags,
@ -353,6 +354,7 @@ class AnnouncementsController < ApplicationController
"body" =>announcement.text,
"image" => announcement.image.url,
"img_src" => img_src,
"img_description" => img_description,
"alt_title" => desc
},
"impressionist" => (announcement.is_preview ? nil : announcement),