<% if @promotion && (@promotion.errors.any? || @promotion.rules.any? { |r| r.errors.any? }) %> <% error_group = [@promotion.errors, @promotion.rules.map(&:errors)].flatten %>

<%= t(:errors_prohibited_this_record_from_being_saved, :count => error_group.count) %>:

<%= t(:there_were_problems_with_the_following_fields) %>:

<% end %>
<%= t(:general) %> <%= f.field_container :name do %> <%= f.label :name %>
<%= f.text_field :name %> <% end %> <%= f.field_container :event_name do %> <%= f.label :event_name %>
<%= f.select :event_name, Spree::Activator.event_names.map{|name| [t("events.#{name}"), name] } %> <% end %> <%= f.field_container :code do %> <%= f.label :code %>
<%= f.text_field :code %> <% end %> <%= f.field_container :path do %> <%= f.label :path %>
<%= f.text_field :path %> <% end %> <%= f.field_container :description do %> <%= f.label :description %>
<%= f.text_area :description, :style => 'height:50px;' %> <% end %> <%= f.field_container :advertise do %> <%= f.check_box :advertise %> <%= f.label :advertise %> <% end %>
<%= t(:expiry) %>

<%= f.label :usage_limit %>
<%= f.text_field :usage_limit %>

<%= f.label :starts_at %> <%= f.text_field :starts_at, :class => 'datepicker' %>

<%= f.label :expires_at %> <%= f.text_field :expires_at, :class => 'datepicker' %>