<% if request.params["action"] == "edit" %>
<%= f.select :unit_id, @unit.collect{|t| [ t.name, t.id ]} %>
<%= f.select :department_id, @department.collect{|t| [ t.name, t.id ]} %>
<% elsif request.params["action"]== "new" %>
<%=
select_tag "news_bulletin[unit_id]",
options_from_collection_for_select(@unit, "id", "name"),
:'data-remote' => 'true',
:'url' => "/admin/news/getdata",
:'prompt' => t("news_bulletin.ut_prompt"),
:'data-type' => 'json'
%>
<%=
select_tag "news_bulletin[department_id]"
%>
<% end %>
<%= select_category(f, @module_app) %>
<%= f.datetime_picker :postdate, :no_label => true, :new_record => @news_bulletin.new_record? %>
<%= f.datetime_picker :deadline, :no_label => true, :new_record => @news_bulletin.new_record? %>
<%# end %>
<% if @news_bulletin.image.file %>
<%= image_tag @news_bulletin.image %>
<% else %>
<% end %>
<%= t(:select_image) %>
<%= t(:change) %>
<%= f.file_field :image %>
<%= t(:cancel) %>
※<%= t("ad.widget_info_for_ad_image_size", :best_size=> "( 400px x 200px )") %>
※<%= t("news.image_size_limit")%>
※<%= t("news.image_note")%>
※如何裁剪新聞刊頭圖片
<% @site_in_use_locales.each do |locale| %>
<%= f.fields_for :image_description_translations do |f| %>
<%= f.text_field locale, value: (@news_bulletin.image_description_translations[locale.to_s] rescue nil) %>
<% end %>
<% end %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
">
※建議使用IE10、IE11、Chrome(最佳)、Firefox等瀏覽器。
※內文裡單一圖片大小為1MB以下。
※內文裡單一圖片尺寸的最大寬度600px(滿版),如圖片要縮小,請依比例調整。
※如何剪裁新聞圖片。
<%= f.fields_for :text_translations do |f| %>
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@news_bulletin.text_translations[locale] rescue nil) %>
<% end %>
<% end %>
<% if @news_bulletin && !@news_bulletin.news_bulletin_files.blank? %>
<% @news_bulletin.news_bulletin_files.each_with_index do |news_bulletin_file, i| %>
<%= f.fields_for :news_bulletin_files, news_bulletin_file do |f| %>
<%= render :partial => 'form_file', :object => news_bulletin_file, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag 'news_bulletin_file_field_count', @news_bulletin.news_bulletin_files.count %>
<%= t(:add) %>