<%= form_with(model: [:operator, job], class: "contents") do |form| %>
  <% if job.errors.any? %>
    <div id="error_explanation" class="px-3 py-2 mt-3 font-medium text-red-500 border-l rounded-lg shadow-lg bg-red-50 border-red" >
      <h2><%= pluralize(job.errors.count, "error") %>
        prohibited this job from being saved:</h2>
      <ul>
        <% job.errors.each do |error| %>
          <li><%= error.full_message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
  <div class="my-5">
    <%= form.label :customer_firstname, 'Vorname' %>
    <%= form.text_field :customer_firstname, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
  </div>
  <div class="my-5">
    <%= form.label :customer_lastname, 'Nachname' %>
    <%= form.text_field :customer_lastname, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
  </div>
  <div class="my-5 inline">
    <%= form.check_box :intern, class: "pr-2 h-5 w-5" %>
    <%= form.label :intern, "Interne Umbuchung" %>
  </div>
  <div class="my-5">
    <%= form.label :cost_center, "Kostenstelle/Auftragsnummer" %>
    <%= form.text_field :cost_center, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
  </div>
  <% if edit_form? %>
    <div class="my-5">
      <%= form.label :number_of_plans_a0, "Anzahl A0 Pläne" %>
      <%= form.number_field :number_of_plans_a0, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
    </div>
    <div class="my-5">
      <%= form.label :number_of_plans_a1, "Anzahl A1 Pläne" %>
      <%= form.number_field :number_of_plans_a1, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
    </div>
    <div class="my-5">
      <%= form.label :number_of_plans_a2, "Anzahl A2 Pläne" %>
      <%= form.number_field :number_of_plans_a2, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
    </div>
    <div class="my-5">
      <%= form.label :number_of_plans_a3, "Anzahl A3 Pläne" %>
      <%= form.number_field :number_of_plans_a3, class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
    </div>
    <div class="my-5">
      <%= form.label :costum_qm_plan, "Quatratmeter noDin" %>
      <%= form.number_field :costum_qm_plan, in: 0..20.0, step: 0.01 ,class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
    </div>
  <% else %>
    <div>
      <%= form.label :pdf, "Plan auswählen (PDF-Format)" %>
      <%= form.file_field :pdf, accept: "application/pdf", class: "block shadow-lg rounded-md border border-hsrm-gray outline-none px-3 py-2 mt-2 w-full" %>
    </div>
  <% end %>
  <div class="inline">
    <%= form.submit edit_form? && "Speichern" || "Druckauftrag anlegen", class: "py-2 px-3 bg-hsrm-red hover:bg-hsrm-red-light shadow-lg text-white inline-block font-medium cursor-pointer" %>
  </div>
<% end %>
