<%= select_category(f, @module_app) %>
<%= t("video_pro.choose_type") %>
<%=
select_tag "video_image[exchange_item]", options_for_select(@item,@item_choose)
%>
<% if @video_image.file.file %>
<%= image_tag @video_image.file.url %>
<% else %>

<% end %>
<%= t(:select_image) %>
<%= t(:change) %>
<%= f.file_field :file, accept: "image/*" %>
<%= t(:cancel) %>
<%= render partial: "jplayer",locals:{i: 1,file_name: f.object["video_file"],file_url: f.object.video_file.url,file_webm_url: (f.object.video_file_webm.url rescue nil),not_ready: true } %>
<%= t("video_pro.select_video") %>
<%= t(:change) %>
<%= f.file_field :video_file, accept: "video/mp4,video/x-m4v,video/ogg,video/webm" %>
<%= t(:cancel) %>
<% if @video_image.video_snapshot.file %>
<%= image_tag @video_image.video_snapshot.url %>
<% else %>

<% end %>
<%= t(:select_image) %>
<%= t(:change) %>
<%= f.file_field :video_snapshot, accept: "image/*" %>
<%= t(:cancel) %>
<%
current_user_id = current_user.id.to_s
if @video_image.update_user_id.blank?
update_user_id = current_user_id
else
update_user_id = @video_image.update_user_id
end
post_agency_text = ""
if @video_pro_setting
if update_user_id == current_user_id
post_agency_text = @video_pro_setting.get_user_name(update_user_id)
else
post_agency_text = "#{@video_pro_setting.get_user_name(update_user_id)} -> #{@video_pro_setting.get_user_name(current_user_id)}"
end
else
if update_user_id == current_user_id
post_agency_text = VideoProSetting.get_user_name(update_user_id)
else
post_agency_text = "#{VideoProSetting.get_user_name(update_user_id)} -> #{VideoProSetting.get_user_name(current_user_id)}"
end
end
%>
<%= select_tag "#{f.object_name}[use_override_post_agency]", options_for_select([[t("video_pro.the_same_as_publisher"), "0"], [t("video_pro.other"), "1"]], f.object.use_override_post_agency ? "1" : "0"), id: 'use_override_post_agency' %>
<%= post_agency_text %>
<%= f.select("override_post_agency", (options_for_select(VideoProSetting.first.post_agencies.to_a.map.with_index{|agency,i| [agency, i] },:selected => f.object.override_post_agency) rescue [])) %>
<%= f.datetime_picker :postdate, :no_label => true, :picker_type=>'date', :format=>'yyyy/MM/dd' %>
<%= f.datetime_picker :deadline, :no_label => true, :picker_type=>'date', :format=>'yyyy/MM/dd', :new_record => @video_image.new_record? %>
<% @site_in_use_locales.each do |locale| %>
<% end %>
<%= select_tags(f, @module_app) %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", value: (@video_image.title_translations[locale] rescue nil), placeholder: "#{t(locale.to_s)+t("title")}" %>
<% end %>
<%= f.fields_for :desc_translations do |f| %>
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@video_image.desc_translations[locale] rescue nil) %>
<% end %>
<%= f.fields_for :keyword_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", value: (@video_image.keyword_translations[locale] rescue nil) %>
<% end %>
<% end %>