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

@ -1,21 +1,15 @@
package shop
import (
"io/ioutil"
"net/http"
"github.com/animenotifier/arn"
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils"
)
var proAccount = ""
func init() {
data, _ := ioutil.ReadFile("pages/shop/pro-account.md")
proAccount = string(data)
}
// Get shop page.
func Get(ctx *aero.Context) string {
user := utils.GetUser(ctx)
@ -24,5 +18,7 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusUnauthorized, "Not logged in", nil)
}
return ctx.HTML(components.Shop(user, proAccount))
items := arn.AllItems()
return ctx.HTML(components.Shop(user, items))
}