Shop improvements
This commit is contained in:
29
pages/inventory/inventory.go
Normal file
29
pages/inventory/inventory.go
Normal file
@ -0,0 +1,29 @@
|
||||
package inventory
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/animenotifier/arn"
|
||||
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// Get inventory page.
|
||||
func Get(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil {
|
||||
return ctx.Error(http.StatusUnauthorized, "Not logged in", nil)
|
||||
}
|
||||
|
||||
inventory, err := arn.GetInventory(user.ID)
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Error fetching inventory data", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Inventory(inventory))
|
||||
}
|
7
pages/inventory/inventory.pixy
Normal file
7
pages/inventory/inventory.pixy
Normal file
@ -0,0 +1,7 @@
|
||||
component Inventory(inventory *arn.Inventory)
|
||||
ShopTabs
|
||||
.inventory
|
||||
each slot in inventory.Slots
|
||||
.inventory-slot
|
||||
span= slot.ItemID
|
||||
p Coming soon.
|
0
pages/inventory/inventory.scarlet
Normal file
0
pages/inventory/inventory.scarlet
Normal file
Reference in New Issue
Block a user