{{ 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 Paper</h2>
  </div>

  <div class="mt-10 ">
  <div class="w-full grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4">
  {{ range .data.paper }}
    <form action="/paper/{{ .ID }}" method="POST">
      <div class="max-w-md mx-auto p-4 m-4 bg-gray-100 flex flex-wrap border rounded shadow-md">
        <div class="font-bold text-center mb-4">
          {{ .Brand }} - {{ .Name }}: {{ .Size }} {{ .Weight }}g/m2
        </div>
        <div class="grid grid-cols-2 gap-4">
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Name</label>
          <input type="text" id="name" name="name" value="{{ .Name }}" class="w-full border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Brand</label>
          <input type="text" id="brand" name="brand" value="{{ .Brand }}" class="w-full border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">DIN Size</label>
          <input type="text" id="size" name="size" value="{{ .Size }}" class="w-full border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Weight</label>
          <input type="text" id="weight" name="weight" value="{{ .Weight }}" class="w-full border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Price per Sheet</label>
          <input type="number" step="0.0001" min="0.0000" id="price" name="price" value="{{ .Price }}" class="w-full flex-grow border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
      </div>
        <div class="grid grid-cols-2 mt-4 flex flex-wrap gap-2 w-full">
          <button type="submit" name="action" value="update" class="bg-blue-500 hover:bg-blue-700 text-white text-sm/6 font-bold py-2 px-4 rounded">Update</button>
          <button type="submit" name="action" value="delete" class="bg-red-500 hover:bg-red-700 text-white text-sm/6 font-bold py-2 px-4 rounded">Delete</button>
      </div>
      </div>
    </form>
  {{ end }}
  </div>
    <form action="/paper" method="POST">
      <div class="max-w-md mx-auto p-4 flex flex-wrap border rounded shadow-md">
        <div class="font-bold text-center mb-4">
          Add new Paper
        </div>
        <div class="grid grid-cols-2 gap-4">
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Name</label>
          <input type="text" id="name" name="name" placeholder="name" class="w-full border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Brand</label>
          <input type="text" id="brand" name="brand" placeholder="brand" class="w-full border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">DIN Size</label>
          <input type="text" id="size" name="size" placeholder="size" class="w-full border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Weight</label>
          <input type="text" id="weight" name="weight" placeholder="Weight" class="w-full border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
        <div>
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Price per Sheet</label>
          <input type="number" step="0.0001" min="0.0000" id="price" name="price" placeholder="price per sheet"
          class="w-full flex-grow border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
        </div>
      </div>
        <div class="grid grid-cols-4 mt-4 flex flex-wrap gap-2 w-full">
            <button type="submit" class="bg-green-500 hover:bg-green-700 text-white text-sm/6 font-bold py-2 px-4 rounded">Add</button>
        </div>
      </div>
    </form>
  </div>
{{ template "footer.html" . }}
