<%= select_category(f, @module_app) %>
<%= f.datetime_picker :postdate, :no_label => true, :new_record => @video_program.new_record?, :data=>{"picker-type" => "range", "range" => "start"} %>
<%= f.datetime_picker :deadline, :no_label => true, :new_record => @video_program.new_record?, :data=>{"picker-type" => "range", "range" => "end"} %>
<%= f.label :video_external_link, t("video_program.video_external_link"), :class => "control-label muted" %>
<%= f.text_field :video_external_link %>
<%= f.label :episodes, t("video_program.episodes"), :class => "control-label muted" %>
<%= f.number_field :episodes %>
<% if @current_user.is_admin? || @current_user.is_manager?(@module_app) %>
" data-for="is_top">
<%= f.datetime_picker :top_end_date, :no_label => true, :new_record => @video_program.new_record? %>
<% end %>
<%= select_tags(f, @module_app) %>
<%= f.label :display_video_image, t("video_program.display_video_image"), :class => "control-label muted" %>
<%= f.check_box :display_video_image %>
<% if @video_program.video_image.file %>
<%= image_tag @video_program.video_image %>
<% else %>
<% end %>
<%= t(:select_image) %>
<%= t(:change) %>
<%= f.file_field :video_image %>
<%= t(:cancel) %>
<% @site_in_use_locales.each do |locale| %>
<%= f.fields_for :video_image_description_translations do |f| %>
<%= f.text_field locale, value: (@video_program.video_image_description_translations[locale.to_s] rescue nil) %>
<% end %>
<% end %>
<%= f.label :display_image, t("video_program.display_image"), :class => "control-label muted" %>
<%= f.check_box :display_image %>
<% if @video_program.image.file %>
<%= image_tag @video_program.image %>
<% else %>
<% end %>
<%= t(:select_image) %>
<%= t(:change) %>
<%= f.file_field :image %>
<%= t(:cancel) %>
<% @site_in_use_locales.each do |locale| %>
<%= f.fields_for :image_description_translations do |f| %>
<%= f.text_field locale, value: (@video_program.image_description_translations[locale.to_s] rescue nil) %>
<% end %>
<% end %>
<%= f.text_field :custom_carousel_image_width, :placeholder => t("video_program.custom_carousel_image_width_hint") %>
<% if !f.object.video_program_carousel_images.blank? %>
<% f.object.video_program_carousel_images.each_with_index do |video_program_carousel_image, i| %>
<%= f.fields_for :video_program_carousel_images, video_program_carousel_image do |f| %>
<%= render :partial => 'form_image', :object => video_program_carousel_image, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag 'bulletin_carousel_image_count', f.object.video_program_carousel_images.count %>
<%= t(:add) %>
<%= render partial: 'admin/galleries/select_albums_form', locals: {field: 'video_program[album_ids][]', albums: f.object.albums} %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
<% end %>
<% if @video_program && !@video_program.video_program_files.blank? %>
<% @video_program.video_program_files.each_with_index do |video_program_file, i| %>
<%= f.fields_for :video_program_files, video_program_file do |f| %>
<%= render :partial => 'form_file', :object => video_program_file, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<% end %>
<%= hidden_field_tag 'video_program_file_field_count', @video_program.video_program_files.count %>
<%= t(:add) %>