add tested/not tested indicator on print view
All checks were successful
Go / build (push) Successful in 12m19s
All checks were successful
Go / build (push) Successful in 12m19s
This commit is contained in:
@@ -180,7 +180,19 @@ func (rc *printController) PrintHandler(c *gin.Context) {
|
|||||||
|
|
||||||
executeJobs := func() {
|
executeJobs := func() {
|
||||||
for _, printJob := range printJobs {
|
for _, printJob := range printJobs {
|
||||||
printJob.Execute()
|
printJob.ShopItem.WasPrinted = true
|
||||||
|
_, err = repositories.ShopItems.Update(printJob.ShopItem)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Error: %s\n", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err := printJob.Execute()
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ func (rc *shopItemController) NewShopItemFromForm(ctx *gin.Context) (models.Shop
|
|||||||
Pdf: dstPdf,
|
Pdf: dstPdf,
|
||||||
Variants: variants,
|
Variants: variants,
|
||||||
PrintMode: printMode,
|
PrintMode: printMode,
|
||||||
|
WasPrinted: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Creating Shopitem: ", shopItem)
|
fmt.Println("Creating Shopitem: ", shopItem)
|
||||||
@@ -400,6 +401,7 @@ func (rc *shopItemController) AddItemsHandler(c *gin.Context) {
|
|||||||
Pdf: dstPdf,
|
Pdf: dstPdf,
|
||||||
Variants: variants,
|
Variants: variants,
|
||||||
PrintMode: "CreateBooklet",
|
PrintMode: "CreateBooklet",
|
||||||
|
WasPrinted: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = repositories.ShopItems.Create(shopItem)
|
_, err = repositories.ShopItems.Create(shopItem)
|
||||||
@@ -537,6 +539,7 @@ func (rc *shopItemController) EditItemHandler(c *gin.Context) {
|
|||||||
newShopItem.Variants = shopItem.Variants
|
newShopItem.Variants = shopItem.Variants
|
||||||
newShopItem.BasePrice = shopItem.BasePrice
|
newShopItem.BasePrice = shopItem.BasePrice
|
||||||
newShopItem.IsPublic = shopItem.IsPublic
|
newShopItem.IsPublic = shopItem.IsPublic
|
||||||
|
newShopItem.WasPrinted = false
|
||||||
|
|
||||||
if len(shopItem.Tags) != 0 {
|
if len(shopItem.Tags) != 0 {
|
||||||
newShopItem.Tags = shopItem.Tags
|
newShopItem.Tags = shopItem.Tags
|
||||||
|
|||||||
@@ -53,4 +53,5 @@ type ShopItem struct {
|
|||||||
Image string
|
Image string
|
||||||
Pdf string
|
Pdf string
|
||||||
PrintMode string `json:"printMode" gorm:"default:CreateBooklet"`
|
PrintMode string `json:"printMode" gorm:"default:CreateBooklet"`
|
||||||
|
WasPrinted bool `gorm:"default:false"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -694,6 +694,10 @@ video {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inline-flex {
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
display: table;
|
display: table;
|
||||||
}
|
}
|
||||||
@@ -1288,6 +1292,16 @@ video {
|
|||||||
background-color: rgb(24 24 27 / var(--tw-bg-opacity, 1));
|
background-color: rgb(24 24 27 / var(--tw-bg-opacity, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-red-50 {
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-green-50 {
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(240 253 244 / var(--tw-bg-opacity, 1));
|
||||||
|
}
|
||||||
|
|
||||||
.fill-red-50 {
|
.fill-red-50 {
|
||||||
fill: #fef2f2;
|
fill: #fef2f2;
|
||||||
}
|
}
|
||||||
@@ -1406,6 +1420,11 @@ video {
|
|||||||
padding-right: 2rem;
|
padding-right: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.py-1 {
|
||||||
|
padding-top: 0.25rem;
|
||||||
|
padding-bottom: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
.pb-3 {
|
.pb-3 {
|
||||||
padding-bottom: 0.75rem;
|
padding-bottom: 0.75rem;
|
||||||
}
|
}
|
||||||
@@ -1810,6 +1829,16 @@ video {
|
|||||||
color: rgb(39 39 42 / var(--tw-text-opacity, 1));
|
color: rgb(39 39 42 / var(--tw-text-opacity, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-red-700 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(185 28 28 / var(--tw-text-opacity, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-green-700 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(21 128 61 / var(--tw-text-opacity, 1));
|
||||||
|
}
|
||||||
|
|
||||||
.antialiased {
|
.antialiased {
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
@@ -1849,6 +1878,24 @@ video {
|
|||||||
outline-color: #d1d5db;
|
outline-color: #d1d5db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ring-1 {
|
||||||
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
||||||
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
||||||
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ring-inset {
|
||||||
|
--tw-ring-inset: inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ring-red-600\/10 {
|
||||||
|
--tw-ring-color: rgb(220 38 38 / 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ring-green-600\/20 {
|
||||||
|
--tw-ring-color: rgb(22 163 74 / 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
.filter {
|
.filter {
|
||||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{{ template "header.html" . }}
|
{{ template "header.html" . }}
|
||||||
|
|
||||||
<section class="bg-white py-8 antialiased dark:bg-gray-900 md:py-16">
|
<section class="bg-white py-8 antialiased dark:bg-gray-900 md:py-16">
|
||||||
<div class="mx-auto max-w-3xl">
|
<div class="mx-auto max-w-4xl">
|
||||||
<div class="mt-6 sm:mt-8">
|
<div class="mt-6 sm:mt-8">
|
||||||
<div class="relative overflow-x-auto border-b border-gray-200 dark:border-gray-800">
|
<div class="relative overflow-x-auto border-b border-gray-200 dark:border-gray-800">
|
||||||
<h2 class="title font-manrope font-bold text-4xl leading-10 mb-8 text-center text-black">Zineshop Print
|
<h2 class="title font-manrope font-bold text-4xl leading-10 mb-8 text-center text-black">Zineshop Print
|
||||||
@@ -33,6 +33,12 @@
|
|||||||
<a href="/shopitems/{{ .ItemVariant.ShopItemID }}" class="flex items-center aspect-square w-8 h-10 shrink-0">
|
<a href="/shopitems/{{ .ItemVariant.ShopItemID }}" class="flex items-center aspect-square w-8 h-10 shrink-0">
|
||||||
<img class="h-auto w-full max-h-full dark:hidden" src="/{{ .ShopItem.Image }}" alt="imac image" />
|
<img class="h-auto w-full max-h-full dark:hidden" src="/{{ .ShopItem.Image }}" alt="imac image" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
{{ if .ShopItem.WasPrinted }}
|
||||||
|
<span class="inline-flex items-center rounded-md bg-green-50 px-2 py-1 text-xs font-medium text-green-700 ring-1 ring-green-600/20 ring-inset">Tested</span>
|
||||||
|
{{ else }}
|
||||||
|
<span class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-red-600/10 ring-inset">NOT TESTED</span>
|
||||||
|
{{ end }}
|
||||||
<a href="/shopitems/{{ .ItemVariant.ShopItemID }}" class="hover:underline">{{ .ShopItem.Name }} - {{ .ItemVariant.Name }}</a>
|
<a href="/shopitems/{{ .ItemVariant.ShopItemID }}" class="hover:underline">{{ .ShopItem.Name }} - {{ .ItemVariant.Name }}</a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user