2017-10-03 15:26:29 +02:00
|
|
|
package shop
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2017-10-04 08:12:12 +02:00
|
|
|
"github.com/animenotifier/arn"
|
|
|
|
|
2017-10-03 15:26:29 +02:00
|
|
|
"github.com/aerogo/aero"
|
|
|
|
"github.com/animenotifier/notify.moe/components"
|
|
|
|
"github.com/animenotifier/notify.moe/utils"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Get shop page.
|
|
|
|
func Get(ctx *aero.Context) string {
|
|
|
|
user := utils.GetUser(ctx)
|
|
|
|
|
|
|
|
if user == nil {
|
|
|
|
return ctx.Error(http.StatusUnauthorized, "Not logged in", nil)
|
|
|
|
}
|
|
|
|
|
2017-10-04 08:12:12 +02:00
|
|
|
items := arn.AllItems()
|
|
|
|
|
|
|
|
return ctx.HTML(components.Shop(user, items))
|
2017-10-03 15:26:29 +02:00
|
|
|
}
|