Added titles; updated the items list view
This commit is contained in:
parent
ba0eb8649b
commit
ec78e5e1ae
@ -10,16 +10,19 @@ import (
|
|||||||
func RegisterRoutes(f *flamego.Flame) {
|
func RegisterRoutes(f *flamego.Flame) {
|
||||||
// index route - landing page for the user
|
// index route - landing page for the user
|
||||||
f.Get("/", func(t template.Template, data template.Data) {
|
f.Get("/", func(t template.Template, data template.Data) {
|
||||||
|
data["title"] = "Dashboard"
|
||||||
t.HTML(http.StatusOK, "index")
|
t.HTML(http.StatusOK, "index")
|
||||||
})
|
})
|
||||||
|
|
||||||
// item list route - lists all of the items in the database
|
// item list route - lists all of the items in the database
|
||||||
f.Group("/item", func() {
|
f.Group("/item", func() {
|
||||||
f.Get("/list", func(t template.Template, data template.Data) {
|
f.Get("/list", func(t template.Template, data template.Data) {
|
||||||
|
data["title"] = "List of Inventory"
|
||||||
t.HTML(http.StatusOK, "item/list")
|
t.HTML(http.StatusOK, "item/list")
|
||||||
})
|
})
|
||||||
|
|
||||||
f.Get("/create", func(t template.Template, data template.Data) {
|
f.Get("/create", func(t template.Template, data template.Data) {
|
||||||
|
data["title"] = "Create New Item"
|
||||||
t.HTML(http.StatusOK, "item/create")
|
t.HTML(http.StatusOK, "item/create")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
<ul>
|
<ul>
|
||||||
{{ range .inventory }}
|
{{ range .inventory }}
|
||||||
<li>{{ .name }}</li>
|
<li>{{ .name }}</li>
|
||||||
|
{{ else }}
|
||||||
|
<p>There are currently no items registered in your inventory.</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user