<%= form_for @banner, :url => path, :builder => TbCore::FormBuilder, :html => {:class => 'admin-banner-form', :target => 'admin-banner-upload-target'} do |f| %> <%= tb_form_errors(f.object) %>
<%= f.label :banner, 'Banner', :class => 'control-label' %>
<%= f.file_field :banner %>
<% if @banner.owner.has_rich_text? %>
<%= f.label :rich_text, 'Rich Text', :class => 'control-label' %>
<%= f.text_area :rich_text, :id => 'admin-banner-rich-text', :class => 'admin-banner-rich-text' %>
<% else %>
<%= f.label :link_to, 'Link to', :class => 'control-label' %>
<%= f.text_field :link_to %>
<%= f.label :link_target, 'Open Link in', :class => 'control-label' %>
<%= f.select :link_target, options_for_select([ ['Same Window', '_self'], ['New Window', '_blank'] ], @banner.link_target) %>
<%= f.label :title, 'Image Title', :class => 'control-label' %>
<%= f.text_field :title %>
<%= f.label :alt, 'Alt Text', :class => 'control-label' %>
<%= f.text_field :alt %>
<% end %>
<%= f.label :start_date, 'Start Date', :class => 'control-label' %>
<%= f.date_select :start_date, :start_year => Date.today.year %>
<%= f.label :end_date, 'End Date', :class => 'control-label' %>
<%= f.date_select :end_date, :include_blank => true, :start_year => Date.today.year %> Leave blank to never expire
<% end %>