<% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/fileupload" %> <%= stylesheet_link_tag "lib/main-list" %> <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/bootstrap-fileupload" %> <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> <%= javascript_include_tag "lib/file-type" %> <%= javascript_include_tag "lib/module-area" %> <%= javascript_include_tag "form" %> <% end %>
<%= 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 :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 %>
<%= 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| %>
">
<%= f.fields_for :title_translations do |f| %> <%= f.text_area locale, class: "ckeditor_reduce input-block-level", placeholder: t('video_program.title'), value: (@video_program.title_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :subtitle_translations do |f| %> <%= f.text_area locale, rows: 2, class: "ckeditor input-block-level", value: (@video_program.subtitle_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :program_notes_translations do |f| %> <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@video_program.program_notes_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :actor_notes_translations do |f| %> <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@video_program.actor_notes_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :video_notes_translations do |f| %> <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@video_program.video_notes_translations[locale] rescue nil) %> <% end %>
<% end %>
<% if @video_program && !@video_program.video_program_links.blank? %>
<% @video_program.video_program_links.each_with_index do |video_program_link, i| %> <%= f.fields_for :video_program_links, video_program_link do |f| %> <%= render :partial => 'form_link', :object => video_program_link, :locals => {:f => f, :i => i} %> <% end %> <% end %>
<% end %>

<%= hidden_field_tag 'video_program_link_field_count', @video_program.video_program_links.count %> <%= t(:add) %>

<% 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) %>

<%= get_referer_url[:action] rescue "" %> <%= f.submit t('submit'), class: 'btn btn-primary' %> <%= button_tag t("preview"), id: "button_for_preview", name: "commit", class: 'btn', type: :button %> <%= link_to t('cancel'), admin_video_programs_path, :class=>"btn" %>
<% if !@module_app.tags.empty? %> <% end %>