<% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/fileupload" %> <% 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/module-area" %> <% end %> <%= f.error_messages %>
<%= f.select :ad_banner_id, @ad_banners.collect{|t| [ t.title, t.id ]} %>
<%= f.datetime_picker :postdate, :no_label => true %>
<%= f.datetime_picker :deadline, :no_label => true %>
<% @tags.each do |tag| %> <% end %>
<%= f.select :link_open, AdImage::LINK_OPEN_TYPES.map{|a| [t("ad_banner.#{a}"), a]} %>
<%= f.number_field :weight, placeholder: t(:frequency), in: 1..99, maxlength: 2, onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;" %> <%= t('ad_banner.enter_number') %>
<% if @ad_image.file.file %> <%= image_tag @ad_image.file %> <% else %> <% end %>
<%= t(:select_image) %> <%= t(:change) %> <%= f.file_field :file %> <%= t(:cancel) %>
<% @site_valid_locales.each_with_index do |locale, i| %>
">
<%= f.fields_for :title_translations do |f| %> <%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@ad_image.title_translations[locale] rescue nil) %> <% end %>
<%= f.fields_for :context_translations do |f| %> <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@ad_image.context_translations[locale] rescue nil) %> <% end %>
<% end %>
<%= f.submit t('submit'), class: 'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>