Merge branch 'master' into 'master'
add i18n, add image description * add i18n for displaying subtitle / cover image * add img_description for front-end See merge request !7
This commit is contained in:
commit
3883e1a661
|
@ -340,6 +340,7 @@ class AnnouncementsController < ApplicationController
|
||||||
img_src = nil
|
img_src = nil
|
||||||
subtitle_ann = announcement.subtitle if announcement.display_subtitle?
|
subtitle_ann = announcement.subtitle if announcement.display_subtitle?
|
||||||
img_src = (announcement.image.thumb.url || "/assets/announcement-default.jpg") if announcement.display_img?
|
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,
|
"tags" => tags,
|
||||||
|
@ -353,6 +354,7 @@ class AnnouncementsController < ApplicationController
|
||||||
"body" =>announcement.text,
|
"body" =>announcement.text,
|
||||||
"image" => announcement.image.url,
|
"image" => announcement.image.url,
|
||||||
"img_src" => img_src,
|
"img_src" => img_src,
|
||||||
|
"img_description" => img_description,
|
||||||
"alt_title" => desc
|
"alt_title" => desc
|
||||||
},
|
},
|
||||||
"impressionist" => (announcement.is_preview ? nil : announcement),
|
"impressionist" => (announcement.is_preview ? nil : announcement),
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
|
|
||||||
<!-- display subtitle -->
|
<!-- display subtitle -->
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<%= f.label :display_subtitle, 'display subtitle', :class => "control-label muted" %>
|
<%= f.label :display_subtitle, t("announcement.display_subtitle"), :class => "control-label muted" %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.check_box :display_subtitle %>
|
<%= f.check_box :display_subtitle %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
|
|
||||||
<!-- display img src -->
|
<!-- display img src -->
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<%= f.label :display_img, 'display img src', :class => "control-label muted" %>
|
<%= f.label :display_img, t("announcement.display_img"), :class => "control-label muted" %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.check_box :display_img %>
|
<%= f.check_box :display_img %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -94,3 +94,5 @@ en:
|
||||||
is_external_link: Enable External Link
|
is_external_link: Enable External Link
|
||||||
external_link: External Link
|
external_link: External Link
|
||||||
external_link_hint: "Make sure URL starts with http://"
|
external_link_hint: "Make sure URL starts with http://"
|
||||||
|
display_subtitle: Display Subtitle
|
||||||
|
display_img: Display Cover Image
|
||||||
|
|
|
@ -98,3 +98,5 @@ zh_tw:
|
||||||
is_external_link: 連結外部網址
|
is_external_link: 連結外部網址
|
||||||
external_link: 外部連結
|
external_link: 外部連結
|
||||||
external_link_hint: "確定連結開頭為http://"
|
external_link_hint: "確定連結開頭為http://"
|
||||||
|
display_subtitle: 顯示副標題
|
||||||
|
display_img: 顯示圖片
|
||||||
|
|
Loading…
Reference in New Issue