From 5a7565663d2ef0e98c4ba0531d893e479e03cc24 Mon Sep 17 00:00:00 2001 From: kalipso Date: Thu, 10 Apr 2025 11:52:34 +0200 Subject: [PATCH] update --- models/shopItem.go | 37 ++++++++-------- static/output.css | 101 -------------------------------------------- views/shopitem.html | 10 ++--- 3 files changed, 24 insertions(+), 124 deletions(-) diff --git a/models/shopItem.go b/models/shopItem.go index 5303535..92047d6 100644 --- a/models/shopItem.go +++ b/models/shopItem.go @@ -7,13 +7,16 @@ import ( /* Sticker - - name, abstr, descr, price, tag + - name, abstr, descr, price, tag + Poster - - name, abstr, descr, price bw/colored, tag + - name, abstr, descr, price bw/colored, tag + Zines - - name, abstr, descr, price bw/colored/coloredcoveronly, tag + - name, abstr, descr, price bw/colored/coloredcoveronly, tag + Books - - name, abstr, descr, price, tag + - name, abstr, descr, price, tag */ type Category string @@ -31,22 +34,22 @@ func ParseCategory(s string) (c Category, err error) { type ItemVariant struct { gorm.Model - Name string `json:"name" gorm:"not null"` - Price float64 `json:"price" gorm:"not null"` - InStock bool `json:"inStock" gorm:"default:true"` + Name string `json:"name" gorm:"not null"` + Price float64 `json:"price" gorm:"not null"` + InStock bool `json:"inStock" gorm:"default:true"` ShopItemID uint } type ShopItem struct { gorm.Model - Name string `json:"name" binding:"required" gorm:"unique;not null"` - Abstract string `json:"Abstract" binding:"required"` - Description string `json:"description" binding:"required"` - Category Category `json:"category"` - Variants []ItemVariant `json:"variant"` - BasePrice float64 `json:"basePrice"` - IsPublic bool `json:"isPublic" gorm:"default:true"` - Tags []Tag `gorm:"many2many:item_tags;"` - Image string - Pdf string + Name string `json:"name" binding:"required" gorm:"unique;not null"` + Abstract string `json:"Abstract" binding:"required"` + Description string `json:"description" binding:"required"` + Category Category `json:"category"` + Variants []ItemVariant `json:"variant"` + BasePrice float64 `json:"basePrice"` + IsPublic bool `json:"isPublic" gorm:"default:true"` + Tags []Tag `gorm:"many2many:item_tags;"` + Image string + Pdf string } diff --git a/static/output.css b/static/output.css index 0187832..87db094 100644 --- a/static/output.css +++ b/static/output.css @@ -587,22 +587,6 @@ video { right: 0px; } -.-bottom-\[1\.75rem\] { - bottom: -1.75rem; -} - -.end-0 { - inset-inline-end: 0px; -} - -.left-1\/2 { - left: 50%; -} - -.start-0 { - inset-inline-start: 0px; -} - .col-span-12 { grid-column: span 12 / span 12; } @@ -630,11 +614,6 @@ video { margin-right: auto; } -.-mx-5 { - margin-left: -1.25rem; - margin-right: -1.25rem; -} - .mb-2 { margin-bottom: 0.5rem; } @@ -719,16 +698,6 @@ video { aspect-ratio: 1 / 1; } -.size-5 { - width: 1.25rem; - height: 1.25rem; -} - -.size-6 { - width: 1.5rem; - height: 1.5rem; -} - .h-10 { height: 2.5rem; } @@ -793,14 +762,6 @@ video { width: 100%; } -.w-1\/4 { - width: 25%; -} - -.w-2\/4 { - width: 50%; -} - .max-w-2xl { max-width: 42rem; } @@ -837,11 +798,6 @@ video { flex-grow: 1; } -.-translate-x-1\/2 { - --tw-translate-x: -50%; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .cursor-pointer { cursor: pointer; } @@ -854,10 +810,6 @@ video { grid-template-columns: repeat(12, minmax(0, 1fr)); } -.grid-cols-3 { - grid-template-columns: repeat(3, minmax(0, 1fr)); -} - .flex-col { flex-direction: column; } @@ -870,14 +822,6 @@ video { align-items: center; } -.justify-start { - justify-content: flex-start; -} - -.justify-end { - justify-content: flex-end; -} - .justify-center { justify-content: center; } @@ -894,10 +838,6 @@ video { gap: 1.25rem; } -.gap-2 { - gap: 0.5rem; -} - .gap-x-6 { -moz-column-gap: 1.5rem; column-gap: 1.5rem; @@ -1084,11 +1024,6 @@ video { background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1)); } -.bg-gray-600 { - --tw-bg-opacity: 1; - background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1)); -} - .fill-red-50 { fill: #fef2f2; } @@ -1366,11 +1301,6 @@ video { color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } -.text-blue-600 { - --tw-text-opacity: 1; - color: rgb(37 99 235 / var(--tw-text-opacity, 1)); -} - .underline { text-decoration-line: underline; } @@ -1427,37 +1357,6 @@ video { color: rgb(156 163 175 / var(--tw-text-opacity, 1)); } -.after\:mt-4::after { - content: var(--tw-content); - margin-top: 1rem; -} - -.after\:block::after { - content: var(--tw-content); - display: block; -} - -.after\:h-1::after { - content: var(--tw-content); - height: 0.25rem; -} - -.after\:w-full::after { - content: var(--tw-content); - width: 100%; -} - -.after\:rounded-lg::after { - content: var(--tw-content); - border-radius: 0.5rem; -} - -.after\:bg-gray-200::after { - content: var(--tw-content); - --tw-bg-opacity: 1; - background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1)); -} - .focus-within\:outline-none:focus-within { outline: 2px solid transparent; outline-offset: 2px; diff --git a/views/shopitem.html b/views/shopitem.html index ed7148d..fe9def4 100644 --- a/views/shopitem.html +++ b/views/shopitem.html @@ -9,23 +9,21 @@ Product Image
-
- +
- +
- {{ if .loggedIn }}
- +
{{ end }}