<%= t(:category) %>
<%= select_category(f, @module_app) %>
<%= t(:start_date) %>
<%= f.datetime_picker :postdate, :no_label => true, :new_record => @custom_bulletin.new_record?, :data=>{"picker-type" => "range", "range" => "start"} %>
<%= t(:end_date) %>
<%= f.datetime_picker :deadline, :no_label => true, :new_record => @custom_bulletin.new_record?, :data=>{"picker-type" => "range", "range" => "end"} %>
<%= f.label :is_external_link, t("custom_announcement.is_external_link"), :class => "control-label muted" %>
<%= f.check_box :is_external_link %>
<%= f.label :external_link, t("custom_announcement.external_link"), :class => "control-label muted" %>
<%= f.text_field :external_link %>
<%= t("custom_announcement.external_link_hint") %>
<%= f.label :display_subtitle, t("custom_announcement.display_subtitle"), :class => "control-label muted" %>
<%= f.check_box :display_subtitle %>
<%= f.label :display_img, t("custom_announcement.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("custom_announcement.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("custom_announcement.#{key}") %>
<% end %>
<% if defined? Calendar %>
<%= t('custom_announcement.add_to_calendar') %>
<%= f.check_box :add_to_calendar,onchange: 'trigger_on_add_calendar(this)' %>
>
<%= t('calendar.calendar') %>
<%= f.select :calendar_type_id, @calendar_categories.collect{|t| [ t.title, t.id ]} %>
<%= t(:start_date) %>
<%= t('custom_announcement.blank_to_set') %>
<%= f.datetime_picker :calendar_start_date, :new_record => @custom_bulletin.new_record?, :no_label => true, :data=>{"picker-type" => "range", "range" => "start"} %>
<%= t(:end_date) %>
<%= t('custom_announcement.blank_to_set') %>
<%= f.datetime_picker :calendar_end_date, :new_record => @custom_bulletin.new_record?, :no_label => true, :data=>{"picker-type" => "range", "range" => "end"} %>
<%= t('calendar.all_day') %>
<%= f.check_box :calendar_all_day %>
Select Read More Page :
<%= f.select :page_id,[["----- Select a page -----",nil]]+@module_pages %>
<%= f.hidden_field :event_id %>
<% end %>
<% if((!CustomAnnouncementSetting.first.only_manager_can_edit_status) || (CustomAnnouncementSetting.first.only_manager_can_edit_status && (@current_user.is_admin? || @current_user.is_manager?(@module_app))) ) %>
<%= t(:status) %>
<% if !(@reach_limit.include?('is_top') && @custom_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') && @custom_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 !@custom_bulletin.is_top? && !CustomAnnouncementSetting.check_limit_for_user((@custom_bulletin.new_record? ? current_user.id : @custom_bulletin.create_user_id)) %>
Top limit has been reached. The custom_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 => @custom_bulletin.new_record? %>
<%= t('custom_announcement.open_comment')%>
<%= f.check_box :open_comment %><%= t('custom_announcement.open') %>
<% end %>
<%= t(:tags) %>
<%= select_tags(f, @module_app) %>
<%= t(:image) %>
<% if @custom_bulletin.image.file %>
<%= image_tag @custom_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: (@custom_bulletin.image_description_translations[locale.to_s] rescue nil) %>
<% end %>
<% end %>
<% if @custom_bulletin && !@custom_bulletin.custom_bulletin_carousel_images.blank? %>
<% @custom_bulletin.custom_bulletin_carousel_images.each_with_index do |custom_bulletin_carousel_image, i| %>
<%= f.fields_for :custom_bulletin_carousel_images, custom_bulletin_carousel_image do |f| %>
<%= render :partial => 'form_image', :object => custom_bulletin_carousel_image, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag 'custom_bulletin_carousel_image_count', @custom_bulletin.custom_bulletin_carousel_images.count %>
<%= t(:add) %>