Shop improvements

This commit is contained in:
2017-10-04 08:12:12 +02:00
parent aec23d0b6e
commit 16ab79b3a8
13 changed files with 134 additions and 53 deletions

View 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))
}

View 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.

View File