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) {
|
||||
// index route - landing page for the user
|
||||
f.Get("/", func(t template.Template, data template.Data) {
|
||||
data["title"] = "Dashboard"
|
||||
t.HTML(http.StatusOK, "index")
|
||||
})
|
||||
|
||||
// item list route - lists all of the items in the database
|
||||
f.Group("/item", func() {
|
||||
f.Get("/list", func(t template.Template, data template.Data) {
|
||||
data["title"] = "List of Inventory"
|
||||
t.HTML(http.StatusOK, "item/list")
|
||||
})
|
||||
|
||||
f.Get("/create", func(t template.Template, data template.Data) {
|
||||
data["title"] = "Create New Item"
|
||||
t.HTML(http.StatusOK, "item/create")
|
||||
})
|
||||
})
|
||||
|
@ -5,6 +5,8 @@
|
||||
<ul>
|
||||
{{ range .inventory }}
|
||||
<li>{{ .name }}</li>
|
||||
{{ else }}
|
||||
<p>There are currently no items registered in your inventory.</p>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user