small fix

This commit is contained in:
Harry Bomrah 2016-04-12 17:52:50 +08:00
parent 28937534fe
commit 73ad4a5eb4
1 changed files with 6 additions and 2 deletions

View File

@ -294,8 +294,12 @@ class AnnouncementsController < ApplicationController
desc = (desc.nil? || desc == "" ? "announcement image" : desc) desc = (desc.nil? || desc == "" ? "announcement image" : desc)
request = OrbitHelper.request request = OrbitHelper.request
meta_desc = announcement["subtitle_translations"].present? && announcement["subtitle_translations"][locale] != "" ? announcement["subtitle_translations"][locale] : announcement["text_translations"][locale][0..200] if announcement["subtitle_translations"].present?
meta_desc = announcement["subtitle_translations"][locale] != "" ? announcement["subtitle_translations"][locale] : announcement["text_translations"][locale][0..200]
else
meta_desc = ""
end
OrbitHelper.render_meta_tags([{"property" => "og:title", "content" => announcement["title_translations"][locale]},{"property" => "og:site_name", "content" => Site.first.title},{"property" => "og:url", "content" => request.original_url},{"property" => "og:description", "content" => meta_desc},{"property" => "og:image", "content" => announcement["image"]["original"]},{"property" => "og:type", "content" => "Article"}]) OrbitHelper.render_meta_tags([{"property" => "og:title", "content" => announcement["title_translations"][locale]},{"property" => "og:site_name", "content" => Site.first.title},{"property" => "og:url", "content" => request.original_url},{"property" => "og:description", "content" => meta_desc},{"property" => "og:image", "content" => announcement["image"]["original"]},{"property" => "og:type", "content" => "Article"}])
datetime = DateTime.parse(announcement["postdate"]) datetime = DateTime.parse(announcement["postdate"])