Compare commits

..

1 Commits

Author SHA1 Message Date
spen 88e7bdea61 ntu_cph 2014-08-22 15:33:28 +08:00
5 changed files with 35 additions and 3 deletions

View File

@ -22,6 +22,8 @@ class Bulletin
field :subtitle, localize: true field :subtitle, localize: true
field :text, localize: true field :text, localize: true
field :image_description, localize: true
field :create_user_id field :create_user_id
field :update_user_id, :class_name => "User" field :update_user_id, :class_name => "User"

View File

@ -139,7 +139,32 @@
</label> </label>
</div> </div>
</div> </div>
<div class="image_note"><%= t("announcement.image_note")%></div>
</div>
</div>
<!-- Image Description -->
<div class="control-group">
<%= f.label t("announcement.image_description"),{:class=>"control-label muted", :func=>"field_label"} %>
<div class="controls add-input">
<div class="add-target">
<div class="input-append">
<div class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="image_description_<%= locale %>">
<%= f.fields_for :image_description_translations do |f| %>
<%= f.text_field locale, :value => (@bulletin.image_description_translations[locale] rescue nil), :placeholder=>"#{t("announcement.image_description")}" %>
<% end %>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#image_description_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %>
</div>
</div>
</div>
</div> </div>
</div> </div>

View File

@ -8,6 +8,11 @@
<span><%= link_to unit,panel_announcement_front_end_index_bulletins_by_unit_path(:name=>unit) unless unit.blank? %></span> <span><%= link_to unit,panel_announcement_front_end_index_bulletins_by_unit_path(:name=>unit) unless unit.blank? %></span>
</div> </div>
</div> </div>
<div class="news_image">
<%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %>
<%= link_to image_tag(@bulletin.image.url), @bulletin.image.url, {:target => '_blank', :title => @bulletin.image_identifier} if @bulletin.image.file %>
<span class="image_description"><%= @bulletin.image_description unless @bulletin.image_description.blank? %></span>
</div>
<div class="news_paragraph"> <div class="news_paragraph">
<%= @bulletin.text.html_safe rescue '' %> <%= @bulletin.text.html_safe rescue '' %>
</div> </div>

View File

@ -27,7 +27,7 @@ en:
bulletins: Announcement front-end bulletins: Announcement front-end
search_result: Search result search_result: Search result
image: Cover image image: Cover image
image_note: The image will not show in content image_description: Cover Image Description
link_name: Link Name link_name: Link Name
new_bulletin_category: New Bulletin Category new_bulletin_category: New Bulletin Category
picture: Cover Picture picture: Cover Picture

View File

@ -29,7 +29,7 @@ zh_tw:
bulletins: 公告前台 bulletins: 公告前台
search_result: 搜尋結果頁 search_result: 搜尋結果頁
image: 封面圖片 image: 封面圖片
image_note: 此處上傳的圖片不會在公告內文出現 image_description: 封面圖片說明
link_name: 連結名稱 link_name: 連結名稱
new_bulletin_category: 新增公告類別 new_bulletin_category: 新增公告類別
picture: 刊頭圖片 picture: 刊頭圖片