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

  <div class="box tabular">
    <p>
      <%= f.label :title, l(:label_ux_toolkit_text_snippet_title) %>
      <%= f.text_field :title, 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 :snippet_text, l(:label_ux_toolkit_text_snippet_text) %>
      <%= f.text_area :snippet_text,
                      rows: 12,
                      cols: 100,
                      required: true %>
    </p>
  </div>

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