Browse Source

Products image placeholder

Vova Tkach 5 years ago
parent
commit
25c8080202

+ 1 - 0
assets/assets.go

@@ -21,4 +21,5 @@ func PopulateResources(res *resource.Resource) {
 	res.Add(consts.AssetsSysLogoSvg, "image/svg+xml", SysLogoSvg)
 	res.Add(consts.AssetsSysStylesCss, "text/css", SysStylesCss)
 	res.Add(consts.AssetsCpScriptsJs, "application/javascript; charset=utf-8", CpScriptsJs)
+	res.Add(consts.AssetsSysPlaceholderPng, "image/png", SysPlaceholderPng)
 }

BIN
assets/placeholder.png


+ 3 - 0
assets/placeholder.png.go

@@ -0,0 +1,3 @@
+package assets
+
+var SysPlaceholderPng = []byte{137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 1, 0, 0, 0, 1, 8, 0, 0, 0, 0, 58, 126, 155, 85, 0, 0, 0, 10, 73, 68, 65, 84, 120, 156, 99, 106, 3, 0, 0, 140, 0, 137, 98, 131, 180, 9, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130}

+ 1 - 0
consts/consts.go

@@ -22,6 +22,7 @@ const AssetsSysFaveIco = AssetsPath + "/sys/fave.ico"
 const AssetsSysLogoPng = AssetsPath + "/sys/logo.png"
 const AssetsSysLogoSvg = AssetsPath + "/sys/logo.svg"
 const AssetsSysStylesCss = AssetsPath + "/sys/styles.css"
+const AssetsSysPlaceholderPng = AssetsPath + "/sys/placeholder.png"
 
 // Wysiwyg editor
 const AssetsCpWysiwygPellCss = AssetsPath + "/cp/wysiwyg/pell.css"

+ 2 - 2
engine/basket/session.go

@@ -145,7 +145,7 @@ func (this *session) updateProducts(db *sqlw.DB) {
 						// Load product image here
 						var product_image string
 						if img_filename == "" {
-							product_image = "/assets/some-placeholder.jpg"
+							product_image = "/assets/sys/placeholder.png"
 						} else {
 							product_image = "/products/images/" + img_product_id + "/thumb-0-" + img_filename
 						}
@@ -335,7 +335,7 @@ func (this *session) Plus(p *SBParam, product_id int) {
 		// Load product image here
 		var product_image string
 		if img_filename == "" {
-			product_image = "/assets/some-placeholder.jpg"
+			product_image = "/assets/sys/placeholder.png"
 		} else {
 			product_image = "/products/images/" + img_product_id + "/thumb-0-" + img_filename
 		}

+ 1 - 1
engine/fetdata/fetdata.go

@@ -210,5 +210,5 @@ func (this *FERData) ShopBasketProductsCount() int {
 }
 
 func (this *FERData) ImagePlaceholderHref() string {
-	return "/assets/some-placeholder.jpg"
+	return "/assets/sys/placeholder.png"
 }