<% is_current_template_for_marketing = f.object.for_marketing || params[:type] == 'marketing' is_current_template_partial = f.object.partial || params[:type] == 'partial' %> <% if @mail_template.errors.any? %>

<%= pluralize(@mail_template.errors.count, "error") %> prohibited this mail_template from being saved:

<% end %>
<%= f.label :name %>
<%= f.text_field :name, :class => "text" %>
<%= f.label :path, 'Template Path' %>
<%= f.text_field :path, :class => "text" %>
<% unless is_current_template_partial %>
<%= f.label :subject %>
<%= f.text_field :subject, :class => "text" %>
'>If you edit this subject here, the subject of current template with same locale will be changed.
<% end %>
<%= f.label :locale %>
<%= f.select :locale, I18n.available_locales.map(&:to_s) %>
<%= f.label :format, "Format" %>
<%= f.select :format, ['text', 'html'] %>
<%= render 'layout_selector', :f => f if params[:type] != 'partial' and f.object.partial != true %> <% if @mail_template.persisted? %>
<% if @mail_template.mail_template_files.present? %> <% @mail_template.mail_template_files.each do |file| %>

<%= link_to file.attributes["file"], file.url %> <%= link_to "[edit]", edit_mail_template_mail_template_file_path(@mail_template, file), :class => "fancybox iframe", :title => "Editing #{file.attributes["file"]}" %> <%= link_to "[delete]", mail_template_mail_template_file_path(@mail_template, file), :method => :delete, :confirm => 'Are you sure?', :remote => true %>
" />
<%= image_tag file.url if file.image? %>


<% end %> <% end %>

<%= link_to "New File", new_mail_template_mail_template_file_path(@mail_template), :class => "fancybox iframe", :title => "Upload A New File" %>

<% end %> <% if @mail_template.zip_file.present? %>

<%= link_to @mail_template.attributes["zip_file"], @mail_template.zip_file.url %>

If you want to do batch editing, we recommend you to download the original file then edit it on your local computer.
<% end %>
<%= f.label :body %>
<%= f.text_area :body, :class => "markitup w910", :rows => "10" %>
<%= f.hidden_field :for_marketing, :value => is_current_template_for_marketing %> <%= f.hidden_field :partial, :value => is_current_template_partial %>
<%= f.submit :class => "button" %>