<%= form_for template, html: {data: {turbo: false}} do |f| %>
  <% if template.errors.any? %>
    <div id="errorExplanation">
      <ul>
        <% template.errors.full_messages.each do |message| %>
          <li><%= h(message) %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <div class="box tabular">
    <p>
      <%= f.label :name, l(:label_ux_toolkit_template_name) %>
      <%= f.text_field :name, size: 60, maxlength: 255, required: true %>
    </p>
    <p>
      <%= f.label :enabled, l(:label_ux_toolkit_template_enabled) %>
      <%= f.check_box :enabled %>
    </p>
    <p>
      <%= f.label :position, l(:label_ux_toolkit_sort_order) %>
      <%= f.number_field :position, min: 0, step: 1, size: 6 %>
    </p>
    <p>
      <%= f.label :subject_template_mode, l(:label_ux_toolkit_ticket_template_subject_mode) %>
      <%= f.select :subject_template_mode,
                   [
                     [l(:label_ux_toolkit_ticket_template_subject_mode_prefix), 'prefix'],
                     [l(:label_ux_toolkit_ticket_template_subject_mode_default), 'default']
                   ] %>
    </p>
    <p>
      <%= f.label :subject_template, l(:label_ux_toolkit_ticket_template_subject_template) %>
      <%= f.text_field :subject_template, size: 80, maxlength: 255 %>
      <em class="info"><%= l(:text_ux_toolkit_ticket_template_subject_help) %></em>
    </p>
    <p>
      <%= f.label :description_template, l(:label_ux_toolkit_ticket_template_description_template) %>
      <%= f.text_area :description_template,
                      rows: 18,
                      cols: 100 %>
    </p>
  </div>

  <p>
    <%= f.submit template.new_record? ? l(:button_create) : l(:button_save) %>
    <%= link_to l(:button_cancel), ux_toolkit_ticket_templates_path %>
  </p>
<% end %>
