Browse Source

View product button instead add to basket, shop basket, first product image, basket optimization, engine version for assets instead counter

Vova Tkach 5 years ago
parent
commit
cea8620d88

+ 2 - 2
assets/template/footer_html_file.go

@@ -13,7 +13,7 @@ var VarFooterHtmlFile = []byte(`						</div>
 		<footer class="bg-light py-4">
 			<div class="container">
 				<p class="m-0 text-center text-black">
-					Copyright © Your Website {{if eq ($.Data.DateTimeFormat "2006") "2019"}}
+					Your Website © {{if eq ($.Data.DateTimeFormat "2006") "2019"}}
 						{{$.Data.DateTimeFormat "2006"}}
 					{{else}}
 						2019-{{$.Data.DateTimeFormat "2006"}}
@@ -29,6 +29,6 @@ var VarFooterHtmlFile = []byte(`						</div>
 		<script src="{{$.System.PathJsLightGallery}}"></script>
 
 		<!-- Template JavaScript file from template folder -->
-		<script src="{{$.System.PathThemeScripts}}?v=3"></script>
+		<script src="{{$.System.PathThemeScripts}}"></script>
 	</body>
 </html>`)

+ 1 - 1
assets/template/header_html_file.go

@@ -18,7 +18,7 @@ var VarHeaderHtmlFile = []byte(`<!doctype html>
 		<link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" />
 
 		<!-- Template CSS file from template folder -->
-		<link rel="stylesheet" href="{{$.System.PathThemeStyles}}?v=3">
+		<link rel="stylesheet" href="{{$.System.PathThemeStyles}}">
 	</head>
 	<body id="body" class="fixed-top-bar">
 		<div id="sys-modal-shop-basket-placeholder"></div>

+ 1 - 1
assets/template/shop_category_html_file.go

@@ -28,7 +28,7 @@ var VarShopCategoryHtmlFile = []byte(`{{template "header.html" .}}
 						<div class="card-text">{{.Briefly}}</div>
 					</div>
 					<div class="card-footer">
-						<span class="price">{{.PriceFormat "%.2f"}} {{$.Data.Shop.CurrentCurrency.Code}}</span><a href="{{.Permalink}}" class="btn btn-success" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{.Id}});return false;">Buy</a>
+						<span class="price">{{.PriceFormat "%.2f"}} {{$.Data.Shop.CurrentCurrency.Code}}</span><a href="{{.Permalink}}" class="btn btn-success">View</a>
 					</div>
 				</div>
 			{{end}}

+ 1 - 1
assets/template/shop_html_file.go

@@ -28,7 +28,7 @@ var VarShopHtmlFile = []byte(`{{template "header.html" .}}
 						<div class="card-text">{{.Briefly}}</div>
 					</div>
 					<div class="card-footer">
-						<span class="price">{{.PriceFormat "%.2f"}} {{$.Data.Shop.CurrentCurrency.Code}}</span><a href="{{.Permalink}}" class="btn btn-success" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{.Id}});return false;">Buy</a>
+						<span class="price">{{.PriceFormat "%.2f"}} {{$.Data.Shop.CurrentCurrency.Code}}</span><a href="{{.Permalink}}" class="btn btn-success">View</a>
 					</div>
 				</div>
 			{{end}}

+ 0 - 1
consts/consts.go

@@ -5,7 +5,6 @@ import (
 )
 
 const AssetsPath = "assets"
-const AssetsVersion = "54"
 const DirIndexFile = "index.html"
 
 // Bootstrap resources

+ 40 - 34
engine/basket/basket.go

@@ -7,6 +7,13 @@ import (
 	"golang-fave/engine/sqlw"
 )
 
+type SBParam struct {
+	R         *http.Request
+	DB        *sqlw.DB
+	Host      string
+	SessionId string
+}
+
 type Basket struct {
 	sync.RWMutex
 	hosts map[string]*onehost
@@ -18,19 +25,18 @@ func New() *Basket {
 	return &b
 }
 
-func (this *Basket) Info(r *http.Request, host, session_id string, db *sqlw.DB, currency_id int) string {
-	if host == "" || session_id == "" {
+func (this *Basket) Info(p *SBParam) string {
+	if p.Host == "" || p.SessionId == "" {
 		return (&dResponse{IsError: true, Msg: "basket_host_or_session_not_set", Message: ""}).String()
 	}
 
-	// Load currency here
-
 	this.Lock()
 	defer this.Unlock()
-	if h, ok := this.hosts[host]; ok == true {
-		if s, ok := h.sessions[session_id]; ok == true {
-			s.Preload(r, db)
-			return s.String(db)
+
+	if h, ok := this.hosts[p.Host]; ok == true {
+		if s, ok := h.sessions[p.SessionId]; ok == true {
+			s.Preload(p.R, p.DB)
+			return s.String(p.DB)
 		} else {
 			return (&dResponse{IsError: false, Msg: "basket_is_empty", Message: ""}).String()
 		}
@@ -39,77 +45,77 @@ func (this *Basket) Info(r *http.Request, host, session_id string, db *sqlw.DB,
 	}
 }
 
-func (this *Basket) Plus(r *http.Request, host, session_id string, db *sqlw.DB, product_id int) string {
-	if host == "" || session_id == "" {
+func (this *Basket) Plus(p *SBParam, product_id int) string {
+	if p.Host == "" || p.SessionId == "" {
 		return (&dResponse{IsError: true, Msg: "basket_host_or_session_not_set", Message: ""}).String()
 	}
 
 	this.Lock()
 	defer this.Unlock()
 
-	if h, ok := this.hosts[host]; ok == true {
-		if s, ok := h.sessions[session_id]; ok == true {
-			s.Preload(r, db)
-			s.Plus(db, product_id)
+	if h, ok := this.hosts[p.Host]; ok == true {
+		if s, ok := h.sessions[p.SessionId]; ok == true {
+			s.Preload(p.R, p.DB)
+			s.Plus(p.DB, product_id)
 		}
 	} else {
 		s := &session{}
 		s.listCurrencies = map[int]*currency{}
 		s.Products = map[int]*product{}
-		s.Preload(r, db)
-		s.Plus(db, product_id)
+		s.Preload(p.R, p.DB)
+		s.Plus(p.DB, product_id)
 		h := &onehost{}
 		h.sessions = map[string]*session{}
-		h.sessions[session_id] = s
-		this.hosts[host] = h
+		h.sessions[p.SessionId] = s
+		this.hosts[p.Host] = h
 	}
 
 	return (&dResponse{IsError: false, Msg: "basket_product_plus", Message: ""}).String()
 }
 
-func (this *Basket) Minus(r *http.Request, host, session_id string, db *sqlw.DB, product_id int) string {
-	if host == "" || session_id == "" {
+func (this *Basket) Minus(p *SBParam, product_id int) string {
+	if p.Host == "" || p.SessionId == "" {
 		return (&dResponse{IsError: true, Msg: "basket_host_or_session_not_set", Message: ""}).String()
 	}
 
 	this.Lock()
 	defer this.Unlock()
 
-	if h, ok := this.hosts[host]; ok == true {
-		if s, ok := h.sessions[session_id]; ok == true {
-			s.Preload(r, db)
-			s.Minus(db, product_id)
+	if h, ok := this.hosts[p.Host]; ok == true {
+		if s, ok := h.sessions[p.SessionId]; ok == true {
+			s.Preload(p.R, p.DB)
+			s.Minus(p.DB, product_id)
 		}
 	}
 
 	return (&dResponse{IsError: false, Msg: "basket_product_minus", Message: ""}).String()
 }
 
-func (this *Basket) Remove(r *http.Request, host, session_id string, db *sqlw.DB, product_id int) string {
-	if host == "" || session_id == "" {
+func (this *Basket) Remove(p *SBParam, product_id int) string {
+	if p.Host == "" || p.SessionId == "" {
 		return (&dResponse{IsError: true, Msg: "basket_host_or_session_not_set", Message: ""}).String()
 	}
 
 	this.Lock()
 	defer this.Unlock()
 
-	if h, ok := this.hosts[host]; ok == true {
-		if s, ok := h.sessions[session_id]; ok == true {
-			s.Preload(r, db)
-			s.Remove(db, product_id)
+	if h, ok := this.hosts[p.Host]; ok == true {
+		if s, ok := h.sessions[p.SessionId]; ok == true {
+			s.Preload(p.R, p.DB)
+			s.Remove(p.DB, product_id)
 		}
 	}
 
 	return (&dResponse{IsError: false, Msg: "basket_product_remove", Message: ""}).String()
 }
 
-func (this *Basket) ProductsCount(r *http.Request, host, session_id string) int {
-	if host != "" && session_id != "" {
+func (this *Basket) ProductsCount(p *SBParam) int {
+	if p.Host != "" && p.SessionId != "" {
 		this.Lock()
 		defer this.Unlock()
 
-		if h, ok := this.hosts[host]; ok == true {
-			if s, ok := h.sessions[session_id]; ok == true {
+		if h, ok := this.hosts[p.Host]; ok == true {
+			if s, ok := h.sessions[p.SessionId]; ok == true {
 				return s.ProductsCount()
 			}
 		}

+ 104 - 5
engine/basket/session.go

@@ -54,19 +54,59 @@ func (this *session) updateProducts(db *sqlw.DB) {
 				shop_currencies.name,
 				shop_currencies.coefficient,
 				shop_currencies.code,
-				shop_currencies.symbol
+				shop_currencies.symbol,
+				IF(image_this.filename IS NULL, shop_products.parent_id, shop_products.id) as imgid,
+				IFNULL(IFNULL(image_this.filename, image_parent.filename), '') as filename
 			FROM
 				shop_products
 				LEFT JOIN shop_currencies ON shop_currencies.id = shop_products.currency
+				LEFT JOIN (
+					SELECT
+						m.product_id,
+						m.filename
+					FROM
+						shop_product_images as m
+						LEFT JOIN (
+							SELECT
+								t.product_id,
+								MIN(t.ord) as ordmin
+							FROM
+								shop_product_images as t
+							GROUP BY
+								t.product_id
+						) as u ON u.product_id = m.product_id AND u.ordmin = m.ord
+					WHERE
+						u.product_id IS NOT NULL
+				) as image_this ON image_this.product_id = shop_products.id
+				LEFT JOIN (
+					SELECT
+						m.product_id,
+						m.filename
+					FROM
+						shop_product_images as m
+						LEFT JOIN (
+							SELECT
+								t.product_id,
+								MIN(t.ord) as ordmin
+							FROM
+								shop_product_images as t
+							GROUP BY
+								t.product_id
+						) as u ON u.product_id = m.product_id AND u.ordmin = m.ord
+					WHERE
+						u.product_id IS NOT NULL
+				) as image_parent ON image_parent.product_id = shop_products.parent_id
 			WHERE
 				shop_products.active = 1 AND
 				shop_products.id IN (` + strings.Join(utils.ArrayOfIntToArrayOfString(products_ids), ",") + `)
-			LIMIT 1;`,
+			;`,
 		); err == nil {
 			defer rows.Close()
 			for rows.Next() {
 				row := &utils.MySql_shop_product{}
 				roc := &utils.MySql_shop_currency{}
+				var img_product_id string
+				var img_filename string
 				if err = rows.Scan(
 					&row.A_id,
 					&row.A_name,
@@ -77,10 +117,20 @@ func (this *session) updateProducts(db *sqlw.DB) {
 					&roc.A_coefficient,
 					&roc.A_code,
 					&roc.A_symbol,
+					&img_product_id,
+					&img_filename,
 				); err == nil {
 					if p, ok := this.Products[row.A_id]; ok == true {
+						// Load product image here
+						var product_image string
+						if img_filename == "" {
+							// TODO: Placeholder
+							product_image = ""
+						} else {
+							product_image = "/products/images/" + img_product_id + "/thumb-0-" + img_filename
+						}
 						p.Name = html.EscapeString(row.A_name)
-						p.Image = "/products/images/1/thumb-0-1570673803.jpg"
+						p.Image = product_image
 						p.Link = "/shop/" + row.A_alias + "/"
 						p.price = row.A_price
 						p.currency.Id = roc.A_id
@@ -191,6 +241,8 @@ func (this *session) Plus(db *sqlw.DB, product_id int) {
 	}
 	row := &utils.MySql_shop_product{}
 	roc := &utils.MySql_shop_currency{}
+	var img_product_id string
+	var img_filename string
 	if err := db.QueryRow(`
 		SELECT
 			shop_products.id,
@@ -201,10 +253,48 @@ func (this *session) Plus(db *sqlw.DB, product_id int) {
 			shop_currencies.name,
 			shop_currencies.coefficient,
 			shop_currencies.code,
-			shop_currencies.symbol
+			shop_currencies.symbol,
+			IF(image_this.filename IS NULL, shop_products.parent_id, shop_products.id) as imgid,
+			IFNULL(IFNULL(image_this.filename, image_parent.filename), '') as filename
 		FROM
 			shop_products
 			LEFT JOIN shop_currencies ON shop_currencies.id = shop_products.currency
+			LEFT JOIN (
+				SELECT
+					m.product_id,
+					m.filename
+				FROM
+					shop_product_images as m
+					LEFT JOIN (
+						SELECT
+							t.product_id,
+							MIN(t.ord) as ordmin
+						FROM
+							shop_product_images as t
+						GROUP BY
+							t.product_id
+					) as u ON u.product_id = m.product_id AND u.ordmin = m.ord
+				WHERE
+					u.product_id IS NOT NULL
+			) as image_this ON image_this.product_id = shop_products.id
+			LEFT JOIN (
+				SELECT
+					m.product_id,
+					m.filename
+				FROM
+					shop_product_images as m
+					LEFT JOIN (
+						SELECT
+							t.product_id,
+							MIN(t.ord) as ordmin
+						FROM
+							shop_product_images as t
+						GROUP BY
+							t.product_id
+					) as u ON u.product_id = m.product_id AND u.ordmin = m.ord
+				WHERE
+					u.product_id IS NOT NULL
+			) as image_parent ON image_parent.product_id = shop_products.parent_id
 		WHERE
 			shop_products.active = 1 AND
 			shop_products.id = ?
@@ -220,14 +310,23 @@ func (this *session) Plus(db *sqlw.DB, product_id int) {
 		&roc.A_coefficient,
 		&roc.A_code,
 		&roc.A_symbol,
+		&img_product_id,
+		&img_filename,
 	); err == nil {
 		// Load product image here
+		var product_image string
+		if img_filename == "" {
+			// TODO: Placeholder
+			product_image = ""
+		} else {
+			product_image = "/products/images/" + img_product_id + "/thumb-0-" + img_filename
+		}
 		this.Products[product_id] = &product{
 			currency: &currency{Id: roc.A_id, Name: roc.A_name, Coefficient: roc.A_coefficient, Code: roc.A_code, Symbol: roc.A_symbol},
 
 			Id:       row.A_id,
 			Name:     html.EscapeString(row.A_name),
-			Image:    "/products/images/1/thumb-0-1570673803.jpg",
+			Image:    product_image,
 			Link:     "/shop/" + row.A_alias + "/",
 			price:    row.A_price,
 			Quantity: 1,

+ 7 - 1
engine/fetdata/fetdata.go

@@ -8,6 +8,7 @@ import (
 	"time"
 
 	"golang-fave/consts"
+	"golang-fave/engine/basket"
 	"golang-fave/engine/wrapper"
 	"golang-fave/utils"
 )
@@ -199,5 +200,10 @@ func (this *FERData) CachedBlock5() template.HTML {
 }
 
 func (this *FERData) ShopBasketProductsCount() int {
-	return this.wrap.ShopBasket.ProductsCount(this.wrap.R, this.wrap.CurrHost, this.wrap.GetSessionId())
+	return this.wrap.ShopBasket.ProductsCount(&basket.SBParam{
+		R:         this.wrap.R,
+		DB:        this.wrap.DB,
+		Host:      this.wrap.CurrHost,
+		SessionId: this.wrap.GetSessionId(),
+	})
 }

+ 2 - 2
hosts/localhost/template/footer.html

@@ -11,7 +11,7 @@
 		<footer class="bg-light py-4">
 			<div class="container">
 				<p class="m-0 text-center text-black">
-					Copyright © Your Website {{if eq ($.Data.DateTimeFormat "2006") "2019"}}
+					Your Website © {{if eq ($.Data.DateTimeFormat "2006") "2019"}}
 						{{$.Data.DateTimeFormat "2006"}}
 					{{else}}
 						2019-{{$.Data.DateTimeFormat "2006"}}
@@ -27,6 +27,6 @@
 		<script src="{{$.System.PathJsLightGallery}}"></script>
 
 		<!-- Template JavaScript file from template folder -->
-		<script src="{{$.System.PathThemeScripts}}?v=3"></script>
+		<script src="{{$.System.PathThemeScripts}}"></script>
 	</body>
 </html>

+ 1 - 1
hosts/localhost/template/header.html

@@ -16,7 +16,7 @@
 		<link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" />
 
 		<!-- Template CSS file from template folder -->
-		<link rel="stylesheet" href="{{$.System.PathThemeStyles}}?v=3">
+		<link rel="stylesheet" href="{{$.System.PathThemeStyles}}">
 	</head>
 	<body id="body" class="fixed-top-bar">
 		<div id="sys-modal-shop-basket-placeholder"></div>

+ 1 - 1
hosts/localhost/template/shop-category.html

@@ -26,7 +26,7 @@
 						<div class="card-text">{{.Briefly}}</div>
 					</div>
 					<div class="card-footer">
-						<span class="price">{{.PriceFormat "%.2f"}} {{$.Data.Shop.CurrentCurrency.Code}}</span><a href="{{.Permalink}}" class="btn btn-success" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{.Id}});return false;">Buy</a>
+						<span class="price">{{.PriceFormat "%.2f"}} {{$.Data.Shop.CurrentCurrency.Code}}</span><a href="{{.Permalink}}" class="btn btn-success">View</a>
 					</div>
 				</div>
 			{{end}}

+ 1 - 1
hosts/localhost/template/shop.html

@@ -26,7 +26,7 @@
 						<div class="card-text">{{.Briefly}}</div>
 					</div>
 					<div class="card-footer">
-						<span class="price">{{.PriceFormat "%.2f"}} {{$.Data.Shop.CurrentCurrency.Code}}</span><a href="{{.Permalink}}" class="btn btn-success" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{.Id}});return false;">Buy</a>
+						<span class="price">{{.PriceFormat "%.2f"}} {{$.Data.Shop.CurrentCurrency.Code}}</span><a href="{{.Permalink}}" class="btn btn-success">View</a>
 					</div>
 				</div>
 			{{end}}

+ 11 - 4
modules/module_shop.go

@@ -8,6 +8,7 @@ import (
 
 	"golang-fave/assets"
 	"golang-fave/consts"
+	"golang-fave/engine/basket"
 	"golang-fave/engine/builder"
 	"golang-fave/engine/fetdata"
 	"golang-fave/engine/sqlw"
@@ -446,29 +447,35 @@ func (this *Modules) RegisterModule_Shop() *Module {
 			wrap.RenderFrontEnd("shop-category", fetdata.New(wrap, false, row, rou), http.StatusOK)
 			return
 		} else if len(wrap.UrlArgs) >= 3 && wrap.UrlArgs[0] == "shop" && wrap.UrlArgs[1] == "basket" && (wrap.UrlArgs[2] == "info" || wrap.UrlArgs[2] == "plus" || wrap.UrlArgs[2] == "minus" || wrap.UrlArgs[2] == "remove" || wrap.UrlArgs[2] == "currency") {
+			SBParam := basket.SBParam{
+				R:         wrap.R,
+				DB:        wrap.DB,
+				Host:      wrap.CurrHost,
+				SessionId: wrap.GetSessionId(),
+			}
 			if wrap.UrlArgs[2] == "info" {
 				wrap.W.WriteHeader(http.StatusOK)
 				wrap.W.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
 				wrap.W.Header().Set("Content-Type", "application/json; charset=utf-8")
-				wrap.W.Write([]byte(wrap.ShopBasket.Info(wrap.R, wrap.CurrHost, wrap.GetSessionId(), wrap.DB, 1)))
+				wrap.W.Write([]byte(wrap.ShopBasket.Info(&SBParam)))
 				return
 			} else if wrap.UrlArgs[2] == "plus" && len(wrap.UrlArgs) == 4 && utils.IsNumeric(wrap.UrlArgs[3]) {
 				wrap.W.WriteHeader(http.StatusOK)
 				wrap.W.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
 				wrap.W.Header().Set("Content-Type", "application/json; charset=utf-8")
-				wrap.W.Write([]byte(wrap.ShopBasket.Plus(wrap.R, wrap.CurrHost, wrap.GetSessionId(), wrap.DB, utils.StrToInt(wrap.UrlArgs[3]))))
+				wrap.W.Write([]byte(wrap.ShopBasket.Plus(&SBParam, utils.StrToInt(wrap.UrlArgs[3]))))
 				return
 			} else if wrap.UrlArgs[2] == "minus" && len(wrap.UrlArgs) == 4 && utils.IsNumeric(wrap.UrlArgs[3]) {
 				wrap.W.WriteHeader(http.StatusOK)
 				wrap.W.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
 				wrap.W.Header().Set("Content-Type", "application/json; charset=utf-8")
-				wrap.W.Write([]byte(wrap.ShopBasket.Minus(wrap.R, wrap.CurrHost, wrap.GetSessionId(), wrap.DB, utils.StrToInt(wrap.UrlArgs[3]))))
+				wrap.W.Write([]byte(wrap.ShopBasket.Minus(&SBParam, utils.StrToInt(wrap.UrlArgs[3]))))
 				return
 			} else if wrap.UrlArgs[2] == "remove" && len(wrap.UrlArgs) == 4 && utils.IsNumeric(wrap.UrlArgs[3]) {
 				wrap.W.WriteHeader(http.StatusOK)
 				wrap.W.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
 				wrap.W.Header().Set("Content-Type", "application/json; charset=utf-8")
-				wrap.W.Write([]byte(wrap.ShopBasket.Remove(wrap.R, wrap.CurrHost, wrap.GetSessionId(), wrap.DB, utils.StrToInt(wrap.UrlArgs[3]))))
+				wrap.W.Write([]byte(wrap.ShopBasket.Remove(&SBParam, utils.StrToInt(wrap.UrlArgs[3]))))
 				return
 			} else if wrap.UrlArgs[2] == "currency" && len(wrap.UrlArgs) == 4 && utils.IsNumeric(wrap.UrlArgs[3]) {
 				http.SetCookie(wrap.W, &http.Cookie{

+ 3 - 3
utils/utils.go

@@ -125,7 +125,7 @@ func ExtractHostPort(host string, https bool) (string, string) {
 }
 
 func GetAssetsUrl(filename string) string {
-	return "/" + filename + "?v=" + consts.AssetsVersion
+	return "/" + filename + "?v=" + consts.ServerVersion
 }
 
 func GetTmplSystemData(cpmod, cpsubmod string) consts.TmplSystem {
@@ -147,8 +147,8 @@ func GetTmplSystemData(cpmod, cpsubmod string) consts.TmplSystem {
 		PathJsLightGallery:   GetAssetsUrl(consts.AssetsLightGalleryJs),
 		PathJsPopper:         GetAssetsUrl(consts.AssetsPopperJs),
 		PathSvgLogo:          GetAssetsUrl(consts.AssetsSysLogoSvg),
-		PathThemeScripts:     "/assets/theme/scripts.js",
-		PathThemeStyles:      "/assets/theme/styles.css",
+		PathThemeScripts:     "/assets/theme/scripts.js?v=" + consts.ServerVersion,
+		PathThemeStyles:      "/assets/theme/styles.css?v=" + consts.ServerVersion,
 		CpModule:             cpmod,
 	}
 }

+ 18 - 18
utils/utils_test.go

@@ -128,7 +128,7 @@ func TestExtractHostPort(t *testing.T) {
 }
 
 func TestGetAssetsUrl(t *testing.T) {
-	Expect(t, GetAssetsUrl("style.css"), "/style.css?v="+consts.AssetsVersion)
+	Expect(t, GetAssetsUrl("style.css"), "/style.css?v="+consts.ServerVersion)
 }
 
 func TestGetTmplSystemData(t *testing.T) {
@@ -136,23 +136,23 @@ func TestGetTmplSystemData(t *testing.T) {
 		CpModule:             "module",
 		CpSubModule:          "module",
 		InfoVersion:          consts.ServerVersion,
-		PathCssBootstrap:     "/assets/bootstrap.css?v=" + consts.AssetsVersion,
-		PathCssCpCodeMirror:  "/assets/cp/tmpl-editor/codemirror.css?v=" + consts.AssetsVersion,
-		PathCssCpStyles:      "/assets/cp/styles.css?v=" + consts.AssetsVersion,
-		PathCssCpWysiwygPell: "/assets/cp/wysiwyg/pell.css?v=" + consts.AssetsVersion,
-		PathCssStyles:        "/assets/sys/styles.css?v=" + consts.AssetsVersion,
-		PathJsBootstrap:      "/assets/bootstrap.js?v=" + consts.AssetsVersion,
-		PathJsCpCodeMirror:   "/assets/cp/tmpl-editor/codemirror.js?v=" + consts.AssetsVersion,
-		PathJsCpScripts:      "/assets/cp/scripts.js?v=" + consts.AssetsVersion,
-		PathJsCpWysiwygPell:  "/assets/cp/wysiwyg/pell.js?v=" + consts.AssetsVersion,
-		PathJsJquery:         "/assets/jquery.js?v=" + consts.AssetsVersion,
-		PathJsPopper:         "/assets/popper.js?v=" + consts.AssetsVersion,
-		PathSvgLogo:          "/assets/sys/logo.svg?v=" + consts.AssetsVersion,
-		PathThemeScripts:     "/assets/theme/scripts.js",
-		PathThemeStyles:      "/assets/theme/styles.css",
-		PathIcoFav:           "/assets/sys/fave.ico?v=" + consts.AssetsVersion,
-		PathCssLightGallery:  "/assets/lightgallery.css?v=" + consts.AssetsVersion,
-		PathJsLightGallery:   "/assets/lightgallery.js?v=" + consts.AssetsVersion,
+		PathCssBootstrap:     "/assets/bootstrap.css?v=" + consts.ServerVersion,
+		PathCssCpCodeMirror:  "/assets/cp/tmpl-editor/codemirror.css?v=" + consts.ServerVersion,
+		PathCssCpStyles:      "/assets/cp/styles.css?v=" + consts.ServerVersion,
+		PathCssCpWysiwygPell: "/assets/cp/wysiwyg/pell.css?v=" + consts.ServerVersion,
+		PathCssStyles:        "/assets/sys/styles.css?v=" + consts.ServerVersion,
+		PathJsBootstrap:      "/assets/bootstrap.js?v=" + consts.ServerVersion,
+		PathJsCpCodeMirror:   "/assets/cp/tmpl-editor/codemirror.js?v=" + consts.ServerVersion,
+		PathJsCpScripts:      "/assets/cp/scripts.js?v=" + consts.ServerVersion,
+		PathJsCpWysiwygPell:  "/assets/cp/wysiwyg/pell.js?v=" + consts.ServerVersion,
+		PathJsJquery:         "/assets/jquery.js?v=" + consts.ServerVersion,
+		PathJsPopper:         "/assets/popper.js?v=" + consts.ServerVersion,
+		PathSvgLogo:          "/assets/sys/logo.svg?v=" + consts.ServerVersion,
+		PathThemeScripts:     "/assets/theme/scripts.js?v=" + consts.ServerVersion,
+		PathThemeStyles:      "/assets/theme/styles.css?v=" + consts.ServerVersion,
+		PathIcoFav:           "/assets/sys/fave.ico?v=" + consts.ServerVersion,
+		PathCssLightGallery:  "/assets/lightgallery.css?v=" + consts.ServerVersion,
+		PathJsLightGallery:   "/assets/lightgallery.js?v=" + consts.ServerVersion,
 	})
 }