{{ 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 Item</h2>

      <p class="mt-10 text-center text-sm/6 text-red-500">
      {{ .data.error }}
      </p>
      <p class="mt-10 text-center text-sm/6 text-green-500">
      {{ .data.success }}
      </p>


            <a href="/{{ .data.shopItem.Pdf }}" target="_blank">
      <img src="/{{ .data.shopItem.Image }}" alt="Product Image" class="aspect-4/5 mx-auto rounded-md bg-gray-200 object-cover group-hover:opacity-75 lg:aspect-auto lg:h-80">
            </a>


      <div class="grid grid-cols-6 gap-4 mb-4">
        <div class="col-span-3">
      {{ if .data.previousShopItem }}
        <form action="/shopitems/{{ .data.previousShopItem.ID }}/edit">
          <button type="submit" class="flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm/6 font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">Previous</button>
        </form>
      {{ end }}
          </div>
        <div class="col-span-3">
      {{ if .data.nextShopItem }}
        <form action="/shopitems/{{ .data.nextShopItem.ID }}/edit">
          <button type="submit" class="flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm/6
            font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2
            focus-visible:outline-offset-2 focus-visible:outline-indigo-600">Next</button>
        </form>
      {{ end }}

        </div>
          </div>

  </div>


  <div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
    <form class="space-y-6" action="#" method="POST" enctype="multipart/form-data">
      <div>
        <label for="name" class="block text-sm/6 font-medium text-gray-900">Name</label>
        <div class="mt-2">
          <input type="text" name="name" id="name" value="{{ .data.shopItem.Name }}" required class="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm/6">
        </div>
      </div>

      <div>
        <label for="abstract" class="block text-sm/6 font-medium text-gray-900">Abstract</label>
        <div class="mt-2">
          <input type="text" name="abstract" id="abstract" value="{{ .data.shopItem.Abstract }}" required class="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm/6">
        </div>
      </div>

      <div>
        <label for="description" class="block text-sm/6 font-medium text-gray-900">Description</label>
        <textarea id="description" name="description" type="textarea" class="block w-full px-4 py-2 mt-2 text-gray-900 bg-white border border-gray-300 rounded-md focus:border-blue-500 focus:outline-none focus:ring">{{ .data.shopItem.Description}}</textarea>
      </div>

      <label class="block text-sm/6 font-medium text-gray-900">
        Print Mode
      </label>
      <select name="print-mode" required class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg
        focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 ">
        <option selected value="{{ .data.shopItem.PrintMode }}">{{ .data.shopItem.PrintMode }}</option>
          <option value="CreateBooklet">CreateBooklet</option>
          <option value="LongEdge">Long Edge</option>
          <option value="ShortEdge">Short Edge</option>
          <option value="TriFold">Tri-Fold (Flyer)</option>
      </select>

      <label class="flex text-sm/6 items-center">
        <input type="checkbox" {{ if .data.shopItem.FitToPage }} checked {{ else }} {{ end }} class="form-checkbox h-4 w-4 text-gray-900"
        value="true" name="fit-to-page">
          <span class="ml-2 text-sm/6 text-gray-900">Fit to Page</span>
      </label>


      <div>
        <label for="custom-print-options" class="block text-sm/6 font-medium text-gray-900">Custom Print Options:</label>
        <textarea id="custom-print-options" name="custom-print-options" type="textarea" class="block w-full px-4 py-2
          mt-2 text-gray-900 bg-white border border-gray-300 rounded-md focus:border-blue-500 focus:outline-none
          focus:ring">{{ .data.shopItem.CustomPrintOptions}}</textarea>
      </div>


       <div class="mb-4">
           <label class="block text-sm/6 text-gray-900">Select Categories</label>
           <div class="space-y-2">
             {{ range .data.tags }}
               <label class="flex text-sm/6 items-center">
                 <input type="checkbox" {{ .Checked }} class="form-checkbox h-4 w-4 text-gray-900" value="{{ .ID }}" name="tags[]">
                   <span class="ml-2 text-sm/6 text-gray-900">{{ .Name }}</span>
               </label>
            {{ end }}
           </div>
       </div>

       <!--
         <div class="mb-4">
                <label for="tags" class="block text-gray-700">Select Tags</label>
                <select id="tags" name="tags" multiple class="mt-1 block w-full border border-gray-300 rounded-md p-2 focus:outline-none focus:ring focus:ring-blue-500">
                    <option value="tag1">Tag 1</option>
                    <option value="tag2">Tag 2</option>
                    <option value="tag3">Tag 3</option>
                    <option value="tag4">Tag 4</option>
                    <option value="tag5">Tag 5</option>
                </select>
                <p class="mt-1 text-gray-500 text-sm">Hold down the Ctrl (Windows) or Command (Mac) button to select multiple options.</p>
            </div>
       -->

      <div>
        <input type="hidden" name="category" value="Zine" required>
        <input type="hidden" id="variant-name1" name="variant-name[]" value="B/W" required>
        <div class="flex items-center justify-between">
          <label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Price B/W</label>
        </div>
        <div class="mt-2">
          <input type="number" value="{{ .data.priceBW }}" name="variant-value[]" id="variant-value1" step="0.01" min="0.00" required class="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm/6">
        </div>
      </div>


      <div>
        <input type="hidden" id="variant-name2" name="variant-name[]" value="Colored" required>
        <div class="flex items-center justify-between">
          <label for="variant-value2" class="block text-sm/6 font-medium text-gray-900">Price Colored</label>
        </div>
        <div class="mt-2">
          <input type="number" value="{{ .data.priceColored }}" name="variant-value[]" id="variant-value2" step="0.01" min="0.00" class="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm/6">
        </div>
      </div>


      <div>
        <label class="block text-sm font-medium text-gray-900">
          Image
        </label>
        <div class="mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md">
          <div class="space-y-1 text-center">
            <svg class="mx-auto h-12 w-12 text-gray-900" stroke="currentColor" fill="none" viewBox="0 0 48 48" aria-hidden="true">
              <path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
            </svg>
            <div class="flex text-sm text-gray-600">
              <label for="image-upload" class="relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500">
                <span class="">Upload a file</span>
                <input id="image-upload" name="image" type="file" accept="image/*" class="sr-only">
              </label>
              <p class="pl-1 text-gray-900">or drag and drop</p>
            </div>
            <p class="text-xs text-gray-900">
              PNG, JPG, GIF up to 10MB
            </p>
          </div>
        </div>
      </div>

      <div>
        <label class="block text-sm font-medium text-gray-900">
          PDF
        </label>
        <div class="mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md">
          <div class="space-y-1 text-center">
            <svg class="mx-auto h-12 w-12 text-gray-900" stroke="currentColor" fill="none" viewBox="0 0 48 48" aria-hidden="true">
              <path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
            </svg>
            <div class="flex text-sm text-gray-600">
              <label for="pdf-upload" class="relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500">
                <span class="">Upload a file</span>
                <input id="pdf-upload" name="pdf" type="file" accept="application/pdf" class="sr-only">
              </label>
              <p class="pl-1 text-gray-900">or drag and drop</p>
            </div>
            <p class="text-xs text-gray-900">
              PDF up to 50MB
            </p>
          </div>
        </div>
      </div>

      <div>
        <button type="submit" class="flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm/6 font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">Update Item</button>
      </div>
    </form>
  </div>
</div>


{{ template "footer.html" . }}
