{{ template "header.html" . }}


<div class="flex min-h-full flex-col justify-center px-6 py-12 lg:px-8">
  <div class="sm:mx-auto sm:w-full sm:max-w-sm">
    <img class="mx-auto h-10 w-auto" src="/static/img/logo-black.png" alt="Your Company">
    <h2 class="mt-10 text-center text-2xl/9 font-bold tracking-tight text-gray-900">Edit Orders</h2>
  </div>

  <div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
  {{ range .data.orders }}
    <form action="/order/{{ .Token }}/edit" method="POST">
      <div class="max-w-md mx-auto mt-4">
        <div class="flex">
          <input type="text" id="name" name="name" value="{{ .Token }}" readonly="readonly" class="flex-grow border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
          <div>
      <select name="order-status" required class="bg-gray-50 border ml-4 border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 ">
        <option selected value="{{ .Status }}">{{ .Status }}</option>
          <option value="AwaitingConfirmation">AwaitingConfirmation</option>
          <option value="Received">Received</option>
          <option value="AwaitingPayment">AwaitingPayment</option>
          <option value="Payed">Payed</option>
          <option value="ReadyForPickup">ReadyForPickup</option>
          <option value="Shipped">Shipped</option>
          <option value="Cancelled">Cancelled</option>
      </select>
          </div>
          <button type="submit" name="action" value="update" class="bg-blue-600 text-white ml-4 rounded px-4 hover:bg-blue-700">Update</button>
          <button type="button" class="bg-blue-600 text-white ml-4 mr-4 rounded px-4 hover:bg-blue-700"><a
              href="/order/{{ .Token }}/print">Print</a></button>
          <button type="button" class="bg-blue-600 text-white mr-4 rounded px-4 hover:bg-blue-700"><a
              href="/order/{{ .Token }}">View</a></button>
          <button type="submit" name="action" value="delete" class="bg-red-800 text-white rounded px-4 hover:bg-red-900">Delete</button>
        </div>
    </form>
  {{ end }}
  </div>
{{ template "footer.html" . }}
