Kategorien und Produkte können zur DB hinzugefügt werden.
This commit is contained in:
@@ -184,10 +184,18 @@ func (server *Server) routeInit() {
|
|||||||
server.Router.HandleFunc("/logout", server.Logout).Methods("GET")
|
server.Router.HandleFunc("/logout", server.Logout).Methods("GET")
|
||||||
|
|
||||||
server.Router.HandleFunc("/products/cat/{id}", server.ProductsByCategory).Methods("GET")
|
server.Router.HandleFunc("/products/cat/{id}", server.ProductsByCategory).Methods("GET")
|
||||||
server.Router.HandleFunc("/products/{slug}", server.GetProductByID).Methods("GET")
|
server.Router.HandleFunc("/products/{id}", server.GetProductByID).Methods("GET")
|
||||||
|
|
||||||
server.Router.HandleFunc("/section/{id}", server.Categories).Methods("GET")
|
server.Router.HandleFunc("/section/{id}", server.Categories).Methods("GET")
|
||||||
|
|
||||||
|
server.Router.HandleFunc("/admin/category/{spielid}", server.AdminCategoryList).Methods("GET")
|
||||||
|
server.Router.HandleFunc("/admin/category", server.AdminCategoryPost).Methods("POST")
|
||||||
|
|
||||||
|
server.Router.HandleFunc("/admin/product/add/{categoryID}", server.AddProduct).Methods("GET")
|
||||||
|
server.Router.HandleFunc("/admin/product", server.DoAddProduct).Methods("POST")
|
||||||
|
server.Router.HandleFunc("/admin/product/{productID}", server.AddProduct).Methods("GET")
|
||||||
|
server.Router.HandleFunc("/admin/product/{productID}", server.DoEditProduct).Methods("POST")
|
||||||
|
|
||||||
staticFileDirectory := http.Dir("./assets/")
|
staticFileDirectory := http.Dir("./assets/")
|
||||||
staticFileHandler := http.StripPrefix("/public/", http.FileServer(staticFileDirectory))
|
staticFileHandler := http.StripPrefix("/public/", http.FileServer(staticFileDirectory))
|
||||||
server.Router.PathPrefix("/public/").Handler(staticFileHandler).Methods("GET")
|
server.Router.PathPrefix("/public/").Handler(staticFileHandler).Methods("GET")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/google/uuid"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/unrolled/render"
|
"github.com/unrolled/render"
|
||||||
"moretcgshop/app/models"
|
"moretcgshop/app/models"
|
||||||
@@ -19,9 +20,9 @@ func (server *Server) Categories(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
categorieModel := models.Category{}
|
categoryModel := models.Category{}
|
||||||
|
|
||||||
categorien, err := categorieModel.GetCategorie(server.DB, vars["id"])
|
categories, err := categoryModel.GetCategory(server.DB, vars["id"])
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println(err.Error())
|
||||||
@@ -29,7 +30,63 @@ func (server *Server) Categories(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_ = renderer.HTML(w, http.StatusOK, "categories", map[string]interface{}{
|
_ = renderer.HTML(w, http.StatusOK, "categories", map[string]interface{}{
|
||||||
//"user": user,
|
"categories": categories,
|
||||||
"categorien": categorien,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (server *Server) AdminCategoryList(w http.ResponseWriter, r *http.Request) {
|
||||||
|
renderer := render.New(render.Options{
|
||||||
|
Layout: "layout",
|
||||||
|
Extensions: []string{".html", ".tmpl"},
|
||||||
|
})
|
||||||
|
|
||||||
|
vars := mux.Vars(r)
|
||||||
|
if vars["spielid"] == "" {
|
||||||
|
println("spielid is leer")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
section, err := models.GetSectionByID(server.DB, vars["spielid"])
|
||||||
|
|
||||||
|
categoryModel := models.Category{}
|
||||||
|
categories, err := categoryModel.GetCategory(server.DB, vars["spielid"])
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
println(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = renderer.HTML(w, http.StatusOK, "admin_categoryList", map[string]interface{}{
|
||||||
|
"categories": categories,
|
||||||
|
"spiel": section,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (server *Server) AdminCategoryPost(w http.ResponseWriter, r *http.Request) {
|
||||||
|
kategorieName := r.FormValue("katname")
|
||||||
|
spielID := r.FormValue("spielid")
|
||||||
|
|
||||||
|
if kategorieName == "" {
|
||||||
|
SetFlash(w, r, "error", "Kategoriename wurde nicht eingetragen")
|
||||||
|
http.Redirect(w, r, "/admin/category/"+spielID, http.StatusSeeOther)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
kategorieModel := &models.Category{}
|
||||||
|
|
||||||
|
params := &models.Category{
|
||||||
|
ID: uuid.New().String(),
|
||||||
|
Name: kategorieName,
|
||||||
|
SectionID: spielID,
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := kategorieModel.CreateCategory(server.DB, params)
|
||||||
|
if err != nil {
|
||||||
|
SetFlash(w, r, "error", "Sorry das war nicht erfolgreich")
|
||||||
|
http.Redirect(w, r, "/admin/category/"+spielID, http.StatusSeeOther)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
http.Redirect(w, r, "/admin/category/"+spielID, http.StatusSeeOther)
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,13 +1,96 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/google/uuid"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/shopspring/decimal"
|
||||||
"github.com/unrolled/render"
|
"github.com/unrolled/render"
|
||||||
|
"log"
|
||||||
"moretcgshop/app/models"
|
"moretcgshop/app/models"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (server *Server) AddProduct(w http.ResponseWriter, r *http.Request) {
|
||||||
|
renderer := render.New(render.Options{
|
||||||
|
Layout: "layout",
|
||||||
|
Extensions: []string{".html", ".tmpl"},
|
||||||
|
})
|
||||||
|
|
||||||
|
//http://localhost:9000/admin/product/add/7bfbead0-cbef-4eb1-bb8d-966359050047
|
||||||
|
vars := mux.Vars(r)
|
||||||
|
if vars["categoryID"] == "" {
|
||||||
|
println("CategoryID is null")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
categoryID := vars["categoryID"]
|
||||||
|
|
||||||
|
categoryModel := &models.Category{}
|
||||||
|
|
||||||
|
category, err := categoryModel.GetCategoryByID(server.DB, categoryID)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = renderer.HTML(w, http.StatusOK, "admin_productAdd", map[string]interface{}{
|
||||||
|
"category": category,
|
||||||
|
"error": GetFlash(w, r, "error"),
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (server *Server) DoAddProduct(w http.ResponseWriter, r *http.Request) {
|
||||||
|
name := r.FormValue("name")
|
||||||
|
price := r.FormValue("price")
|
||||||
|
shortdescription := r.FormValue("shortdescription")
|
||||||
|
description := r.FormValue("description")
|
||||||
|
categoryID := r.FormValue("categoryID")
|
||||||
|
|
||||||
|
if name == "" || price == "" || shortdescription == "" || description == "" {
|
||||||
|
SetFlash(w, r, "error", "Name,Preis, Kurze Beschreibung und Beschreibung sind pflicht Felder")
|
||||||
|
http.Redirect(w, r, "/admin/product/add/"+categoryID, http.StatusSeeOther)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
productModel := models.Product{}
|
||||||
|
|
||||||
|
pr, err := decimal.NewFromString(price)
|
||||||
|
if err != nil {
|
||||||
|
SetFlash(w, r, "error", err.Error())
|
||||||
|
http.Redirect(w, r, "/admin/product/add/"+categoryID, http.StatusSeeOther)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
params := &models.Product{
|
||||||
|
ID: uuid.New().String(),
|
||||||
|
Name: name,
|
||||||
|
ShortDescription: shortdescription,
|
||||||
|
Description: description,
|
||||||
|
CategoryID: categoryID,
|
||||||
|
Price: pr,
|
||||||
|
}
|
||||||
|
|
||||||
|
product, err := productModel.CreateProduct(server.DB, params)
|
||||||
|
if err != nil {
|
||||||
|
log.Println(err.Error())
|
||||||
|
SetFlash(w, r, "error", "Sorry Produkt konnte nicht hinzugefügt werden")
|
||||||
|
http.Redirect(w, r, "/admin/product/add/"+categoryID, http.StatusSeeOther)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = product
|
||||||
|
http.Redirect(w, r, "/admin/product/add/"+categoryID, http.StatusSeeOther)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (server *Server) GetEditProduct(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (server *Server) DoEditProduct(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func (server *Server) ProductsByCategory(w http.ResponseWriter, r *http.Request) {
|
func (server *Server) ProductsByCategory(w http.ResponseWriter, r *http.Request) {
|
||||||
renderer := render.New(render.Options{
|
renderer := render.New(render.Options{
|
||||||
Layout: "layout",
|
Layout: "layout",
|
||||||
@@ -55,12 +138,12 @@ func (server *Server) GetProductByID(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
|
|
||||||
if vars["slug"] == "" {
|
if vars["id"] == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
productModel := models.Product{}
|
productModel := models.Product{}
|
||||||
product, err := productModel.FindByID(server.DB, vars["slug"])
|
product, err := productModel.FindByID(server.DB, vars["id"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println(err.Error())
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -17,13 +17,39 @@ type Category struct {
|
|||||||
UpdatedAt time.Time
|
UpdatedAt time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Category) GetCategorie(db *gorm.DB, sectionID string) (*[]Category, error) {
|
func (p *Category) GetCategory(db *gorm.DB, sectionID string) (*[]Category, error) {
|
||||||
|
|
||||||
var categorie []Category
|
var categories []Category
|
||||||
|
|
||||||
err := db.Debug().Model(&Category{}).Order("created_at desc").Where("section_id = ?", sectionID).Find(&categorie).Error
|
err := db.Debug().Model(&Category{}).Order("created_at desc").Where("section_id = ?", sectionID).Find(&categories).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &categorie, nil
|
return &categories, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *Category) GetCategoryByID(db *gorm.DB, categoryID string) (*Category, error) {
|
||||||
|
var result Category
|
||||||
|
|
||||||
|
err := db.Debug().Model(&Category{}).Where("id = ?", categoryID).Find(&result).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *Category) CreateCategory(db *gorm.DB, param *Category) (*Category, error) {
|
||||||
|
category := &Category{
|
||||||
|
ID: param.ID,
|
||||||
|
Name: param.Name,
|
||||||
|
SectionID: param.SectionID,
|
||||||
|
CreatedAt: time.Time{},
|
||||||
|
UpdatedAt: time.Time{},
|
||||||
|
}
|
||||||
|
|
||||||
|
err := db.Debug().Create(&category).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return category, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,3 +21,12 @@ func GetSection(db *gorm.DB) ([]Section, error) {
|
|||||||
}
|
}
|
||||||
return sections, nil
|
return sections, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetSectionByID(db *gorm.DB, id string) (Section, error) {
|
||||||
|
var section Section
|
||||||
|
err := db.Debug().Model(&Section{}).Where("id = ?", id).Find(§ion).Error
|
||||||
|
if err != nil {
|
||||||
|
|
||||||
|
}
|
||||||
|
return section, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,25 @@ type Product struct {
|
|||||||
DeletedAt gorm.DeletedAt
|
DeletedAt gorm.DeletedAt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *Product) CreateProduct(db *gorm.DB, param *Product) (*Product, error) {
|
||||||
|
product := &Product{
|
||||||
|
ID: param.ID,
|
||||||
|
Name: param.Name,
|
||||||
|
Price: param.Price,
|
||||||
|
CategoryID: param.CategoryID,
|
||||||
|
Description: param.Description,
|
||||||
|
ShortDescription: param.ShortDescription,
|
||||||
|
CreatedAt: time.Time{},
|
||||||
|
UpdatedAt: time.Time{},
|
||||||
|
}
|
||||||
|
|
||||||
|
err := db.Debug().Create(&product).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return product, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (p *Product) GetProducts(db *gorm.DB, perPage int, page int) (*[]Product, int64, error) {
|
func (p *Product) GetProducts(db *gorm.DB, perPage int, page int) (*[]Product, int64, error) {
|
||||||
|
|
||||||
var count int64
|
var count int64
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ type User struct {
|
|||||||
Email string
|
Email string
|
||||||
Password string
|
Password string
|
||||||
RememberToken string
|
RememberToken string
|
||||||
|
Admin bool
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time
|
||||||
DeletedAt gorm.DeletedAt
|
DeletedAt gorm.DeletedAt
|
||||||
|
|||||||
@@ -11,10 +11,7 @@ type Seeder struct {
|
|||||||
|
|
||||||
func RegisterSeeders(db *gorm.DB) []Seeder {
|
func RegisterSeeders(db *gorm.DB) []Seeder {
|
||||||
return []Seeder{
|
return []Seeder{
|
||||||
{Seeder: fakers.UserFaker(db)},
|
|
||||||
{Seeder: fakers.ProductFaker(db)},
|
|
||||||
{Seeder: fakers.SectionFaker(db)},
|
{Seeder: fakers.SectionFaker(db)},
|
||||||
{Seeder: fakers.CategoryFaker(db)},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
37
templates/pages/admin/category_admin.html
Normal file
37
templates/pages/admin/category_admin.html
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{{ define "admin_categoryList" }}
|
||||||
|
<h1>Adminpage vom {{ .spiel.Name }}</h1>
|
||||||
|
{{ if .error }}
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
{{ range $i, $msg := .error }}
|
||||||
|
{{ $msg }}<br/>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
{{ range $i, $category := .categories }}
|
||||||
|
<li><a href="/products/cat/{{ $category.ID }}">{{ $category.Name }}</a></li>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ template "admin_categoryAdd" $d := .spiel.ID }}
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
{{ define "admin_categoryAdd" }}
|
||||||
|
<form role="form" action="/admin/category" method="POST">
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<div class="input-group input-group-alternative">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="ni ni-box-2"></i></span>
|
||||||
|
</div>
|
||||||
|
<input name="spielid" type="hidden" value="{{ . }}" />
|
||||||
|
<input class="form-control" name="katname" placeholder="Kategorie Name" type="text" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="text-center">
|
||||||
|
<button type="submit" class="btn btn-primary my-4">Speichern</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
69
templates/pages/admin/product_admin.html
Normal file
69
templates/pages/admin/product_admin.html
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
{{ define "admin_productAdd" }}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="container pt-lg-5 pb-lg-5">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card bg-secondary shadow border-0">
|
||||||
|
<div class="card-header bg-white pb-5">
|
||||||
|
<div class="text-muted text-center mb-3"><small>Neue Produkt Hinzufügen in den Kategorie {{ .category.Name }}</small></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="card-body px-lg-5 py-lg-5">
|
||||||
|
<!--<div class="text-center text-muted mb-4">
|
||||||
|
<small>Or sign in with credentials</small>
|
||||||
|
</div>-->
|
||||||
|
{{ if .error }}
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
{{ range $i, $msg := .error }}
|
||||||
|
{{ $msg }}<br/>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
<form role="form" action="/admin/product" method="POST">
|
||||||
|
<input type="hidden" name="categoryID" value="{{ .category.ID }}" />
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<div class="input-group input-group-alternative">
|
||||||
|
<input class="form-control" name="name" placeholder="Produktname" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<div class="input-group input-group-alternative">
|
||||||
|
<input class="form-control" name="price" placeholder="Produkt Preis Bitte Trenner als Punkt" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group focused">
|
||||||
|
<div class="input-group input-group-alternative">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="ni ni-lock-circle-open"></i></span>
|
||||||
|
</div>
|
||||||
|
<input class="form-control" name="shortdescription" placeholder="Kurze Beschreibung" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<div class="input-group input-group-alternative">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="ni ni-paper-diploma"></i></span>
|
||||||
|
</div>
|
||||||
|
<textarea class="form-control" name="description" placeholder="Beschreibung" type="text"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<button type="submit" class="btn btn-primary my-4">Produkt hinzufügen</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="widget-content widget-categories">
|
<div class="widget-content widget-categories">
|
||||||
<ul>
|
<ul>
|
||||||
{{ range $i, $categorie := .categorien }}
|
{{ range $i, $categorie := .categories }}
|
||||||
<li><a href="/products/cat/{{ $categorie.ID }}">{{ $categorie.Name }}</a></li>
|
<li><a href="/products/cat/{{ $categorie.ID }}">{{ $categorie.Name }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>-->
|
</div>-->
|
||||||
|
<!--
|
||||||
<div class="sidebar-widget">
|
<div class="sidebar-widget">
|
||||||
<div class="widget-title">
|
<div class="widget-title">
|
||||||
<h3>Categories</h3>
|
<h3>Categories</h3>
|
||||||
@@ -52,7 +53,7 @@
|
|||||||
<li><a href="#">Digital Goods</a></li>
|
<li><a href="#">Digital Goods</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>-->
|
||||||
<!--
|
<!--
|
||||||
<div class="sidebar-widget">
|
<div class="sidebar-widget">
|
||||||
<div class="widget-title">
|
<div class="widget-title">
|
||||||
@@ -77,7 +78,11 @@
|
|||||||
<div class="products-top">
|
<div class="products-top">
|
||||||
<div class="products-top-inner">
|
<div class="products-top-inner">
|
||||||
<div class="products-found">
|
<div class="products-found">
|
||||||
<p><span>25</span> products found of <span>1.342</span></p>
|
{{ if eq (len .products) 1 }}
|
||||||
|
<p><span>1 Produkt gefunden</span></p>
|
||||||
|
{{ else }}
|
||||||
|
<p><span>{{ len .products }}</span> Produkte gefunden</span></p>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<!--
|
<!--
|
||||||
<div class="products-sort">
|
<div class="products-sort">
|
||||||
@@ -98,12 +103,12 @@
|
|||||||
<div class="col-lg-4 col-md-6 col-12">
|
<div class="col-lg-4 col-md-6 col-12">
|
||||||
<div class="single-product">
|
<div class="single-product">
|
||||||
<div class="product-img">
|
<div class="product-img">
|
||||||
<a href="/products/{{ $product.Slug }}">
|
<a href="/products/{{ $product.ID }}">
|
||||||
<img src="https://placehold.jp/300x400.png" class="img-fluid" />
|
<img src="https://placehold.jp/300x400.png" class="img-fluid" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="product-content">
|
<div class="product-content">
|
||||||
<h3><a href="/products/{{ $product.Slug }}">{{ $product.Name }}</a></h3>
|
<h3><a href="/products/{{ $product.ID }}">{{ $product.Name }}</a></h3>
|
||||||
<div class="product-price">
|
<div class="product-price">
|
||||||
<span>{{ $product.Price }}</span>
|
<span>{{ $product.Price }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user