<% 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) %>
※此區塊圖片尺寸使用比例為2:1(圖片寬:高),寬度最低400px,亦即最小尺寸為400px*200px。
※<%= t("news.image_size_limit")%>
※上傳圖片格式僅支援.gif、.jpg、.png
※<%= 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) %>