fix paperview
All checks were successful
Go / build (push) Successful in 12m14s

This commit is contained in:
2025-06-29 15:37:10 +02:00
parent 6330a990f5
commit 17a1ef0123
2 changed files with 175 additions and 18 deletions

View File

@@ -7,31 +7,76 @@
<h2 class="mt-10 text-center text-2xl/9 font-bold tracking-tight text-gray-900">Edit Paper</h2>
</div>
<div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
<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 mt-4">
<div class="flex">
<input type="text" id="name" name="name" value="{{ .Name }}" class="flex-grow border border-gray-300 rounded-l-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
<input type="text" id="brand" name="brand" value="{{ .Brand }}" class="flex-grow border border-gray-300 rounded-l-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
<input type="text" id="size" name="size" value="{{ .Size }}" class="flex-grow border border-gray-300 rounded-l-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
<input type="number" step="0.01" min="0.00" id="price" name="price" value="{{ .Price }}" class="flex-grow border border-gray-300 rounded-l-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
<button type="submit" name="action" value="update" class="bg-blue-600 text-white ml-4 mr-4 rounded px-4 hover:bg-blue-700">Update</button>
<button type="submit" name="action" value="delete" class="bg-red-800 text-white rounded px-4 hover:bg-red-900">Delete</button>
<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 mt-4">
<div class="flex">
<input type="text" id="name" name="name" placeholder="name" class="flex-grow border border-gray-300 rounded-l-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
<input type="text" id="brand" name="brand" placeholder="brand" class="flex-grow border border-gray-300 rounded-l-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
<input type="text" id="size" name="size" placeholder="size" class="flex-grow border border-gray-300 rounded-l-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
<input type="number" step="0.01" min="0.00" id="price" name="price" placeholder="price per sheet" class="flex-grow border border-gray-300 rounded-l-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
<button type="submit" class="bg-green-600 text-white ml-4 mr-4 rounded px-4 hover:bg-green-700">Add</button>
<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>
<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" . }}