diff --git a/component/barang.templ b/component/barang.templ
index 8204467..f9ee70d 100644
--- a/component/barang.templ
+++ b/component/barang.templ
@@ -3,43 +3,47 @@ package component
import "git.proximination.com/pclatihan/wstempl/model"
templ BarangView(mdl model.Barang) {
-
-
{ mdl.Nama }
-
{ mdl.Merk }
-
-
- | PANJANG |
- { mdl.Panjang } |
-
-
- | LEBAR |
- { mdl.Lebar } |
-
-
- | TINGGI |
- { mdl.Tinggi } |
-
-
- | SATUAN |
- { mdl.Unit } |
-
-
- | STATUS |
- { mdl.Status } |
-
-
-
BACK
-
+
+
{ mdl.Nama }
+
Merk: { mdl.Merk }
+
+
+ | Panjang |
+ { mdl.Panjang } |
+
+
+ | Lebar |
+ { mdl.Lebar } |
+
+
+ | Tinggi |
+ { mdl.Tinggi } |
+
+
+ | Satuan |
+ { mdl.Unit } |
+
+
+ | Status |
+ { mdl.Status } |
+
+
+ | Warna |
+ { mdl.Warna } |
+
+
+
← Kembali ke daftar
+
}
templ DaftarBarangView(mdl model.DaftarBarang) {
@Common("DAFTAR") {
-
+
+ for _, item := range mdl.Items {
+ -
+ { item.Nama }
+
+ }
+
}
}
diff --git a/component/common.templ b/component/common.templ
index e7bbed2..ad0eb64 100644
--- a/component/common.templ
+++ b/component/common.templ
@@ -1,24 +1,16 @@
package component
-templ Common(pagename string) {
-
-
+templ Common(title string) {
+
-
-
- { pagename }
+ { title }
+
-
-
- { children... }
+
+
+ { children... }
+
}
+
diff --git a/mock/mockv2.go b/mock/mockv2.go
index 5d6b7b8..dc3f663 100644
--- a/mock/mockv2.go
+++ b/mock/mockv2.go
@@ -22,6 +22,7 @@ func (m MockV2) GetBarang(nama string) (model.Barang, error) {
Tinggi: gofakeit.Numerify("#"),
Unit: gofakeit.AppName(),
Status: gofakeit.RandomString([]string{"Sehat", "Rusak", "Dicuri Orang"}),
+ Warna : gofakeit.Color(),
}
return model, nil
}
diff --git a/model/barang.go b/model/barang.go
index 55b8225..64af7f3 100644
--- a/model/barang.go
+++ b/model/barang.go
@@ -8,4 +8,5 @@ type Barang struct {
Tinggi string
Unit string
Status string
+ Warna string
}