<% if (CurationSetting.first.enable_annc_dept rescue false) %>
<%= t("curation.annc_dept") %>
<%= f.select("annc_dept", (options_for_select(CurationSetting.first.annc_depts.to_a.map.with_index{|dept,i| [dept, i] },:selected => f.object.annc_dept) rescue []) , { include_blank: true, id: "annc_dept" }) %>
<% end %>
<%= t(:category) %>
<%= select_category(f, @module_app) %>
<%= t(:start_date) %>
<%= f.datetime_picker :postdate, :no_label => true, :new_record => @bulletin.new_record?, :data=>{"picker-type" => "range", "range" => "start"} %>
<%= t(:end_date) %>
<%= f.datetime_picker :deadline, :no_label => true, :new_record => @bulletin.new_record?, :data=>{"picker-type" => "range", "range" => "end"} %>
<%= f.label :is_external_link, t("curation.is_external_link"), :class => "control-label muted" %>
<%= f.check_box :is_external_link %>
<%= f.label :external_link, t("curation.external_link"), :class => "control-label muted" %>
<%= f.text_field :external_link %>
<%= t("curation.external_link_hint") %>
<%= f.label :display_subtitle, t("curation.display_subtitle"), :class => "control-label muted" %>
<%= f.check_box :display_subtitle %>
<%= f.label :display_img, t("curation.display_img"), :class => "control-label muted" %>
<%= f.check_box :display_img %>
<% image_display_class_relation = {"full_width"=>"full-size-img","up_left_corner"=>"pull-left","up_right_corner"=>"pull-right"} %>
<%= f.label :image_display_class, t("curation.cover_image_display_setting"), :class => "control-label muted" %>
<% image_display_class_relation.each.with_index do |(key,value),i| %>
<%= radio_button_tag "#{f.object_name}[image_display_class]", value , (f.object.image_display_class == value) %>
<%= t("curation.#{key}") %>
<% end %>
<% if((!CurationSetting.first.only_manager_can_edit_status) || (CurationSetting.first.only_manager_can_edit_status && (@current_user.is_admin? || @current_user.is_manager?(@module_app))) ) %>
<%= t(:status) %>
<% if !(@reach_limit.include?('is_top') && @bulletin.is_top != true) || current_user.is_admin? %>
<%= f.check_box :is_top %> <%= t(:top) %>
<% else %>
<%= t(:top) %>
<% end %>
<% if !(@reach_limit.include?('is_hot') && @bulletin.is_hot != true) || current_user.is_admin? %>
<%= f.check_box :is_hot %> <%= t(:hot) %>
<% else %>
<%= t(:hot) %>
<% end %>
<%= f.check_box :is_hidden %> <%= t(:hide) %>
<% if !@bulletin.is_top? && !CurationSetting.check_limit_for_user((@bulletin.new_record? ? current_user.id : @bulletin.create_user_id)) %>
Top limit has been reached. The bulletin wont be marked as top even if you click on it.
<% end %>
" data-for="is_top">
Top end time
<%= f.datetime_picker :top_end_date, :no_label => true, :new_record => @bulletin.new_record? %>
<%= t('curation.open_comment')%>
<%= f.check_box :open_comment %><%= t('curation.open') %>
<% end %>
<%= t(:tags) %>
<%= select_tags(f, @module_app) %>
<%= t(:image) %>
<% if @bulletin.image.file %>
<%= image_tag @bulletin.image %>
<% else %>
<% end %>
<%= t(:select_image) %>
<%= t(:change) %>
<%= f.file_field :image %>
<%= t(:cancel) %>
<%= f.check_box :remove_image %><%= t(:remove) %>
<% @site_in_use_locales.each do |locale| %>
<%= f.fields_for :image_description_translations do |f| %>
<%= t(:description) + " (#{t(locale.to_s)})" %>
<%= f.text_field locale, value: (@bulletin.image_description_translations[locale.to_s] rescue nil) %>
<% end %>
<% end %>
<%= f.label :custom_carousel_image_type, t("curation.default_carousel_image_type"), :class => "control-label muted" %>
<% carousel_image_types = ["default","carousel","album"] %>
<%= f.select :custom_carousel_image_type, options_for_select(carousel_image_types.map.with_index{|type,i| [t("curation.carousel_image_types.#{type}"),i]}.to_h,:selected => f.object.custom_carousel_image_type) %>
<%= t("curation.carousel_image_width") %>
<%= f.text_field :custom_carousel_image_width, :placeholder => t("curation.custom_carousel_image_width_hint") %>
<% if @bulletin && !@bulletin.curation_post_carousel_images.blank? %>
<% @bulletin.curation_post_carousel_images.each_with_index do |bulletin_carousel_image, i| %>
<%= f.fields_for :curation_post_carousel_images, bulletin_carousel_image do |f| %>
<%= render :partial => 'form_image', :object => bulletin_carousel_image, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag 'curation_post_carousel_image_count', @bulletin.curation_post_carousel_images.count %>
<%= t(:add) %>
<%= t("curation.email_to") %>
<%= f.check_box :email_sent, {:id=>'remind-check'} %>
<%= t('curation.activate_email_reminder')%>
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'curation_post[email_member_ids][]', email_members: @bulletin.email_members} %>
<%= "#{t("curation.other_mailaddress")}(#{t("curation.other_mailaddress_note")})"%>
<%= f.text_area :other_mailaddress, :class=>"span12", :cols=>"25", :rows=>"10" %>
<%= t("curation.email_sentdate") %>
<%= f.datetime_picker :email_sentdate, :no_label => true %>
<% if (@bulletin.email.is_sent rescue false) %>
<% end %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
<% end %>
<%= t("curation.section") %>
<%= t(:file_) %>
<%= t("curation.file_description_hint") %>
<% if @bulletin && !@bulletin.curation_post_files.blank? %>
<% @bulletin.curation_post_files.each_with_index do |bulletin_file, i| %>
<%= f.fields_for :curation_post_files, bulletin_file do |f| %>
<%= render :partial => 'form_file', :object => bulletin_file, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag 'curation_post_file_field_count', @bulletin.curation_post_files.count %>
<%= t(:add) %>